This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error Trying to program nRF51822

Hello,

I have been looking to program this IC, connecting via SWD with no luck. I can connect to the target but for some reason once i try to perform erase programming or read i got an error message with the RAM.

Connecting ...
 - Connecting via USB to J-Link device 0
 - Target interface speed: 2000 kHz (Fixed)
 - VTarget = 3.254V
 - Initializing CPU core (Init sequence) ...
    - Executing Reset (0, 0 ms)
    - Initialized successfully
 - Target interface speed: 2000 kHz (Fixed)
 - Connected successfully
Erasing chip ...
 - Erasing 257 sectors, 2 ranges, 0x0 - 0x3FFFF, 0x10001000 - 0x100013FF
 - ERROR: RAM check failed @ address 0x20000000.
 - ERROR: Write: 0x03020100 07060504
 - ERROR: Read: 0x00000000 00000000
 - ERROR: (0 bytes of RAM have been checked successfully)
 - ERROR: Failed to erase chip
Disconnecting ...
 - Disconnected 

I am using a JFlasher portable, is there any known compatibility issue with this IC?

  • The same issue has already been reported on this post. Do you use a custom hardware ? Which programmer and which version of the Segger tools do you use ?

  • Using JFlasher Portable with tektronix PS. Using JFlash 5.12, also already tried with JFlash Lite. I have been able to program like 5 different types of ARMs using the same programmer so i don't think is related with the programmer itself.

  • I think JFlash gives this error if the device is read protected.

    Try connecting then issuing these commands

    w4 4001e504 2
    w4 4001e50c 1
    w4 4001e514 1
    

    It should remove read protection and also erase the device (though you many want to erase again just to be sure after issuing those commands

  • I tried this but the reply back is still the same:

    C:\Program Files (x86)\SEGGER\JLink_V512g>jlink.exe
    

    SEGGER J-Link Commander V5.12g (Compiled May 27 2016 16:58:24) DLL version V5.12g, compiled May 27 2016 16:57:47

    Connecting to J-Link via USB...O.K. Firmware: J-Link / Flasher Portable V1 compiled May 11 2016 15:08:53 Hardware version: V1.10 S/N: 651100800 License(s): JFlash, GDB VTref = 3.325V

    Type "connect" to establish a target connection, '?' for help J-Link>connect Please specify device / core. : NRF51822_XXAA Type '?' for selection dialog Device> Please specify target interface: J) JTAG (Default) S) SWD TIF>s Specify target interface speed [kHz]. : 4000 kHz Speed>2000 Device "NRF51822_XXAA" selected.

    Found SWD-DP with ID 0x0BB11477 Found Cortex-M0 r0p0, Little endian. FPUnit: 4 code (BP) slots and 0 literal slots CoreSight components: ROMTbl 0 @ F0000000 ROMTbl 0 [0]: F00FF000, CID: B105100D, PID: 000BB471 ROM Table ROMTbl 1 @ E00FF000 ROMTbl 1 [0]: FFF0F000, CID: B105E00D, PID: 000BB008 SCS ROMTbl 1 [1]: FFF02000, CID: B105E00D, PID: 000BB00A DWT ROMTbl 1 [2]: FFF03000, CID: B105E00D, PID: 000BB00B FPB ROMTbl 0 [1]: 00002000, CID: B105900D, PID: 000BB9A3 ??? Cortex-M0 identified. J-Link>w4 4001e504 2 Writing 00000002 -> 4001E504 J-Link>w4 4001e50c 1 Writing 00000001 -> 4001E50C J-Link>w4 4001e514 1 Writing 00000001 -> 4001E514 J-Link>erase Erasing device (nRF51822_xxAA)...


    WARNING: CPU could not be halted


    ****** Error: Can not read register 16 (XPSR) while CPU is running Can not read register 20 (CFBP) while CPU is running Can not read register 0 (R0) while CPU is running Can not read register 1 (R1) while CPU is running Can not read register 2 (R2) while CPU is running Can not read register 3 (R3) while CPU is running Can not read register 4 (R4) while CPU is running Can not read register 5 (R5) while CPU is running Can not read register 6 (R6) while CPU is running Can not read register 7 (R7) while CPU is running Can not read register 8 (R8) while CPU is running Can not read register 9 (R9) while CPU is running Can not read register 10 (R10) while CPU is running Can not read register 11 (R11) while CPU is running Can not read register 12 (R12) while CPU is running Can not read register 14 (R14) while CPU is running Can not read register 15 (R15) while CPU is running Can not read register 17 (MSP) while CPU is running Can not read register 18 (PSP) while CPU is running


    WARNING: CPU could not be halted


    ****** Error: Failed to download RAMCode! ERROR: Erase returned with error code -1. J-Link>

Related