Erasing all through CTRL-AP

Use the standard SWD Arm® CoreSight™ DAP protocol to erase all while the CTRL-AP is still selected by the DP.

  1. 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.
  2. Read the ERASEALLSTATUS register (0x008) of the CTRL-AP until the value read is 0x00 or 15 seconds from ERASEALL write has expired.
  3. 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.
  4. Write the value 0x0 to RESET register (0x000).
  5. Write the value 0x0 to the ERASEALL register (0x004) of the CTRL-AP.
    This is necessary after the erase sequence is completed.