AT32F425
Series Reference Manual
2022.03.30
Page 76
Ver 2.01
Note: Disabling the security library will automatically perform mass erase on the main memory and its
extension area, as well as on security library setting block.
5.6.2
Bootloader code area used as Flash memory extension
There is only one chance for users to program the bootloader code area as the main Flash extension
area, which will have the same features as those of Flash memory after successful configuration as
follows:
Read the bit 0 in the SLIB_STS0 register to obtain the current mode of bootloader code area
Write the value 0xA35F6D24 to the SLIB_UNLOCK register to unlock the current mode of
bootloader code area
Write 0xFF to the bit [7: 0] in the BTM_MODE_SET register
Wait until the OBF bit becomes 0
Perform a system reset, and reload setting words
Read the SLIB_STS0 register to verify
Note: The above-mentioned process must be performed when the Flash memory accesstion
protection is disabled.
5.6.3
CRC verify
The optional CRC check for security library code or user code is performed on a page level.
CRC verify procedure as follows:
Checkk the OBF bit in the FLASH_STS register to confirm that there is no other programming
operation in progress;
Program the start address of the code to be CRC check in the FLASH_CRC_ADDR register
Program the code count (in terms of pages) to be CRC check through the bit [5:0] in the
FLASH_CRC_CTRL register
Enable CRC verify by setting the bit 16 of the FLASH_CRC_CTRL 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
page;
CRC verify must not cross the main Flash memory and its extension area.
5.7
Flash memory registers
These peripheral registers must be accessed by words (32 bits).
Table 5-5
Flash memory register map and reset value
Register
Offset
Reset value
FLASH_PSR
0x00
0x0000 0030
FLASH_UNLOCK
0x04
0xXXXX XXXX
FLASH_USD_UNLOCK
0x08
0xXXXX XXXX
FLASH_STS
0x0C
0x0000 0000
FLASH_CTRL
0x10
0x0002 0080
FLASH_ADDR
0x14
0x0000 0000
FLASH_USD
0x1C
0x03FF FFFC
FLASH_EPPS
0x20
0xFFFF FFFF
SLIB_STS0
0x74
0x00FF 0000
SLIB_STS1
0x78
0xFFFF FFFF
SLIB_PWD_CLR
0x7C
0xFFFF FFFF