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

How to erase a nrf51422 using JLink after flashing a softdevice

Hello, we experience the situation, where we are able to flash a softdevice (s210) once. After the softdevice is flushed, subsequent attempts to flash the softdevice fail with the following error message:

J-Link>loadbin s210_main.bin, 0x00000000
Downloading file [s210_main.bin]...Info: J-Link: Flash download: Total time needed: 24.013s (Prepare: 0.547s, Compare: 10.036s, Erase: 0.185s, Program: 10.170s, Verify: 0.000s, Restore: 3.072s)
Error while programming flash: Programming failed.

My best guess is, that flashing the UICR causes the problem. Is this right? If so, how could the chips flash be erased? (using erase from JLinkExe doesn't work).

Cheers Torsten

Parents
  • How are you calling JLinkExe? If you don't specify

    --device nrf51822

    on the JLinkExe command line, then you get errors much like that one.

  • Hmm - JLink works through the debug interface, it can basically read and write anything it wants to read and write. It is true that most of the scripts I've seen, and written, do erase the whole flash first because you may as well at that point.

    I never by the way use that fully-qualified name on the device, just --device nrf51822, not that I remember now where on earth I got that from and Segger's list of devices has all the variants and not just the base 'nrf51822'

    Certainly using what you have works so you may as well use what you have with the erase of the UICR. It's not like you have to change the softdevice very often anyway.

Reply
  • Hmm - JLink works through the debug interface, it can basically read and write anything it wants to read and write. It is true that most of the scripts I've seen, and written, do erase the whole flash first because you may as well at that point.

    I never by the way use that fully-qualified name on the device, just --device nrf51822, not that I remember now where on earth I got that from and Segger's list of devices has all the variants and not just the base 'nrf51822'

    Certainly using what you have works so you may as well use what you have with the erase of the UICR. It's not like you have to change the softdevice very often anyway.

Children
No Data
Related