cancel
Showing results for 
Search instead for 
Did you mean: 

F303 Generated .ld missing RAM symbol; won't compile -- Includes fix

robertdowling
Associate

CubeMX 6.12.1  STM32Cube_FW_F3_V1.11.5 on Linux Fedora 40
---
New "Basic" Makefile project generated .LD file missing RAM symbol and won't compile with this error:

 

 

/usr/lib/gcc/arm-none-eabi/14.1.0/../../../../arm-none-eabi/bin/ld:STM32F303RETx_FLASH.ld:56: syntax error
collect2: error: ld returned 1 exit status

 

 


Diff against another project suggested these patches. Appears RAM string was somehow empty.  Now it builds

 

 

diff --git a/STM32F303RETx_FLASH.ld b/STM32F303RETx_FLASH.ld
index 83b6f3a..0075b8c 100644
--- a/STM32F303RETx_FLASH.ld
+++ b/STM32F303RETx_FLASH.ld
@@ -53,7 +53,7 @@
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
-_estack = ORIGIN() + LENGTH(); /* end of RAM */
+_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
@@ -144,7 +144,7 @@ SECTIONS

. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
- } > AT> FLASH
+ } >RAM AT> FLASH

_siccmram = LOADADDR(.ccmram);

@@ -180,7 +180,7 @@ SECTIONS
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
- } >
+ } >RAM

/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
@@ -191,7 +191,7 @@ SECTIONS
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
- } >
+ } >RAM

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @robertdowling @Pavel A. 

I 've reported this generation problem to the concerned team for correction on the coming releases (under internal ticket number 191745).

Best Regards.

STTwo-32 

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.

View solution in original post

3 REPLIES 3
Pavel A.
Evangelist III

Hello @robertdowling @Pavel A. 

I 've reported this generation problem to the concerned team for correction on the coming releases (under internal ticket number 191745).

Best Regards.

STTwo-32 

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.

yuanhang_1999
Associate

Thanks for sharing the solution! same bug on stm32f10x.