Hello,
I am developing in a Zephry environment on the NRF5340 and am looking to enable APPROTECT and ERASEPROTECT on our NRF5340 MCUs.
We want to enable a recovery key so that devices can have more security than they currently do whilst still having the ability to recover hardware if need be.
I use a JLink to flash the devices.
I am currently just experimenting by setting APPROTECT, and will set ERASEPROTECT once I am more confident in my recovery.
This is being done on a very lightweight sample I have spun up in zephyr on an NRF5340dk.
I am enabling the APPROTECT by setting the following in both the appcore and netcore:
CONFIG_NRF_APPROTECT_USER_HANDLING=y
I then execute the following in the appcore:
NRF_CTRLAP_S->APPROTECT.DISABLE = RECOVERY_KEY;
And the following in the netcore:
NRF_CTRLAP_NS->APPROTECT.DISABLE = RECOVERY_KEY;
When I use the JLink.exe app to finish the recovery key on the handshake side, I execute the following:
JLink.exe -device NRF5340_XXAA_APP -if SWD -speed 4000
>SWDSelect
>SWDWriteDP 2 0x02000010
>SWDWriteAP 0 0x12345678
>SWDWriteDP 2 0x03000010
>SWDWriteAP 0 0x12345678
It is my understanding that I should now be able to read from the NRF5340, given I have synchronized the same recovery key in both the NRF5340 as well as the JLink.
However, I do not seem to be having success when I do this, as I cannot perform a read transaction.
It is worth noting that when I use the default recovery key of 0x50FA50FA, I believe this is working. Am I incorrectly rolling the keys?
Thanks