This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Trying to disable APPROTECT for debugging

Hi.

I have received my first nRF52 device that has the new and improved APPROTECT mechanism, and I'm having a hard time disabling the protection for debugging.

I have read this guide, but can't seem to disable the protection. Whenever I reset the device, it is locked again.

The device is an nRF52833, build code B00 by the markings. I have updated nRF command line tools to version 10.15.4. I'm building my firmware using Keil uVision, and have updated the MDK to version 8.44.1. The firmware does not have ENABLE_APPROTECT defined anywhere I can find.

Here is a log from the command line where I'm programming the device and trying to connect after a reset. The firmware is a variant of the secure bootloader, which does work. I just can't connect to the device afterwards to debug.

Can anyone see what I'm doing wrong?

C:\>nrfjprog --version
nrfjprog version: 10.15.4 external
JLinkARM.dll version: 7.58b

C:\>nrfjprog --family NRF52 --recover
Recovering device. This operation might take 30s.
Writing image to disable ap protect.
Erasing user code and UICR flash areas.

C:\>nrfjprog --family NRF52 --memrd 0x10001208
0x10001208: 0000005A |Z...|

C:\>nrfjprog --family NRF52 --program HWv4_BLv8.hex --verify --sectorerase
Parsing image file.
Verifying programming.
Verified OK.

C:\>nrfjprog --family NRF52 --memrd 0x10001208
0x10001208: 0000005A |Z...|

C:\>nrfjprog --family NRF52 --reset
Applying system reset.
Run.

C:\>nrfjprog --family NRF52 --memrd 0x10001208
ERROR: The operation attempted is unavailable due to readback protection in
ERROR: your device. Please use --recover to unlock the device.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.

C:\>nrfjprog --family NRF52 --recover
Recovering device. This operation might take 30s.
Writing image to disable ap protect.
Erasing user code and UICR flash areas.

C:\>nrfjprog --family NRF52 --memrd 0x10001208
0x10001208: 0000005A |Z...|

C:\>nrfjprog --family NRF52 --program HWv4_BLv8.hex --verify --sectorerase
Parsing image file.
Verifying programming.
Verified OK.

C:\>nrfjprog --family NRF52 --memrd 0x10001208
0x10001208: 0000005A |Z...|

C:\>nrfjprog --family NRF52 --memwr 0x10001208 --val 0x5A
Parsing parameters.
WARNING: Writing to a non-empty address may result in unexpected behavior.
Would you like to continue with the operation? [Y]/N y
Writing.

C:\>nrfjprog --family NRF52 --reset
Applying system reset.
Run.

C:\>nrfjprog --family NRF52 --memrd 0x10001208
ERROR: The operation attempted is unavailable due to readback protection in
ERROR: your device. Please use --recover to unlock the device.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.

Related