![ARTERY AT32F435 Series Reference Manual Download Page 105](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592105.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 105
Rev 2.03
5.3.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.
Figure 5-6 System data area programming process
z
OBF = 0?
Set the USDPRGM bit = 1 in
FLASH_CTRL
Write word/half-word
(32bits/16 bits) data
No
Yes
Start
Check the OBF bit in
FLASH_STS
No
Check the OBF bit in
FLASH_STS
OBF = 0?
Yes
Read PRGMERR bit and ODF bit
in FLASH_STS
End