GD32W51x User Manual
72
Figure 2-2. Process of page erase operation
Set the
PER/SECPER bit,
Write
FMC_ADDR/FMC_SE
CADD
Is the LK/SECLK
bit is 0
Send the command to
FMC by set
START/SECSTART
bit
Start
Yes
No
Unlock the
FMC_CTL/FMC_SEC
CTL
Is the
BUSY/SECBUSY
bit is 0
Yes
No
Is the
BUSY/SECBUSY
bit is 0
Yes
No
Finish
2.4.5.
Mass erase
The FMC provides a complete erase function which is used to initialize the main Flash block
contents. Operate secure Flash or non-secure Flash using secure or non-secure registers.
This erase can affect entire Flash block by setting the MER/SECMER bit to 1 in the
FMC_CTL/FMC_SECCTL register. The following steps show the mass erase register access
sequence.
Unlock the FMC_CTL/FMC_SECCTL register if necessary.
Check the BUSY/SECBUSY bit in the FMC_STAT/FMC_SECSTAT register to confirm
that no Flash memory operation is in progress (BUSY/SECBUSY equals to 0). Otherwise,
wait until the operation has finished.
Set the MER bit in the FMC_CTL/FMC_SECCTL register if erase entire Flash.
Send the mass erase command to the FMC by setting the START/SECSTART bit in the
FMC_CTL/FMC_SECCTL register.
Wait until all the operations have been finished by checking the value of the