2016-03-09 06:30 AM
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-script2016-03-10 03:11 AM
Hi vsanchez.luis,
Thank you for your feedback. The issue has been reported internally.-Syrine-2016-03-22 11:05 AM
Please note STM32CubeMX 4.14 implements a workaround to the linker script issue on RAM descriptions: only RAM1 will be listed with 96k size. In a next release, both RAMs will be made available in the linker script.
Best regards2016-09-28 11:26 AM
Has this been fully corrected yet?
I am operating on CubeMX Version 4.1 and I get a warning ''memory region `RAM' not declared'' when I try to compile the generated project. This appears to be because there is a reference to ''RAM'' further down in the linker file while there is no ''RAM'' declared at the beginning since it has been replaced by ''RAM1'' and ''RAM2''. Generated linker file attached. ________________ Attachments : STM32L476QG_FLASH.ld : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htlo&d=%2Fa%2F0X0000000aWi%2Fl9riwfInnfr1QKm.C6j9p3vOkk1Q0IUehepYNL8a5io&asPdf=false2016-09-28 11:31 AM
Also I am using the external memory interface and the memory bank area is missing. How do I tell CubeMX to generate a '' MEMORY_B1'' entry in the linker file? Or should this happen automatically.
2016-10-07 01:36 AM
Can you please share your .ioc file. Can you indicate which toolchain you are generating the project for.
Thank you