GD32A50x User Manual
58
Figure 2-1. Process of page erase operation
Set the FMC_ADDRx,
PER bit
Is the LK bit 0
Send the command to
FMC by setting START
bit
Start
Yes
No
Unlock the FMC_CTLx
Is the BUSY bit 0
Yes
No
Is the BUSY bit 0
Yes
No
Finish
2.3.7.
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_CTLx register if necessary.
Check the BUSY bit in FMC_STATx 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_CTLx register.
Send the mass erase command to the FMC by setting the START bit in FMC_CTLx
register.
Wait until all the operations have been completed by checking the value of the BUSY bit
in FMC_STATx register.
Read and verify the flash memory if required using a DBUS access.
When the operation is executed successfully, an interrupt will be triggered by FMC if the
ENDIE bit in the FMC_CTLx register is set, and the ENDF in FMC_STATx register is set.