![ARTERY AT32F435 Series Скачать руководство пользователя страница 100](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592100.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 100
Rev 2.03
Figure 5-1
Flash memory sector erase process
Start
Write the erased sector address to
FLASH_ADDRx
Set SECERS = 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
Block erase:
Any block of Flash memory can be erased independently.
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;
Write the block to be erased in the FLASH_ADDRx register;
Set the BANKERS and ERSTR bit in the FLASH_CTRLx register to enable block 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 blocks.