RM0365
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.
Figure 5. Flash memory Page Erase procedure
DocID025202 Rev 7
Embedded Flash memory
64/1080
80
Need help?
Do you have a question about the RM0365 and is the answer not in the manual?