Use the standard SWD Arm®
CoreSight™ DAP protocol to erase all
while the CTRL-AP is still selected by the DP.
-
Write the value 0x00000001 to the ERASEALL register (0x004) of the CTRL-AP.
This will start the ERASEALL operation which erases all flash and RAM on the
device.
-
Read the ERASEALLSTATUS register (0x008) of the CTRL-AP until the value read is
0x00 or 15 seconds from ERASEALL write has expired.
-
Write the value 0x1 to RESET register (0x000) of the CTRL-AP to issue a “soft
reset” to the device and complete the erase and unlocking of the chip.
-
Write the value 0x0 to RESET register (0x000).
-
Write the value 0x0 to the ERASEALL register (0x004) of the CTRL-AP.
This is necessary after the erase sequence is completed.