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

NRF52 RBP (Readback protection) unexpected behavior

We are currently going in production with NRF52 and we are facing the following issue with RBP on NRF52832QFAAB0.

Basically looks like the processor enters an unknown state when RBP command is issued to it.

Here are the steps I take to reproduce the problem:

  1. "nrfjprog -f nrf52 --recover --log" for a clean starting state.
  2. "nrfjprog -f nrf52 --program programRev4.hex --verify -r --log" to program the board. At this point my program is running and I can verify by looking at advertising data on BLE.
  3. "nrfjprog -f nrf52 --rbp ALL --log" stops the device from advertising. Looks like it stops my program from running.
  4. Issuing a "nrfjprog -f nrf52 --reset" command (Although it reports that "the operation attempted is unavailable due to readback protection") is the only way i can get my program running. Clearly the SWD port is still open for this command to succeed. Although this seems like the solution, i would still like to know why the device halts after issuing the RBP command (step 3)

My understanding was that --rbp ALL only writes to the APPPROTECT register and that locks access to SWD port. Is that correct or are there other things that it does, possibly causing the processor core to lock up and stop the program from running?

Please find the nrfjprog log attached (i ran all commands with --log option).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--------------------------------------------------------------------------------
nrfjprog -f nrf52 --recover --log
nrfjprog verion 9.7.2
--------------------------------------------------------------------------------
FUNCTION: open_dll.
FUNCTION: open_dll.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: connect_to_emu_without_snr.
FUNCTION: connect_to_emu_without_snr.
FUNCTION: enum_emu_snr.
Device "NRF52832_XXAA" selected.
FUNCTION: recover.
FUNCTION: recover.
Found SW-DP with ID 0x2BA01477
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Parents
  • Hi, is the device permanently halted, or does it come back after a while? 

    Although it is not strictly necessary for readback_protect, it halts the device to ensure data integrity while writing.

    The procedure is finalized with a debug_reset to load the changes, this should also have released your device.

Reply
  • Hi, is the device permanently halted, or does it come back after a while? 

    Although it is not strictly necessary for readback_protect, it halts the device to ensure data integrity while writing.

    The procedure is finalized with a debug_reset to load the changes, this should also have released your device.

Children
  • It is permanently halted.

    So you're saying that "nrfjprog -f nrf52 --rbp ALL" already performs a debug_reset at the end?
    What is your source of information? I tried to find the source code for nrfjprog but no luck yet.

  • Hi Farhang,

    Thank you for this bug report. I see the same behavior as you describe. This is not the intended behavior and it have been reported internally. I will let you know when a new version with a fix have been released.

    Best regards,

    Sigurd