Use the standard Serial Wire Debug (SWD)
Arm®
CoreSightâ„¢
Debug Access Port (DAP) protocol to erase all pages.
-
If Secure Access Port Protection (SECUREAPPROTECT) is enabled, erase all is
disabled. To erase, see either Erasing page by page or Erasing all through CTRL-AP to disable SECUREAPPROTECT.
-
Write 0x00000002 to the CONFIG register
(0x50039504) of the Non-volatile Memory Controller (NVMC).
This configures the non-volatile memory for erasing.
-
Read the READY register (0x50039400) of the NVMC until
the value is 0x00000001.
When this value is read, the NVMC is ready and not currently performing any
operations.
-
Write 0x00000001 to the ERASEALL
register(0x5003950C) of the NVMC.
-
Read the READY register (0x50039400) of the NVMC until
the value is 0x00000001 before continuing to ensure the erase all
operation has completed.
-
Write 0x00000000 to the CONFIG register
(0x50039504) of the NVMC.Set the CONFIG register of the NVMC to
WEN.Ren by writing 0x00000000 to following
addresses:
This configures the non-volatile memory back to read-only.