AT32WB415
Series Reference Manual
2022.04.13
Page 70
Ver 2.00
5.4.4
Read operation
User system data area can be accessed through AHB bus of the CPU.
5.5 Flash memory protection
Flash memory includes access and erase/program protection.
5.5.1
Access protection
Flash memory access protection is divided into two parts: high-levela and lowe level.
Once enabled, only the Flash program is allowed to read Flash memory data. This read operation is not
permitted in debug mode or by booting from non-Flash memory.
Low-level access protection
When the contents in the nFAP and FAP bytes are different from 0x5A and 0xA5, and 0x33 and 0xCC,
the low-level Flash memory access protection is enabled after a system reset.
When the Flash access is protected, the user can re-erase the system data area, and unlock Flash
access protection (switching from protected to unprotected state will trigger mass erase on the Flash
memory automatically) by wrting 0xA5 to FAP byte, and then perform a system reset. Subsequently, the
system data loader will be reloaded with system data and updated with Flash memory access protection
disable state (FAP byte)
High-level access protection
When the content in the nFAP is different from 0x33 , and the content in the FAP byte is not equal to
0xCC, the high-level Flash memory access protection is enabled after a system reset.
Once enabled, it cannot be unlocked, and it is not permissible for users to re-erase and write the system
data area.
Note:
1)
The main memory extension area can also be protected.
2)
If the access protection bit is set in debug mode, then the debug mode has to be cleared by POR
instead of system reset in order to resume access to Flash memory data
Table 5-3 shows Flash memory access limits when Flash access protection is enabled.
Table 5-3 Flash memory access limit
Block
Protection level
Access limits
In debug mode or boot from SRAM and boot
loader code area
Boot from main Flash memory
Read
Write
Erase
Read
Write
Erase
Main Flash
memory
Low-level
protection
Not allowed
Not allowed
(1) (2)
Accessible
High-level
protection(4)
Not allowed
Accessible
User system
data area
Low-level protection Not allowed
Accessible
Accessible
High-level
protection(4)
Not allowed
Not
allowed
(3)
Not allowed
Not
allowed
(3)
(1)
Main Flash memory is cleared automatically by hardware only when the access protection is
disabled;
(2)
Only page erase is forbidden, and mass erase is not affected;
(3)
The user system data area can only be cleared by hardware through the FAP_HL_DIS bit;
(4)
High-level Flash access protection is used to implement Flash access and protect user system data
area against erroneous erase operation.
5.5.2
Erase/program protection
Erase/program protection is performed on the basis of 2 pages.
This is used to protect the contents in the Flash memory against inadvertent operation when the program
crash occurs.