cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476VGT6 STM32CubeMX RAM linker script bug

luis2
Associate
Posted on March 09, 2016 at 15:30

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

5 REPLIES 5
Nesrine M_O
Lead II
Posted on March 10, 2016 at 12:11

Hi vsanchez.luis,

Thank you for your feedback. The issue has been reported internally.

-Syrine-

stm32cube-t
Senior III
Posted on March 22, 2016 at 19:05

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 regards
kcameron796
Associate
Posted on September 28, 2016 at 20:26

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=false
kcameron796
Associate
Posted on September 28, 2016 at 20:31

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.

stm32cube-t
Senior III
Posted on October 07, 2016 at 10:36

Hello Luis,

Can you please share your .ioc file. Can you indicate which toolchain you are generating the project for.

Thank you