DocID025202 Rev 7
64/1080
RM0365
Embedded Flash memory
80
Figure 5. Flash memory Page Erase procedure
Mass Erase
The Mass Erase command can be used to completely erase the user pages of the Flash
memory. The information block is unaffected by this procedure. The following sequence is
recommended:
1.
Check that no Flash memory operation is ongoing by checking the BSY bit in the
FLASH_SR register
2. Set the MER bit in the FLASH_CR register
3. Set the STRT bit in the FLASH_CR register (see below note)
4. Wait for the BSY bit to be reset
5. Check the EOP flag in the FLASH_SR register (it is set when the erase operation has
succeeded), and then clear it by software.
6. Clear the EOP flag.
Note:
The software should start checking if the BSY bit equals ‘0’ at least one CPU cycle after
setting the STRT bit.
5HDG)/$6+B&5B/2&.
)/$6+B&5B/2&.
<HV
.O
.O
9ES
3HUIRUPXQORFNVHTXHQF\
:ULWHLQWR)$5DQDGGUHVV
ZLWKLQWKHSDJHWRHUDVH
7RITE&,!3(?#2?0%2TO
:ULWH)/$6+B&5B6757WR
&,!3(?32?"39
#HECK%/0FLAGIN
&,!3(?32ANDTHEN
CLEARITBYSOFTWARE
AID