Disabling APPROTECT

nRF54L Series Production Programming

If the device has access port protection enabled and is not erase protected, you can disable access port protection by using a Control Access Port (CTRL-AP) erase all operation.

To disable access port protection, complete the following steps:
  1. Write 1 (Erase) to the CTRLAP.ERASEALL register (0x004).
  2. Wait for the value of the CTRLAP.ERASEALLSTATUS register (0x008) to change from 2 (Busy).
  3. Read the value of the CTRLAP.ERASEALLSTATUS register (0x008).
  4. If the value of the CTRLAP.ERASEALLSTATUS register (0x008) is 1 (ReadyToReset), complete the following steps to do a hard reset:
    1. Write 2 (HardReset) to the CTRLAP.RESET register (0x000).
    2. Write 0 (NoReset) to the CTRLAP.RESET register (0x000).
    This completes the operation to disable the access port protection.

    If the value of the CTRLAP.ERASEALLSTATUS register (0x008) is a non-zero value other than 1, the operation has failed and a pin reset is needed. To perform a pin reset, write 4 (PinReset) to the CTRLAP.RESET register (0x000), followed by writing 0 (NoReset) to the same register. After the pin reset, return to Step 1 to repeat the procedure.

For more information on erase protection, see Checking protection status.
Figure 1. Erase all states
Erase all states