cancel
Showing results for 
Search instead for 
Did you mean: 

How to repartition SRAM while using trust zone

PYada.1
Associate III

I am using the SBSFU example of "NUCLEO-L552ZE-Q" Projects.

I have added my application code to the NON-Secure application project.

When I see "Region_defs.h", in which nonsecure (NS_TOTAL_RAM_SIZE ) size is 192 KB whereas secure (S_TOTAL_RAM_SIZE)size is 64 KB. Most of my application code is in the non-secure application.

If I want to repartition SRAM is it possible? If yes how can I do it?

I want to increase the nonsecure ram size to 235 KB, Is it feasible?

2 REPLIES 2
PYada.1
Associate III

I have tried to increase the nonsecure ram to 235 KB, in this case, the application is not booting correctly. With 216KB of nonsecure ram, the application boots properly. Is there any other dependency as well to change nonsecure RAM size?

@Frantz LEFRERE , Can you please help me regarding this?

Fred
ST Employee

Hi @PYada.1​ ,

you can refer to this document: https://www.st.com/resource/en/user_manual/dm00678763-getting-started-with-stm32cubel5-tfm-application-stmicroelectronics.pdf

Section 8.3.2 explains the SRAM memory layout.

I am not sure you can easily change this because:

  • SRAM2 (64kB) is dedicated to the secure part.
  • SRAM1 (192kB) is dedicated to the non-secure part

I am not sure you can shrink the secure part.

If you want to do so, you must:

  1. make sure you keep the security protections consistent (see Figure 54)
  2. make sure the secure RAM size is still sufficient