GD32W51x User Manual
79
Protection level 1
If there are option bytes, when TZEN = 0 and SPC[7:0] bits in FMC_OBR is set to to any
value except 0xAA, after the system is reset, the Flash memory will be in protection level 1
state. When TZEN = 1 and the SPC byte is set to to any value except 0xAA and 0x55, after
the system is reset, the Flash memory will be in protection level 1 state. If there are no option
bytes, configure FP [7: 0] in EFUSE_FP_CTL
to
level 1, after the system is reset, protection
level 1 performed.
Whether Trustzone is enabled or not, Flash, SRAM and backup registers are accessible to
the code booted from the Flash, including read/program/erase all operations.
When TrustZone is enabled (TZEN=1):
When the CPU is in a non-secure state, non-secure debugging can be performed. When an
intrusion is detected, the Flash, backup registers, and SRAM1 are completely inaccessible.
Read and write access to Flash or backup registers or SRAM1 or RTDEC area can result in
bus errors and Hard Fault interrupt. When the security protection level is set to level 1and
debug access is detected, an intrusion will be detected.
When booting from GSSA, the debug access is disabled.
When TrustZone is enabled, it is no longer be able to boot from SRAM.
When TrustZone is disabled (TZEN=0):
Flash, backup registers, and SRAM1 are completely inaccessible in debug mode or whe code
booting from RAM or from bootloader. In these startup modes, intrusions are detected and
read and write access to Flash or backup SRAM results in bus error and Hard Fault interrupt.
Table 2-4.
Flash secure operation under different protection levels when TrustZone
is active (TZEN=1)
Access type
Fetch
Read
Write
Page erase
SPC0, SPC
0.5, SPC 1
(1)
Non-secure
page
Bus error
all read data is 0,
cause Flash
illegal access
event
w rite invalid, SECWPERR flag
set, Flash illegal access event
DMP area
(DMPxEN=1 and
DMPx_ACCDIS=
1)
all read data is 0
w rite invalid, SECWPERR flag
set
Secure page
OK
no w rite protection pages: OK
w rite protection pages: WI and
SECWPERR flag set