Erasing all

Use the standard Serial Wire Debug (SWD) Arm® CoreSight™ Debug Access Port (DAP) protocol to erase all pages.

  1. 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.
  2. Set the CONFIG register of the Non-volatile Memory Controller (NVMC) to WEN.Een by writing 0x00000002 to the following addresses:
    • Application core - 0x50039504
    • Network core - 41080504
    This configures the non-volatile memory for erasing.
  3. Read the READY register of the NVMC until the value is 0x00000001. Read the following addresses:
    • Application core - 0x50039400
    • Network core - 0x41080400
    When this value is read, the NVMC is ready and not currently performing any operations.
  4. Set ERASEALL register of the NVMC to ERASEALL.Erase by writing 0x00000001 to the following addresses:
    • Application core - 0x5003950C
    • Network core - 4108050C
    This erases all non-volatile memory including User Information Configuration Registers (UICR) registers.
  5. Read the READY register of the NVMC until the value is 0x00000001 before continuing to ensure the erase all operation has completed. Read the following addresses:
    • Application core - 0x50039400
    • Network core - 0x41080400
  6. Set the CONFIG register of the NVMC to WEN.Ren by writing 0x00000000 to following addresses:
    • Application core - 0x50039504
    • Network core - 41080504
    This configures the non-volatile memory back to read-only.