Hi @MSand.5 ,
There are several SRAM:
- SRAM1: 0x2000 0000 - 0x2001 3FFF
- SRAM2: 0x2001 4000 - 0x2001 7FFF
- CCM SRAM: 0x1000 0000 - 0x1000 7FFF and 0x2001 8000 - 0x2001 FFFF
See the reference manual:
“The CCM SRAM is aliased at address following the end of SRAM2 (0x2000 5800 for
category 2 devices, 0x2001 8000 for category 3 devices, 0x2001 8000 for category 4
devices), offering a continuous address space with the SRAM1 and SRAM2.�?
STM32G474 is a category 3 device
With the current SBSFU configuration, the firmware is using the 32 Kbytes CCM SRAM:
- Boot:
- 0x2001 8000 - 0x2001 8FFF: Secure Engine
- 0x2001 9000 - 0x2001 90FF: Secure memory activation code area
- 0x2001 9100 - 0x2001 FFEF: SBSFU
- 0x2001 FFF0 - 0x2001 FFFF Shared RAM for Image State Handling
- Run time:
- 0x2001 8000 - 0x2001 8FFF: Secure Engine
- 0x2001 9000 - 0x2001 FFEF: User Application
- 0x2001 FFF0 - 0x2001 FFFF Shared RAM for Image State Handling
The CCM SRAM is far more secure than the other ones:
- “On the Category 3 and Category 4 devices, a parity check is implemented on the first
32 Kbytes of SRAM1 and on the whole CCM SRAM.�?
- “CCM SRAM Write protection�?
- “The CCMSRAM is protected with the Read protection (RDP).�?
- “CCM SRAM erase�?
I would not recommend to use SRAM1 or SRAM2 for SE and/or SBSFU.
Regarding the user application, you can use SRAM1 and SRAM2 as long as you accept that these SRAM don’t have security features on same level as CCMSRAM.
You should not need to change MPU configuration to place your user app to SRAM1 or SRAM2.
BR,
J