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!

Parents
  • Hello,

    Should be no need to access the reset pin no, you normally only need 4 pins: VDD, GND, SWDIO and SWDCLK. However it's important that you don't do any reset between eraseall and writing the new firmware, else it likely will enable again in between. I expect if you for instance use nrfjprog/nrfutil to program from command line it will work, or nrfutil/jlink from west. If you have access to an nRF52840-DK and use the 4pins from the debug out header that should work.

    I guess one exception, if you by accident have enabled pin reset, and it somehow is pulled low (externally or by the code itself), then you are pretty much doomed without accessing the pin reset physically to pull it high.

    Kenneth

Reply
  • Hello,

    Should be no need to access the reset pin no, you normally only need 4 pins: VDD, GND, SWDIO and SWDCLK. However it's important that you don't do any reset between eraseall and writing the new firmware, else it likely will enable again in between. I expect if you for instance use nrfjprog/nrfutil to program from command line it will work, or nrfutil/jlink from west. If you have access to an nRF52840-DK and use the 4pins from the debug out header that should work.

    I guess one exception, if you by accident have enabled pin reset, and it somehow is pulled low (externally or by the code itself), then you are pretty much doomed without accessing the pin reset physically to pull it high.

    Kenneth

Children
No Data
Related