2025-11-23 8:32 AM - last edited on 2025-12-12 6:08 AM by Andrew Neil
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.
2025-12-01 6:31 AM
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
2025-12-10 9:40 PM
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.
2025-12-12 5:58 AM
Hello @Jhend
I reproduced the test on Linux Arch and the build was completed with 0 errors.
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.