![ARTERY AT32F435 Series Скачать руководство пользователя страница 106](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592106.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 106
Rev 2.03
5.3.4
Read operation
User system data area can be accessed through AHB bus of the CPU.
5.4 Flash memory protection
Flash memory includes access and erase/program protection.
5.4.1
Access protection
When the contents in the nFAP and FAP byte are different from 0x5A and 0xA5, the Flash memory will
activate access protection after a system reset. In this case, 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.
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 writing 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)
Note: 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-6 shows Flash memory access limits when Flash access protection is enabled.
Table 5-6 Flash m emory access lim it
Block
Access limits
In debug mode or boot from SRAM and
boot loader
Boot from main Flash memory
Read
Write
Erase
Read
Write
Erase
Main Flash memory
Not allowed
Not allowed
(1) (2)
Accessible
External memory
Not allowed
Not allowed
(2)
Accessible
User system data area
Not allowed
Accessible
Accessible
(1)Main Flash memory is cleared automatically by hardware only when the access protection is disabled;
(2)Only sector erase and block erase are forbidden. Bank 1 and bank 2 and external memory mass
erase are not affected.
5.4.2
Erase/program protection
This is used to protect the contents in the Flash memory against inadvertent operation when the program
crash occurs.
Erase/program operation is not permitted under one of the following events, and the EPPERR bit is set
accordingly:
The sectors with erase/program protection enabled
The blocks with erase/program protection enabled
Bank1, bank2 with erase/program protection enabled
When the Flash access protection is enabled, the first 4 KB in the main Flash memory will
be protected against erase/program automatically,
Once the Flash access protection is enabled, the main Flash memory is protected against
erase/program when it is in debug mode or when it is started from non-main Flash memory.
5.5 Special functions
5.5.1
Security library settings
Security library is a defined area protected by a code in the main memory. This area is only executable