
Embedded Flash memory (FLASH)
RM0453
124/1454
RM0453 Rev 2
CPU2 secure SRAM areas
SRAM1 and SRAM2 areas are only secure when the Flash memory security is enabled
(ESE = 1).
The CPU2 secure SRAM2 and SRAM1 areas have a 1-Kbyte granularity and are defined by
the secure “backup” ram (SRAM2) start address user options (BRSD and SBRSA) and the
secure “non-backup” ram (SRAM1) start address user option (NBRSD and SNBRSA) into
the Flash memory. These offset are controlled from the SBRSA and SNBRSA fields in
FLASH_SRRVR.
The CPU2 secure SRAM2 area is defined as:
SRAM2 base a [SBRSA x 0x0400] (included) to the last SRAM2 address.
For example, with a CPU2 secure SRAM2 area from the address 0x2000 A800 (included) to
the address 0x2000 FFFF (included), FLASH_SRRVR must be programmed with
SBRSA = 0x0A.
Any CPU1 read access returns zero data. A write access to a CPU2 security SRAM2 area is
discarded and generates an illegal access event.
When BRSD is set to 1, the SRAM2 is non-secure.
The CPU2 secure “non-backup” SRAM1 area is defined as:
“non-backup” SRAM1 base a [SNBRSA x 0x0400] (included) to the last SRAM1
address.
For example, with a CPU2 secure SRAM1 area from the address 0x2000 6C00 (included) to
the address 0x2000 7FFF (included), FLASH_SRRVR must be programmed with
SNBRSA = 0x1B.
Any CPU1 read access returns zero data. A write access to a CPU2 security SRAM1 area is
discarded and generates an illegal access event.
When NBRSD is set to 1, the SRAM1 is non-secure.
CPU2 debug access
Debug access to the CPU2 is controlled as follows:
•
user option DDS. This variable is accessible from the DDS field in FLASH_SFR.
•
Additionally, when CPU2 debug is enabled in user option DDS, the CPU2 debug
access can be controlled by software with the C2SWDBGEN bit in FLASH_ACR2.
When CPU2 debug is disabled in user option DDS, C2SWDBGEN has no meaning.
The selection for CPU2 debug access is independent from security (ESE = don’t care).
When CPU2 debug access is disabled, the debugger has no access to the CPU2 and the
secure areas.
When the system is non-secure (ESE =0 ), CPU1 and CPU2 can enable and disable the
CPU2 debug access via the DDS bit in FLASH_SFR. In this case, the C2SWDBGEN bit is
not writable and its default value is debug enabled. CPU2 DDS debug is enabled/disabled
after restarting OBL.
When the system is secure (ESE =1 ) CPU2 debug access can only be enabled by the
secure CPU2 via DDS and C2SWDBGEN bits. CPU2 debug can be disabled directly be the
CPU2 via the DDS bit, and indirectly by both CPUs when regressing ESE. CPU2 debug is
enabled/disabled after restarting OBL.