nrfjprog

/Users/dgerman/Downloads/nRF5x-Command-Line-Tools_9_7_2_OSX/nrfjprog/nrfjprog
-f
--family NRF51| NRF52 |
         UNKNOWN
UNKNOWN : slow automatic family detection is performed.
default from nrfjprog.ini
[DEFAULT_CONFIGURATION]
; Define the desired family of devices to use by default by nrfjprog.exe when -f or --family arguments are not used. The only valid options are NRF51, NRF52 or UNKNOWN.
; If set to UNKNOWN an automatic family detection will be performed. The autodetect family operation will take time, so it is advised to use correct family if known.
Family = UNKNOWN
; Define the desired clockspeed in kHz you want nrfjprog.exe use by default when -c or --clockspeed arguments are not used. The range of valid values go from 125 kHz to 50000 kHz.
Clockspeed = 2000
-e
--eraseall
Erases all user program flash memory and the UICR page. Can be combined with --qspieraseall .
--qspieraseall Erases all the flash of the external memory device using the QSPI peripheral.
depending on the external memory the operation might take minutes.
Can be combined with the --eraseall operation. not available for nRF51 and nRF52 for devices with QSPI . device. To determine if an external memory device is connected, nrfjprog checks MemSize parameter from the QspiDefault.ini file or the QSPI configuration ini file that is given with the --qspiini option.
--eraseuicr Erases UICR
--erasepage start[-end] Erases the flash pages starting at the page containing start and ending at the page containing end (not included in the erase).
If end is not given, one page will be erased.

If device is equipped with a QSPI peripheral, the pages to erase belong to the XIP region of the device, and an external memory device is present, Erases 4 kB pages from the external memory device. The first address of the region is considered as address 0 of the external memory device. To determine if an external memory device is present, nrfjprog checks the MemSize parameter from QspiDefault.ini

nRF51 :, the page will not be erased if it belongs to region 0.

--program hex_file
[ --chiperase |
  --sectorerase |
  --sectoranduicrerase]
[--qspisectorerase |
 --qspichiperase]
Write hex_file to Device's program memory.
Fails if the target area is not erased, unless an erase option is given.
ERROR: The area to write is not erased.
> echo $?
58

--sectorerase only the targeted pages will be erased.
--sectoranduicrerase the targeted pages and UICR will be erased.

If device is equipped with a QSPI peripheral and an external memory device is present, data targeting the XIP region will be written to the external memory device. The first address of the XIP region is considered as address 0 of the external memory device.
For the external memory device --qspichiperase the external device will be erased.
With --qspisectorerase , only 4kB pages pages will be erased.

Can be combined with --verify .
Can be combined with --reset or --debugreset

Fails if hex_file contains sectors belonging to region 0

--sectoranduicrerase and --sectorerase take significantly longer time then --chiperase

nRF51 --sectoranduicrerase is not available.

--verify [hex_file]
  [--fast]
--fast calculates a hash and compares it
Can be combined with the --program, --memwr and --ramw if no hex_file

nRF51 , --fast is not available.

Verifying programming.
Verified OK.
--memwr addr --val val Writes using the NVM Controller or QSPI peripheral.
If the target address is flash and not erased, the operation fails.
Can be combined with --verify
nrfjprog --memwr 0x10001088 --val 10981692
--ramwr addr --val val Writes to memory
If the target address is in non-volatile memory, has no effect unless the non-volatile memory controller (NVMC) has been previously configured for a write .
Can be combined with the --verify operation.
--memrd 0xaddr [--w width]
          [--n n]
