2024-09-21 01:50 PM - last edited on 2024-09-21 03:53 PM by Pavel A.
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
Solved! Go to Solution.
2024-09-22 05:37 AM - edited 2024-09-23 12:27 AM
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.
2024-09-21 03:53 PM - edited 2024-09-21 04:46 PM
Thanks for sharing the solution!
2024-09-22 05:37 AM - edited 2024-09-23 12:27 AM
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.
2024-10-01 08:34 AM
Thanks for sharing the solution! same bug on stm32f10x.