cancel
Showing results for 
Search instead for 
Did you mean: 

generated code with cubeMX can't be compiled by cubeIDE on Arch Linux

LJW21
Associate II

generated a new cubeIDE project with cubeMX, for my U585I-IOT02A board, the only things I changed are PC1 pin to high level and toolchain/ide to cubeIDE.

building gives me this error : /opt/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.100.202509120712/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: read in flex scanner failed

 

no matter what I do or find on internet, I can't get it fixed...

 

I'm on arch linux and installed all stm32 softwares with aur and zip downloaded on the st site if needed.

12 REPLIES 12

I am also trying this on arch and have the exact same error.

Using cubeMX version 6.16.0, and cubeIDE version 2.0.0.

/opt/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.100.202509120712/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: read in flex scanner failed
collect2: error: ld returned 1 exit status

I’m also on Arch Linux, and after a bit of tinkering, I’ve found a workaround that works for now.

Go to Project Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU/MPU GCC Linker -> General.
The first field is the Linker Script (-T).

Change it from :
${workspace_loc:/${ProjName}/}
to :
${workspace_loc:/${ProjName}/STM32F446RETX_FLASH.ld}

Make sure you're using the name of your actual FLASH linker script.

Somehow, you can also click the bottom-right button "Restore Defaults" on the same page, and CubeIDE will automatically replace :
${workspace_loc:/${ProjName}/}
with:
${workspace_loc:/${ProjName}/STM32F446RETX_FLASH.ld}

It’s not a full solution, since you have to repeat it every time you create a new project, which is a bit of a bummer, but it works for now.

Hello @Jhend 

 

I reproduced the test on Linux Arch and the build was completed with 0 errors.

MahmoudBenRomdhane_0-1765547832987.png

 

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.