readback protection enabled automatically enables on nrf52840 rev3

Hi,

 I would like to know how to ensure that AP-protect is disabled for application based on 17.1.0 nRF5 SDK.

 I've understood that the procedure is:

1. recover the device: "nrfjprog --recover"

2. program the application (w/o restart): "nrfjprog --program app.hex --sectorerase --verify"

3. write the app protect disable: "nrfjprog --memwr 0x10001208 --val 0x5A"

Initially running "nrfjprog --memrd 0x10001208" returns

0x10001208: 0000005A                              |Z...|

But then after cold restart the application is AP-protect enabled.

How can I ensure that debug (AP-protect stays off) stays enabled

Update1: the app also uses:

1. secure bootloader and

2. softdevice

Update 2: I've also tried the following script, which does not seem to make any difference:

nrf-toolchain/utils/approtect at master · inductivekickback/nrf-toolchain · GitHub

* which basically added this line in the hex file: `:041208005AFFFFFF8B`

Best regards.

Related