nRF52840 locked with APPROTECT, unable to recover/flash without nRESET pin

Hi,

I am working on a custom nRF52840 design (using nRF Connect SDK v2.9.3) and I have accidentally locked the chip via APPROTECT.

My major issue is that on this hardware revision, the physical nRESET pin (P0.18) is not routed out and is completely inaccessible.

I have tried recovering the chip using OpenOCD (nrf52_recover), which successfully executes the erase command (nrf52.cpu device has been successfully erased and unlocked), but immediately after the erase, OpenOCD fails with Could not find MEM-AP to control the core because it cannot perform a hardware reset. The chip then re-locks itself instantly on the next connection attempt.

I have compiled the new firmware with CONFIG_NRF_APPROTECT_USE_UICR=n, but I cannot flash it using probe-rs or OpenOCD due to this lock/unlock loop.

Is there any official way or special SWD sequence to permanently unlock and flash an nRF52840 (with the newer APPROTECT hardware) after a mass erase without having access to the physical nRESET pin?

Thanks for the help!

  • Then I am sorry to say, but I am out of ideas. Hopefully you have more boards and can avoid that it happens again. 

    Alternatively I guess you can try to random power cycle the nRF52840 while calling the recover operation in case it can help. Long shot.

    Kenneth

  • Thank you for the suggestion, Kenneth. I have already attempted various power cycling methods, but unfortunately, the APPROTECT lock is permanent and the missing nRESET pin prevents any successful recovery. I mean is it possible that jlcpcb who assembled the custom boards has done something to the chip cause first when I got them I tried this:

    openocd -f interface/jlink.cfg \ -c "transport select swd" \ -c "adapter speed 1000" \ -f target/nrf52.cfg \ -c "init" \ -c "shutdown"  

    and it gave 

    Open On-Chip Debugger 0.12.0 Licensed under GNU GPL v2 For bug reports, read         openocd.org/.../bugs.html swd adapter speed: 1000 kHz Info : J-Link OB-nRF5340-NordicSemi compiled Jul  8 2025 10:15:34 Info : Hardware version: 1.00 Info : VTarget = 3.300 V Info : clock speed 1000 kHz Info : SWD DPIDR 0x2ba01477 Error: [nrf52.cpu] Could not find MEM-AP to control the core ****** WARNING ****** nRF52 device has AP lock engaged (see UICR APPROTECT register). Debug access is denied. Use 'nrf52_recover' to erase and unlock the device. Warn : target nrf52.cpu examination failed Info : starting gdb server for nrf52.cpu on 3333 Info : Listening on port 3333 for gdb connections shutdown command invoked

Related