ERASE_ALL protection disable nrf54

Hello,

I've been working on a feature lately that involves writing the OTP registers in UICR on nrf54L15; after writing the registers I also wrote the protected value (0x50FA50FA) to the ERASEPROTECT registers and this locked the OTP values in place.

Now I want to revert the development kit the previous state to perform some more testing and I saw that the erase protection can be disabled through the handshake mechanism where both the firmware and the debugger write the same key to the respective ERASEPROTECT.DISABLE register in the CTRL-AP.

I added the following piece of code to my application and reflashed it on the board:

NRF_CTRLAP_S->ERASEPROTECT.DISABLE = 0x12345678;
And tried the following sequence of commands on the JLink CLI:
SWDSelect
SWDWriteDP 1 0x50000000 // power up
SWDWriteDP 2 0x02000000 // select AP2 (CTRL-AP)
SWDWriteAP 4 0x12345678 // write erase prot. disable key (register index 4 in AP
I was expecting the ERASE_ALL procedure to be completed automatically as per the data sheet, but nothing happened to the UICR registers. I also tried to manually trigger the ERASE_ALL procedure by writing the debug-side registers through SWD, then reset the board and still no change.
 
There is obviously something I'm missing here, but I couldn't figure out what else needs to be done from the documentation. Could someone please confirm if my understanding of this feature is wrong and how should the code actually look like?
Thank you!
Vlad
Related