Use this procedure to erase page by page if Secure Access Port Protection (SECUREAPPROTECT) is enabled.
-
Write 0x00000002 to the CONFIGNS register (0x40039584) of the Non-volatile Memory Controller (NVMC).
This configures the non-volatile memory for erasing.
-
Read the READY register (0x40039400) of the NVMC until the value is
0x00000001.
When this value is read, the NVMC is ready and not currently performing any
operations.
-
Write 0xFFFFFFFF to the first 32-bit word in the flash page you want to be erased.
-
Read the READY register (0x40039400) of the NVMC until the value is
0x00000001.
-
Repeat steps 3 and 4 until all wanted pages are erased.
-
Write 0x00000000 to the CONFIGNS register (0x40039584) of the
NVMC.
This configures the non-volatile memory back to read-only.