Skip to main content
SteveM732
Associate
April 10, 2025
Question

Linker script reporting incorrect SRAM size

  • April 10, 2025
  • 1 reply
  • 723 views

The linker scripts generated by MX for the STM32U5G9xx devices are reporting 2528 Kbytes of RAM. These are 3MB devices so I would expect there to be 3008 Kbytes of RAM when ECC is disabled.

 

MX output to STM32U5g9xx_FLASH.ld:

/*
** Abstract : Linker script for STM32U5G9xJ Device from STM32U5 series
** 4096Kbytes FLASH
** 2528Kbytes RAM
*/



/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 2496K
SRAM4 (xrw) : ORIGIN = 0x28000000, LENGTH = 16K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 4096K
}

 

See Table 2 and page 27 of https://www.st.com/resource/en/datasheet/stm32u5g9vj.pdf

 

On a somewhat related note, MX in Linux wasn't generating the linker scripts so I had to use a Windows computer to generate them.

 

1 reply

STTwo-32
Technical Moderator
April 11, 2025

Hello @SteveM732 

Are you using the last version of the STM32CubeMX (V6.14.0). If so, could you please add a .ioc file that reproduce the same behavior (based on the STM32CubeMX V6.14.0). I'm not able to reproduce it on my side:

STTwo32_0-1744380346796.png

Best Regards.

STTwo-32

SteveM732
SteveM732Author
Associate
April 11, 2025

Yes, it is 6.14.0.

STTwo-32
Technical Moderator
April 11, 2025

Hello @SteveM732 

I've opened a project based on your .ioc file on the STM32CubeIDE V1.18.0 and I've been able to find the correct RAM value. Could you send me a screenshot of the error with the last CubeIDE and MX versions.

Best Regards.

STTwo-32