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


Include files from system-wide gcc used, but not the ones shipped with sw4stm32. How to fix?

“Fixed” the problem. Question now is: how to prevent sw4stm32 from using the wrong include paths? See EDIT 2 at the bottom.

I am just starting to explore sw4stm32 2.6, which is available from the Arch Linux AUR. I have imported an Amazon FreeRTOS demo, and cannot get it to build, because of the following error:

Description	Resource	Path	Location	Type
fatal error: stdint.h: No such file or directory	aws_demos		line 9, external location: /usr/lib/gcc/arm-none-eabi/8.2.0/include/stdint.h	C/C++ Problem


Now, this location does not actually correspond to the gcc shipped with sw4stm32, but to the one I have installed system wide. The gcc shipped with sw4stm32 is located at $ECLIPSE_HOME/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.16.0.201807130628/tools/st-gnu-arm-gcc-7-2017-q4-major_gdb-5_4-2016q3/bin, which is also part of the $PATH defined at Properties > C/C++ Build > Environment.

As you can see in the screenshot below, sw4stm32 considers /usr/arm-none-eabi/include, /usr/lib/arm-none-eabi/8.2.0/include, and /usr/lib/arm-none-eabi/8.2.0/include-fixed as include paths, but not those at /usr/lib/sw4stm32/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.16.0.201807130628/tools/st-gnu-arm-gcc-7-2017-q4-major_gdb-5_4-2016q3/lib/gcc/arm-none-eabi/7.2.1/include or /usr/lib/sw4stm32/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.16.0.201807130628/tools/st-gnu-arm-gcc-7-2017-q4-major_gdb-5_4-2016q3/lib/gcc/arm-none-eabi/7.2.1/include-fixed, respectively.

Sw4stm32 Include

So how does sw4stm32 determine that it should use one path but not the other for finding include files? I did not find a setting that explicitly lists those paths that do get included. Properties > C/C++ General > Paths and Symbols only lists Include Directories related to the env var $ProjName.

Where should I specify that it should look for those include files that were distributed with sw4stm32?


EDIT: I believe I found the setting containing the incorrect includes. In Properties > C/C++ General > Proprocesser Include under Languages/GNU C, I can see the settings entry Ac6 SW4 STM32 MCU Built-in Compiler Settings, with /usr/arm-none-eabi/include, /usr/lib/arm-none-eabi/8.2.0/include, and /usr/lib/arm-none-eabi/8.2.0/include-fixed.

It further says that Settings entries for this provider are supplied by the system and are not editable. That’s very curious.

EDIT 2: I have uninstalled my system-wide versions of the ARM GCC compiler suites. When restarting sw4stm32, it now correctly displays the correct include paths distributed with sw4stm32.

Why then did it choose the wrong paths?

Hi,

The include entries are usually auto-detected on build from a compiler command. The compiler path is defined in Project Properties > C/C++ Build > Settings > Tools Settings > MCU Settings > Path. The default value should be ${openstm32_compiler_path} which refers to the ARM GCC shipped with SW4STM32 (That’s why they are not editable in Ac6 SW4 STM32 MCU Built-in Compiler Settings). It also prepends the system PATH variable for the project to force project using the right compiler.

If the Path value is empty, it uses the system compiler.
Verify the Path value is ${openstm32_compiler_path} on your project, then build the project. it should find the sw4stm32-wide compiler include folders.
There might be a bug if it still looks for the system compiler...

Hope it answers your question.
Regards,
Kevin.


 

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