AT32WB415
Series Reference Manual
2022.04.13
Page 63
Ver 2.00
[23: 16]
Data1[7: 0]: User data 1 (It is stored in the FLASH_USD[25: 18]
register)
[31: 24]
nData1[7: 0]: Inverse code of Data1[7: 0]
0x1FFF_F808
[7: 0]
EPP0[7:0]:Flash erase/write protection byte 0 (in the FLASH_EPPS[7:
0]
)
This field is used to protect page0~page15 of main Flash memory.
Each bit takes care of 2 KB pages
0: Erase/write protection is enabled
1: Erase/write protection is disabled
[15: 8]
nEPP0[7: 0]: Inverse code of EPP0[7: 0]
[23: 16]
EPP1[7: 0]: Flash erase/write protection byte 1 (stored in the
FLASH_EPPS[15: 8])
This field is used to protect page16~page31 of main Flash memory.
Each bit takes care of 2 KB pages
0: Erase/write protection is enabled
1: Erase/write protection is disabled
[31: 24]
nEPP1[7: 0]: Inverse code of EPP1[7: 0]
0x1FFF_F80C
[7: 0]
EPP2[7: 0]: Flash erase/write protection byte 2 (stored in the
FLASH_EPPS[23: 16])
This field is used to protect page32~page47 of main Flash memory.
Each bit takes care of 2 KB pages
0: Erase/write protection is enabled
1: Erase/write protection is disabled
[15: 8]
Inverse code of nEPP2[7: 0]: EPP2[7: 0]
[23: 16]
EPP3[7:0]: Flash erase/write protection byte 3 (stored in the
FLASH_EPPS[31: 24])
This field is used to protect page48~page61 of main Flash memory.
Each bit takes care of 2 KB pages
Bit [7] is used to protect the page 62 and the remaining pages, as well
as main Flash memory extension area.
0: Erase/write protection is enabled
1: Erase/write protection is disabled
[31: 24]
nEPP3[7: 0]: Inverse code of EPP3[7: 0]
0x1FFF_F810
[7: 0]
Data2[7: 0]: User system data 2
[15: 8]
nData2[7: 0]: Inverse code of Data2[7: 0]
[23: 16]
Data3[7: 0]: User system data 3
[31: 24]
nData3[7: 0]: Inverse code of Data3[7: 0]
0x1FFF_F814
[7: 0]
Data4[7: 0]: User system data 4
[15: 8]
nData4[7: 0]: Inverse code of Data4[7: 0]
[23: 16]
Data5[7: 0]: User system data 5
[31: 24]
nData5[7: 0]: Inverse code of Data5[7: 0]
…
…
…
…
0x1FFF_FBFC
[7: 0]
Data504[7: 0]: User system data 504
[15: 8]
nData504[7: 0]: Inverse code of Data504[7: 0]
[23: 16]
Data505[7: 0]: User system data 505
[31: 24]
nData505[7: 0]: Inverse code of Data505[7: 0]
5.2 Flash memory operation
5.2.1
Unlock/lock
After reset, Flash memory is protected, by default. FLASH_CTRL cannot be written. Write and erase
operation can be performed only when the Flash memory is unlocked.
Unlock procedure:
Flash memory block can be unlocked by writing KEY1 (0x45670123) and KEY2 (0xCDEF89AB) to the
FLASH_UNLOCK register.
Note: Writing an incorrect key sequence leads to a bus error and the Flash memory is also locked
until the next reset.
Lock procedure:
Flash memory block can be locked by setting the OPLK bit in the FLASH_CTRL register.