cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX 6.10.0 has wrong SRAM size for STM32L452

tpiepho
Associate

I migrated a project from STM32CubeMX 6.3.0 to STM32CubeMX 6.10.0.  It didn't boot anymore.

There was this interesting diff to the linker script:

 **  Abstract    : Linker script for STM32L452VCIx series
-**                256Kbytes FLASH and 160Kbytes RAM
+**                256Kbytes FLASH and 192Kbytes RAM

 MEMORY
 {
-RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 128K
+RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 160K
 RAM2 (xrw)      : ORIGIN = 0x10000000, LENGTH = 32K
 FLASH (rx)      : ORIGIN = 0x8000000, LENGTH = 256K
 }

When did the STM32L452 get 192kB of SRAM?  This is wrong.  It's 160 kB.  The RAM region should just be 128K.  This puts the stack past the end of the real memory.

1 ACCEPTED SOLUTION

Accepted Solutions
Ghofrane GSOURI
ST Employee

Hello @tpiepho 

Thank you for your contributions and for your detailed explanations,

I confirm the issue on my side, it has been reported to STM32CubeMX development team .

 

Internal ticket number: 173165  (This is an internal tracking number and is not accessible or usable by customers).

 

I will keep you posted with updates.

Thx

Ghofrane

 

View solution in original post

4 REPLIES 4
Ghofrane GSOURI
ST Employee

Hello @tpiepho 

First let me thank you for posting.

I will check this issue internally and I will get back to you asap.

Thx

Ghofrane

TDK
Guru

The reference manual gives misleading information here. 128 + 32 is not 196.

TDK_0-1707489074097.png

 

Datasheet is correct.

 

Another reference manual error: extra "F" in the address here:

TDK_1-1707489205396.png

 

If you feel a post has answered your question, please click "Accept as Solution".
tpiepho
Associate

There is this in the datasheet, the SRAM2 region has two mappings:


​• 32 Kbyte located at address 0x1000 0000 with hardware parity check (SRAM2).
This memory is also mapped at address 0x2002 0000, offering a contiguous address
space with the SRAM1 (32 Kbyte aliased by bit band)

So it's possible to make the `RAM` region 160 kB, from 0x2000_0000 to 0x2002_7fff, by having both SRAM1 and SRAM2 contiguous.  But if that's done, then the RAM2 mapping should not be there, as it aliases the end of the RAM mapping and will result in multiple objects assigned to the SRAM2 region.

The reference manual is still wrong if it has 0x2001_7fff as the upper limit.  That's just 96 kB.

Ghofrane GSOURI
ST Employee

Hello @tpiepho 

Thank you for your contributions and for your detailed explanations,

I confirm the issue on my side, it has been reported to STM32CubeMX development team .

 

Internal ticket number: 173165  (This is an internal tracking number and is not accessible or usable by customers).

 

I will keep you posted with updates.

Thx

Ghofrane