AT32F421 Series Reference Manual
2022.11.11 Page 72 Rev 2.02
5.7.3 CRC verify
The sLib code or user code go through optional CRC check on the basis of a sector level.
CRC verify procedure as follows:
Check that no Flash memory operation is ongoing by checking the OBF bit in the FLASH_STS
register
Program the start address of the code to be verified in the FLASH_CRC_ADDR register
Program the code count (in terms of sectors) to be verified through bit [15:0] in the
FLASH_CRC_CTR register
Enable CRC verify by setting the bit 16 of the FLASH_CRC_CTR register
Wait until the OBF bit becomes 0
Read the FLASH_CRC_CHKR register to verify
Note: The values of the FLASH_CRC_ADDR register must be aligned with the start address of the
sector; CRC verify must not cross the main Flash memory and its extension area boundary.
5.8 Flash memory registers
These peripheral registers must be accessed by words (32 bits).
Table 5-6 Flash memory interface—Register map and reset value