![ARTERY AT32F435 Series Скачать руководство пользователя страница 101](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592101.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 101
Rev 2.03
Figure 5-2
Flash memory block erase process
Start
Write the erased block address to
FLASH_ADDRx
Set BLKERS = 1 and ERSTR =1
in FLASH_CTRLx
OBF = 0 ?
Check the OBF bit in FLASH_STSx
Read EPPERR bit and ODF bit in
FLASH_STSx
No
Yes
OBF = 0 ?
Check the OBF bit in FLASH_STSx
No
Yes
End
Mass erase
Mass erase function can erase all the Flash memory.
The following process is recommended:
Check the OBF bit in the FLASH_STSx register to confirm that there is no other programming
operation in progress;
Set the BANKERS and ERSTR bit in the FLASH_CTRLx register to enable mass erase;
Wait until the OBF bit becomes “0” in the FLASH_STSx register. Read the EPPERR bit and ODF
bit in the FLASH_STSx register to verify the erased sectors.
Note: Read operation to the Flash memory during erase will halt CPU until the completion of
erase.