Chip Erase

The Chip Erase command will erase the entire code section of the Flash memory and the NVM Lock Bits. For security reasons, the NVM Lock Bits are not reset before the code section has been completely erased. Configuration, Signature and Calibration sections are not changed.

Before starting the Chip erase, the NVMCMD register must be loaded with the CHIP_ERASE command. To start the erase operation a dummy byte must be written into the high byte of a word location that resides inside the Flash code section. The NVMBSY bit remains set until erasing has been completed. While the Flash is being erased neither Flash buffer loading nor Flash reading can be performed.

The Chip Erase can be carried out as follows:
  1. Write the 0x10 (CHIP_ERASE) to the NVMCMD register
  2. Start the erase operation by writing a dummy byte to the high byte of any word location inside the code section
  3. Wait until the NVMBSY bit has been cleared