Reads from addr.
addr and n must be aligned to the width parameter.
width must be 8, 16 or 32. If width is not given, 32-bit words will be read if addr is word aligned,
16-bit words if addr is half word aligned.
default n is 1
maximum number of bytes that can be read is 1 MB.
If device is equipped with a QSPI peripheral, and the addresses to read belong to the XIP region, the QSPI peripheral is used to read from the external memory device A single --memrd cannot read addresses from both the external memory device and the nRF device.
--memrd 0xffffffc0 --n 0x40    dump stack
0xFFFFFFC0: 00000000 00000000 00000000 00000000   |................|
0xFFFFFFD0: 00000000 00000000 00000000 00000000   |................|
0xFFFFFFE0: 00000000 00000000 00000000 00000000   |................|
0xFFFFFFF0: 00000000 00000000 00000000 00000000   |................|
--halt Halts the CPU core.
--run
[--pc pc_addr --sp sp_addr]
Starts the CPU. --pc and --sp are given, the pc_addr and sp_addr are used as initial PC and stack pointer.
pc_addr valid its last bit must be one.
sp_addr must be word aligned.
--readuicr file stores UICR in file
Can be combined with --readram, --readcode and --readqspi.
Only one instruction can provide a file name.
:020000041000EA
:10100000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 NRFFW
:10101000FFFFFFFF0050070000E00700FFFFFFFF9A   firmware
:10102000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0
:10103000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0
:10104000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0
:10105000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0
:10106000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90
:10107000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80
:10108000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70  customer
:10109000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60
:1010A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50
:1010B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40
:1010C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30
:1010D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF20
:1010E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF10
:1010F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
:10110000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF
…
:1011F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
:101200001500000015000000FFFFFFFFFFFFFFFFBC  PSELRESET[0]  reset pin mapping
:10121000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDE 
…
:101FE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01
:101FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1
:00000001FF
--readcode [file] Reads flash and …
--readram [file] Reads ram and …
--readqspi [file] Reads QSPI-connected external memory and …
--readregs Reads the cpu registers.
--pinresetenable Enables the pin reset by the use of UICR PSELRESET on nRF52
-p
--pinreset
Performs a pin reset. Core will run after the operation.
-r
--reset
soft reset by setting the SysResetReq bit of AIRCR
The core will run after the operation.
-d
--debugreset
soft reset by the use of the CTRL-AP.
The core will run after the operation.
not available for nRF51 or nRF52 for nRF52832_xxAA_ENGA .
-c
--clockspeed kHz
Sets the debugger SWD clock speed. 125 kHz .. 50000 kHz.
-s
--snr serial_number
Selects the debugger among those connected to the PC
--jdll file instead of searching for the latest version of Segger's JLinkARM dll.
--ini file default i nrfjprog.ini in the installation folder.
--qspiini file Override QspiDefault.ini in the installation folder
Must be combined with --erasepage, --memrd, --memwr, --program, --verify, --readqspi or --qspieraseall
--qspicustominit Use the QSPI custom instructions defined in the QSPI settings file used in the operation when initializing the QSPI peripheral. see QSPIDefault.ini .
Must be combined with --memrd, --memwr, --program, --verify, --erasepage or --qspieraseall
--rbp CR0|ALL Enables the ReadBack Protection mechanism.
After an --rbp available operations are reduced to --pinreset, --debugreset or --recover
This prevents readinf propritery code from the device.
For nRF52 devices, CR0 is invalid.
--recover Erases all user non-volatile memory and disables ReadBack protection
--licenses Displays the licenses of the open source modules used in nrfjprog.exe.
The nrfjprog.exe uses the open source module "inih" library located at
https://github.com/benhoyt/inih

 The "inih" library is distributed under the New BSD license:
 
 Copyright (c) 2009, Ben Hoyt
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
     * Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
     * Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.
     * Neither the name of Ben Hoyt nor the names of its contributors
       may be used to endorse or promote products derived from this software
       without specific prior written permission.
 
 THIS SOFTWARE IS PROVIDED BY BEN HOYT ''AS IS'' AND ANY
 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 DISCLAIMED. IN NO EVENT SHALL BEN HOYT BE LIABLE FOR ANY
 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


The nrfjprog.exe uses the sha256 module and associated files
from the open source library "mbedTLS".

 Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
 SPDX-License-Identifier: Apache-2.0
 
 Licensed under the Apache License, Version 2.0 (the "License"); you may
 not use this file except in compliance with the License.
 You may obtain a copy of the License at
 
 http://www.apache.org/licenses/LICENSE-2.0 
 
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 
 These files are part of mbed TLS (https://tls.mbed.org)
-q --quiet Reduces stdout
-h --help
-i --ids Displays the serial numbers of all the debuggers connected to the PC.
682394615
-v --version Displays the nrfjprog and dll versions.

,tr>
file [bcCdEhikLlNnprsvzZ0] [-e test] [-f namefile] [-F separator] [-m magicfiles] [-M magicfiles] file... file -C -m magicfiles

/Users/dgerman/Downloads/nRF5x-Command-Line-Tools_9_7_2_OSX/nrfjprog

https://www.nordicsemi.com/eng/nordic/Products/nRF52840/nRF5x-Command-Line-Tools-OSX/58855

JLinkARM DLL not found. Please reinstall latest JLinkARM.