Skip to main content
Associate
February 9, 2024
Solved

CubeMX 6.10.0 has wrong SRAM size for STM32L452

  • February 9, 2024
  • 4 replies
  • 1578 views

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.

This topic has been closed for replies.
Best answer by Ghofrane GSOURI

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

 

4 replies

Ghofrane GSOURI
Technical Moderator
February 9, 2024

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
TDK
Super User
February 9, 2024

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""."
tpiephoAuthor
Associate
February 9, 2024

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
Ghofrane GSOURIBest answer
Technical Moderator
February 12, 2024

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

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.