cancel
Showing results for 
Search instead for 
Did you mean: 

FLASH.ld syntax error when upgrading to CubeMX v6.12.1

OmidES
Associate II

Hello,

Since the latest release of CubeMX (6.12.1), I have been encountering syntax errors related to the "FLASH.ld" file. This issue only arises when I generate code while setting the Toolchain/IDE to CMake. I am using STM32H753IIKx. It seems that CubeMX does not specify which RAM to use when setting the Toolchain/IDE to CMake.

I have also included the FLASH.ld file that was generated for your reference.

 

Thanks for your help.

26 REPLIES 26
STTwo-32
ST Employee

Bonjour @OmidES 

Could you please attach you .ioc file (if possible for the two CubeMX versions).

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.

Bonjour,

Yes, sure. I have attached the two versions.

Another issue that I also faced, in CubeMX 12.6.0, was when I set the Toolchain to CMake, the DTCMRAM is used. However, if I change the Toolchain to STM32CubeIDE, the RAM_D1 is being used. Is there a way to select which RAM to use in CubeMX?

Thanks again for your help.

xingpeng
Associate

it seem like a bug。 the same configuration,  6.12.0 works well. but  6.12.1 have ld error

The 6.12.1 seems to generate a linker script (.ld) that lacks some 'RAM' symbols on its code, which leads syntax errors.

Hello @mshibata @OmidES @xingpeng 

Thank you so much for your escalation. I've sent this to the concerned team for investigation and 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.

Is this a bug? If so, how long will it take to fix?


This post has been translated from Chinese to comply with the ST Community guidelines.

LLeva.1
Associate III

Confirmed with regular "make".

Missing "RAM" in .ld file. When I repair the file, next cubeMX code generation breaks it again:

 

 

ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
- _estack = ORIGIN(RAM) + LENGTH(RAM);    /* end of RAM */
+ _estack = ORIGIN() + LENGTH();    /* 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 */


@@ -143,7 +143,7 @@ SECTIONS

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

  
  /* Uninitialized data section */

@@ -160,7 +160,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 :

@@ -171,7 +171,7 @@ SECTIONS
    . = . + _Min_Heap_Size;
    . = . + _Min_Stack_Size;
    . = ALIGN(8);
-  } >RAM
+  } >

 

c:/program files (x86)/gnu arm embedded toolchain/arm/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe:STM32F446RCTx_FLASH.ld:56: syntax error
collect2.exe: error: ld returned 1 exit status

Adding "RAM" back to ld will fix it.

 

Thanks GITHUB for keeping proper version! Interesting, old bugs are still here? When we'll get hotfix? And I don't want to hear about "concerned team for investigation".

     

I found a quick solution. You can generate the code by setting the Toolchain to STM32CubeIDE. Then make a copy of the .ld file and use it on your project. Becausae the .ld file generated when setting Toolchain to STM32CubeIDE is still correct.

I hope that helps.