STM32L476VGT6 STM32CubeMX RAM linker script bug
The linker script after code generation con STM32CubeMx has a bug with the RAM size.
STM32L476VGT6 has 128Kb of ram but splitted in 2 banks (96k + 32k) </colgroup>Buggy Linker Script generated by STM32CubeMx Corrected Linker Script
/* Entry Point */ /* Entry Point */
ENTRY(Reset_Handler) ENTRY(Reset_Handler)
/* Highest address of the user mode stack */ /* Highest address of the user mode stack */
_estack =
0x20020000
; /* end of RAM */
_estack =0x20018000
; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */ /* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x400; /* required amount of heap */ _Min_Heap_Size = 0x400; /* required amount of heap */
_Min_Stack_Size = 0x200; /* required amount of stack */ _Min_Stack_Size = 0x200; /* required amount of stack */
/* Specify the memory areas */ /* Specify the memory areas */
MEMORY MEMORY
{ {
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH =
128K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH =
96K
} }
stm32l476-cubemx-linker-script