2024-02-09 04:27 AM
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.
Solved! Go to Solution.
2024-02-12 01:36 AM
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
2024-02-09 04:52 AM
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
2024-02-09 06:33 AM
The reference manual gives misleading information here. 128 + 32 is not 196.
Datasheet is correct.
Another reference manual error: extra "F" in the address here:
2024-02-09 10:55 AM
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.
2024-02-12 01:36 AM
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