Skip to main content
Visitor II
September 21, 2024
Solved

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

  • September 21, 2024
  • 2 replies
  • 2626 views

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

 

 

 

Best answer by STTwo-32

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).

Update: This has been solved on the last version of the STM32CubeMX V6.13.0.

Best Regards.

STTwo-32 

2 replies

Pavel A.
September 21, 2024
STTwo-32
STTwo-32Best answer
ST Technical Moderator
September 22, 2024

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).

Update: This has been solved on the last version of the STM32CubeMX V6.13.0.

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.
Visitor II
October 1, 2024

Thanks for sharing the solution! same bug on stm32f10x.