![ARTERY AT32F435 Series Скачать руководство пользователя страница 104](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592104.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 104
Rev 2.03
Lock procedure:
User system data area is locked by clearing the USDULKS bit in the FLASH_CTRL register by software.
5.3.2
Erase operation
Erase operation must be done before programming. User system data area can perform erase operation
independently.
Below should be followed during erase operation:
Check the OBF bit in the FLASH_STS register to confirm that there is no other programming
operation in progress;
Set the USDERS and ERSTR bit in the FLASH_CTRL register to enable erase operation;
Wait until the OBF bit becomes “0” in the FLASH_STS register. Read the ODF bit in the
FLASH_STSx register to verify the erase result.
Note: Read operation to the Flash memory during programming will halt CPU until the completion
of erase.
Figure 5-5
System data area erase process
Start
No
Check the OBF bit in FLASH_STS
OBF = 0?
Yes
Set USDERS = 1 and ERSTR =1
in FLASH_CTRL
OBF = 0 ?
Check the OBF bit in FLASH_STS
Read ODF bit in FLASH_STS
No
Yes
End