We are using SDK 17.0.2, which does not support the rev 3 APProtect features.
We would like to update the SDK in the future, but are looking for a shorter-term solution now.
We'd like to maintain the behavior we had previously, which is as follows:
1) Upon assembly, the board is booted and firmware is flashed. It is expected that APProtect is disabled.
2) Upon end of manufacturing process, firmware enables APProtect.
I have read the latest product spec and seen the steps needed for this:
Step #1: after loading firmware, write UICR->APPROTECT to HwDisabled (5A). Then, upon each reset, firmware is to write APPROTECT.DISABLE to HwDisabled (5A).
Step #2: firmware should write ICR->APPROTECT to enabled and NRF_APPROTECT->FORCEPROTECT to APPROTECT_FORCE (00).
I looked through the latest SDK and saw that the main line I was to emulate was
NRF_APPROTECT->DISABLE = NRF_UICR->APPROTECT;
which makes sense if NRF_UICR->APPROTECT was set during the firmware load step.
The steps I did to complete this are:
Step #1:use nrfjprog.exe (and older version I think) as follows:
nrfjprog --recover
nrfjprog --memwr 0x10001208 --val 0x5A
nrfjprog --memwr 0x40000558 --val 0x5A
Then I use J-Flash Lite to program my FW image (NOT erasing the image beforehand, as nrfjprog --recover should have taken care of that).
The firmware is written to do the line "NRF_APPROTECT->DISABLE = NRF_UICR->APPROTECT;" every boot, and early-on: before the SoftDevice (7.2.0) is enabled.
This works across soft-resets (and maybe even quick power-cycles?), but doesn't work if I unplug power manually, then plug it back in.
If you have any debug tips, they'd be appreciated.
Thanks,
Kyle