Use the standard Serial Wire Debug (SWD)
Arm®
CoreSightâ„¢
Debug Access Port (DAP) protocol to erase all while Control Access Port (CTRL-AP) is still selected by the debug port.
-
Write 0x00000001 to the ERASEALL register (0x004) of 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 wait 15 seconds after the ERASEALL write has
expired.
-
Issue a pin reset.