
GD32L23x User Manual
48
Figure 2-1. Process of page erase operation
Set the PER bit, Write
FMC_ADDR
Is the LK bit is 0
Send the command to
FMC by set START bit
Start
Yes
No
Unlock the FMC_CTL
Is the BUSY bit is 0
Yes
No
Is the BUSY bit is 0
Yes
No
Finish
2.3.5.
Mass erase
The FMC provides a complete erase function which is used to initialize the main flash block
contents. This erase can affect entire flash block by setting the MER bit to 1 in the FMC_CTL
register. The following steps show the mass erase register access sequence.
Unlock the FMC_CTL register if necessary.
Check the BUSY bit in the FMC_STAT register to confirm that no flash memory operation
is in progress (BUSY equals to 0). Otherwise, wait until the operation has finished.
Set the MER bit in the FMC_CTL register if erase entire flash.
Send the mass erase command to the FMC by setting the START bit in the FMC_CTL
register.
Wait until all the operations have been finished by checking the value of the BUSY bit in
the FMC_STAT register.
Read and verify the flash memory using a DBUS access if required.
When the operation is executed successfully, the ENDF bit in the FMC_STAT register is set,