AT32F425
Series Reference Manual
2022.03.30
Page 72
Ver 2.01
Figure 5-4
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 or 32 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/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 halts CPU and waits until the
completion of programming. The internal HICK must be enabled prior to programming operation.