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:
-
Write 1 (Erase) to the CTRLAP.ERASEALL register (0x004).
-
Wait for the value of the CTRLAP.ERASEALLSTATUS register (0x008) to change from
2 (Busy).
-
Read the value of the CTRLAP.ERASEALLSTATUS register (0x008).
-
If the value of the CTRLAP.ERASEALLSTATUS register (0x008) is 1
(ReadyToReset), complete the following steps to do a hard reset:
-
Write 2 (HardReset) to the CTRLAP.RESET register
(0x000).
-
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.