
AT32F413
Series Reference Manual
2022.06.27
Page 72
Rev 2.00
Figure 5-6
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
5.4.3
Programming operation
The User system data area can be programmed with 16 bits at a time.
The following process is recommended:
Check the OBF bit in the FLASH_STS register to confirm that there is no other programming
operation in progress;
Set the USDPRGM bit in the FLASH_CTRL register, so that the programming instructions for the
user system data area can be received;
Write the data (half-word) to be programmed to the designated address;
Wait until the OBF bit in the FLASH_STS register becomes “0”, read the PRGMERR and ODF bit
to verify the programming result.
Note: Read operation to the Flash memory during programming will halt CPU until the completion
of programming.