GD32W51x User Manual
81
Table 2-7.
Flash mass erase operation under different protection levels when
TrustZone is active (TZEN=1)
Access type
SPC 0.5, SPC 1
(1)
SPC 1
(2)
Non-secure
page
Secure Flash
Mix non-secure
page and
Secure page
Non-secure page
or secure page
DMP area
(DMPxEN=1 and
DMPx_ACCFG=
1)
Others
(3)
secure
Mass
erase
w rite invalid,
SECWPERR
flag set,
Flash illegal
access event
w rite invalid and
SECWPERR flag
set
no w rite
protection
pages: OK
w rite
protection
pages: WI
and
SECWPERR
flag set
w rite invalid,
SECWPERR
flag set, Flash
illegal access
event
w rite invalid,
SECWPERR flag
set
Non-
secure
Mass
erase
no w rite
protection
pages: OK
w rite
protection
pages: WI
and WPERR
flag set
all read data is 0, Flash illegal access event
w rite invalid, WPERR flag set, Flash illegal
access event
w rite invalid,
WPERR flag set
Note
:
(1)Booting from Flash and no debug access. (2) Debug access is detected. (3) Others
refer to other Flash security configurations that are different from the Flash security
configuration described for DMP protection.
In QSPI mode, when the user accesses the external Flash memory in violation of the Flash
security attribute configured by secure mark, if it is a fetch instruction, an error response is
returned, and data 0 is returned. If it is not a fetch instruction, data 0 is returned.
Modify security protection level when Trust zone is enabled
It is easy to move from security protection level 0 or level 0.5 to level 1 by changing the value
of the SPC[7:0] in FMC_OBR to any value except for 0x55 or 0xAA.
When the SPC[7:0] is programmed to the value 0xAA to move from level 0.5 or from level 1
to level 0, a mass erase of the Flash main memory is performed. The backup registers and
all SRAMs are also erased.