![GigaDevice Semiconductor GD32E23 Series User Manual Download Page 46](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794046.webp)
GD32E23x User Manual
46
Figure 2-1. Process of page erase operation
Set the FMC_ADDR,
PER bit
Is the LK bit 0
Send the command to
FMC by setting
START bit
Start
Yes
No
Unlock the FMC_CTL
Is the BUSY bit 0
Yes
No
Is the BUSY bit 0
Yes
No
Finish
2.3.5.
Mass erase
The FMC provides a complete erase function which is used for initializing the Main Flash
Block contents. The following steps show the mass erase register access sequence.
Unlock the FMC_CTL register if necessary.
Check the BUSY bit in FMC_STAT register to confirm that no flash memory operation is
in progress (BUSY equal to 0). Otherwise, wait until the operation has been finished.
Write the mass erase command into MER bit in FMC_CTL register.
Send the mass erase command to the FMC by setting the START bit in FMC_CTL
register.
Wait until all the operations have been completed by checking the value of the BUSY bit
in FMC_STAT register.
Read and verify the flash memory if required using a DBUS access.