Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


SW4STM32 plugin with Eclipse build error - "read in flex scanner failed"

Hello,

I am using the latest version with Eclipse together with the SW4STM32 plug-in. I import a project created with STM32CubeMX, and with the chosen toolchain / IDE as SW4STM32. My hardware is an STM32F746G-Disco.

The first time building the project, I get a lot of errors which can be solved by specifying the processor with “-mcpu=cortex-m7”. After that, the only compilation error remaining relates to invoking the MCU GCC Linker.

Below is the full console output from invoking the linker. I have reinstalled the Eclipse software and SW4STM32 plugin and recreated the project many times but the error remains. Is there something that is not specified when creating the project that I need to add?

Building target: stmconnect.elf
Invoking: MCU GCC Linker
arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfloat-abi=soft -L”/Users/USER/Documents/test-workspace/stmconnect/Middlewares/ST/AI/Lib” -specs=nosys.specs -specs=nano.specs -T”../” -Wl,-Map=output.map -Wl,--gc-sections -o “stmconnect.elf” @”objects.list” -lm
/Applications/Eclipse.app/Contents/Eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.macos64_1.17.0.201812190825/tools/compiler/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: read in flex scanner failed

collect2: error: ld returned 1 exit status

make: *** stmconnect.elf Error 1
“make all” terminated with exit code 2. Build might be incomplete.

10:26:51 Build Failed. 2 errors, 0 warnings. (took 508ms)



Thank you,

Hi,

I think the Linker Script (-T) is missing in the project properties. Go in the project Properties > C/C++ Build > Settings > Tools Settings > MCU GCC Linker > General, then enter *.ld file from your project.

It is STM32CubeMX which usually set this value... I don’t know why it was not automatically set for your project.

Regard,
Kevin.
ac6

Hello, thank you for the answer, I got it working now.

 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs