
GD32F403xx User Manual
42
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
For GD32F403xx with f lash more than 512KB, FMC_STAT0 ref lects the operation status of
bank0, and FMC_ STAT1 ref lects the operation status of bank1. The page erase procedure
applied to bank1 is similar to the procedure applied to bank0. Especially, when erasing page
in bank1 under security protection, the address should not only be written to FMC_ADRR1
but also to FMC_ADDR0.
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 af fect only on Bank0 by setting MER bit to 1 in the FMC_CTL0
register, or only on Bank1 by setting MER bit to 1 in the FMC_CTL1 register, or on entire flash
by setting MER bits to 1 in FMC_CTL0 register and FMC_CTL1 register. The f ollowing steps
show the mass erase register access sequence.
1.
Unlock the FMC_CTLx registers if necessary;
2.
Check the BUSY bit in FMC_STATx registers to confirm that no flash memory operation
is in progress (BUSY equals to 0). Otherwise, wait until the operation has finished;