GD32W51x User Manual
78
area. When DMPx_ACCFG (x=0,1) bit is set, the code in the DMP area can only be executed
once and does not support read and write operations of data and read operation of
instructions until the next system reset. The DMPx_ACCFG (x=0,1) bit can only be cleared
by a system reset.
The secure DMP area size is defined by by the end page offset using the DMPx_EP
AGE in FMC_DMPx (x=0,1) while the start page offset is already defined by SECMx_
SPAGE in FMC_SECMCFGx (x=0,1) regitsters. If DMPx_ACCFG bit is set, DMPxEN
and DMPx_EPAGE can not be modified until the next system reset. If DMPx_EPAGE>
SECMx_EPAGE, an invalid secure DMP area is defined. The SECERR flag bit will be
set and the FMC_DMPx (x=0,1) register modifications will not be valid at the time.
DMP area 0/1: If there are option bytes, defined by option bytes. Or else defined by secure
software on-the-fly.
Note:
This fuction is only available in FMC mode.
Flash security attribute state
Flash is secure when at least one security area is defined by FMC_SECMCFGx(x=0,1,2,3)
registers.
2.4.9.
Security protection
The FMC provides a security protection function to prevent illegal code/data access to the
Flash memory. This function is useful for protecting the software/firmware from illegal users.
Note:
FMC mode and QSPI mode implements the same security protection strategy.
No protection
If there are option bytes, when SPC[7:0] bits in FMC_OBR is set to 0xAA, after the system is
reset, the Flash memory will be in no protection state. If there are no option bytes, configure
FP[7: 0] bits in EFUSE_FP_CTL to level 0, after the system is reset, the Flash memory will
be in no protection state. The main Flash are accessible by all operations. The SRAM1 and
the backup registers are also accessible by all operations. In GSSA mode, the debug access
is disabled.
Protection level 0.5 (available only when TZEN = 1)
If there are option bytes, when SPC[7:0] bits in FMC_OBR is set to 0x55, after the system is
reset, the Flash memory will be in protection level 0.5 state. If there are no option bytes,
configure FP [7: 0] in EFUSE_FP_CTL to level 0.5, after the system is reset, the Flash
memory will be in protection level 0.5 state. All read and write operations (if no write protection
is set) from/to the non-secure Flash memory are possible. The debug access to secure area
is prohibited. Debug access to non-secure area remains possible. In GSSA mode, the debug
access is disabled.