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

nrfjprog read back protection is working??

Hello, after I program bootloader, sd, application, I did the following command to do read back protection,

nrfjprog --rbp ALL -f NRF51

But, even though I still can get data by using nrfjprog --memrd xxxxx. Can anybody tell me how can I protect to somebody to read my chip?? Thank you.

Parents Reply Children
  • I did nrfjprog --reset command after that. But the nrfjprog --memrd XXX command still working...

  • This works for me (getting error on last memrd), not sure what you do wrong:

    set MERGE_NAME=merged.hex
    set SOFTDEVICE_NAME=s130_nrf51_2.0.1_softdevice.hex
    set NRF5_CHIP_FAMILY=NRF51
    set APP_NAME=my-ble-app.hex
    
    echo Programming ...
    echo NRF5_CHIP_FAMILY = %NRF5_CHIP_FAMILY%
    echo SOFTDEVICE_NAME  = %SOFTDEVICE_NAME%
    echo APP_NAME         = %APP_NAME%
    
    mergehex -m %SOFTDEVICE_NAME% %APP_NAME% -o %MERGE_NAME%
    nrfjprog --recover -f %NRF5_CHIP_FAMILY%
    nrfjprog --memrd 0x0000300C -f %NRF5_CHIP_FAMILY%
    nrfjprog --program %MERGE_NAME% --verify --chiperase -f %NRF5_CHIP_FAMILY%
    nrfjprog --memrd 0x0000300C -f %NRF5_CHIP_FAMILY%
    nrfjprog --rbp ALL -f %NRF5_CHIP_FAMILY%
    nrfjprog --memrd 0x0000300C -f %NRF5_CHIP_FAMILY%
    nrfjprog -p -f %NRF5_CHIP_FAMILY%
    nrfjprog --memrd 0x0000300C -f %NRF5_CHIP_FAMILY%
    
  • Thank you for your answer. I follow your script and I added on the last command, nrfjprog --rbp ALL -f NRF51 (I think you forgot to write) But, I still got no error after memrd command, but the result is changed to all zeros(00000000) from FFFF0080. Is it right??

  • Sorry, I've corrected the script. It is suited for nRF52, modifying it for nRF51 is easy (change target to NRF51, Soft Device HEX to S110 or S130 variant you use and name your app HEX file). Now the address 0x300C is chosen because there should be Soft Device version string. 0xFFFFxxxx is correct, whatever else (like all zeros) indicates that read-back is active.

  • This is output of the script on my Win7 machine:

    NRF5_CHIP_FAMILY = NRF51
    SOFTDEVICE_NAME  = s130_nrf51_2.0.1_softdevice.hex
    APP_NAME         = my-ble-app.hex
    Parsing input hex files.
    Merging files.
    Storing merged file.
    Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas.
    0x0000300C: FFFFFFFF                              |....|
    Parsing hex file.
    Erasing code and UICR flash areas.
    Applying system reset.
    Checking that the area to write is not protected.
    Programing device.
    Verifying programming.
    Verified OK.
    0x0000300C: FFFF0087                              |....|
    Protected the device against read and debug. --pinreset might no longer be
    available.
    0x0000300C: 00000000                              |....|
    Applying pin reset.
    0x0000300C: 00000000                              |....|
    
Related