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:
- "nrfjprog -f nrf52 --recover --log" for a clean starting state.
- "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.
- "nrfjprog -f nrf52 --rbp ALL --log" stops the device from advertising. Looks like it stops my program from running.
- 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).