SECUREAPPROTECT disabled

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

Before you begin, check System Protection Unit (SPU) if the flash page is secure or non-secure (see Check flash region security attribute).
  1. Write 0x00000002 to the CONFIG register (0x50039504) of the Non-volatile Memory Controller (NVMC).
    This configures the non-volatile memory for erasing.
  2. 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.
  3. Write 0xFFFFFFFF to the first 32-bit word in the flash page you want to be erased.
  4. Read the READY register (0x50039400) 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 CONFIG register (0x50039504) of the NVMC.
    This configures the non-volatile memory back to read-only.
Note: The User Information Configuration Registers (UICR) flash page cannot be erased by using erase page. It can only be erased by an erase all operation.