cancel
Showing results for 
Search instead for 
Did you mean: 

Short of RAM in STM32U585 for TFM_Appli_NonSecure

Nitin
Associate III

Hello, I am using STM32U585 TFM architecture for one of my project. Which basically is a combined project of 5 internal projects as usual TFM(mentioned below).

1. TFM_Appli_NonSecure

2. TFM_Appli_Secure

3. TFM_Loader_NonSecure

4. TFM_Loader_Secure

5. TFM_SBSFU_Boot

 

I have surpassed available RAM(SRAM1 of 192kb) for TFM_Appli_NonSecure project. And I am not getting any solution to this even after trying some ways like using SRAM3(mainly).

Nitin_0-1714457447739.png

I think now I need some export opinion for increasing this availablity by minimum of 50kb

Any support any support will be appreciated.

 

Thanks,

Nitin

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jocelyn RICARD
ST Employee

Hello Nitin,

You can use part of SRAM3 of STM32U5.

TFM uses SRAM2 and first 32K of SRAM3 as you can see in region_defs.h

#if defined(STM32U535xx) || defined(STM32U545xx)
#define S_TOTAL_RAM_SIZE        (_SRAM2_SIZE_MAX) /*! size require for Secure part */
#else
#define SRAM3_S_SIZE            0x8000                           /* 32Kbytes */
#define S_TOTAL_RAM_SIZE        (_SRAM2_SIZE_MAX + SRAM3_S_SIZE ) /*! size require for Secure part */
#endif /* defined(STM32U535xx) || defined(STM32U545xx) */

 

So, you can add a region in your non secure linker file starting from SRAM start + 32K until SRAM end.

Then you will need to allocate part of your data in this area

Best regards

Jocelyn

View solution in original post

3 REPLIES 3
Jocelyn RICARD
ST Employee

Hello Nitin,

You can use part of SRAM3 of STM32U5.

TFM uses SRAM2 and first 32K of SRAM3 as you can see in region_defs.h

#if defined(STM32U535xx) || defined(STM32U545xx)
#define S_TOTAL_RAM_SIZE        (_SRAM2_SIZE_MAX) /*! size require for Secure part */
#else
#define SRAM3_S_SIZE            0x8000                           /* 32Kbytes */
#define S_TOTAL_RAM_SIZE        (_SRAM2_SIZE_MAX + SRAM3_S_SIZE ) /*! size require for Secure part */
#endif /* defined(STM32U535xx) || defined(STM32U545xx) */

 

So, you can add a region in your non secure linker file starting from SRAM start + 32K until SRAM end.

Then you will need to allocate part of your data in this area

Best regards

Jocelyn

Hi Jocelyn, thanks for quick support.

I have tried changing MEMORY region like below.

 

MEMORY

{

FLASH (rx) : ORIGIN = NS_CODE_START, LENGTH = NS_CODE_SIZE

RAM (rwx) : ORIGIN = _SRAM3_BASE_NS + 0x8400, LENGTH = 0X3C800

/*RAM (rwx) : ORIGIN = NS_DATA_START, LENGTH = NS_DATA_SIZE*/

}

 

And I have got compilation error as,

Nitin_0-1714466954170.png

If it is because I have not performed "you will need to allocate..

part of your data in this area" I have to try this as I am not expert in LD files.

If issue is something else kindly advice me.

Thanks in advance.

 

Nitin
Associate III

Hi Jose, by getting some understanding of linker script I made it work. Thanks to your guidance in above reply. You are amazing as always:)