SECUREAPPROTECT enabled

Use this procedure to erase page by page if Secure Access Port Protection (SECUREAPPROTECT) is enabled.

  1. Write 0x00000002 to the CONFIGNS register (0x40039584) of the Non-volatile Memory Controller (NVMC).
    This configures the non-volatile memory for erasing.
  2. 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.
  3. Write 0xFFFFFFFF to the first 32-bit word in the flash page you want to be erased.
  4. Read the READY register (0x40039400) of the NVMC until the value is 0x00000001.
  5. Repeat steps 3 and 4 until all wanted pages are erased.
  6. Write 0x00000000 to the CONFIGNS register (0x40039584) of the NVMC.
    This configures the non-volatile memory back to read-only.