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

Erase all including UICR write protection with JLinkExe (JLink Commander)

Hi everyone,

I activated softdevice writing protection with nRFGoStudio (i.e. so that the softdevice can not be overriden). How can I deactivate that again so that I can flash the softdevice from JLinkExe instead of only being able to use nRFGoStudio?

I am on a Mac and booting up nRFGoStudio in Parallels is annoying, let alone seemingly unnecessary.

  • Hi,

    The protection bits are set in the UICR registers which can only be erased by ERASEALL (complete chip erase), see NMVC chapter in nRF51 RM for more details. One reason it was designed this way is that memory protection settings are stored here.

    With Jlink commander you have to manually write to NMVC.ERASEALL:

    $ w4 4001e504 2  // Enable erase
    $ w4 4001e50c 1  // ERASEALL
    

    That said, nrfjprog is now ported to osx. This is a command line tool like J-link commander, but with simplified command line arguments made specifically for the nrf5 series. This will command will for instance perform a full chip erase like the above commands:

    $nrfjprog --eraseall / -e 
    

    The other advantage with nrfjprog is that it allows you to use the existing flash targets in our SDK Makefiles:

    $make flash_softdevice && make flash <target name>  // flashes softdevice and application
    
  • I highly recommend using our command line tool nrfjprog. brew cask install nrf5x-command-line-tools my favorite nrfjprog command is: nrfjprog --recover // Erases entire chip, UICR, disables any protection, also eraces RAM

  • Great, did not know that nrfjprog is now ported. I hope you guys support OS X and alternate toolchains like Eclipse or Embedded Studio much more in the future since so many developers work with Macs nowadays.

Related