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 - use GCC v4.9 ?

SW4STM32 seems to come with GCC v5

Working with exported mbed projects requires GCC v4.9.

Can the SW4STM32 be configured to use GCC v4.9 ?

If so, how?

Thanks.


Unfortunatly there is no direct way to configure this at global application scope, you must have to change the “Path” option in project’s propreties (Properties > C/C++ Build > Settings > Tool Settings > MCU Settings) by referencing the bin folder of targeted toolchain.

Anyway a workaround is possible by hacking the toolchain in use within System Workbench installation (INSTALL_DIR/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_xxx/tools/compiler), you could put there any toolchain version but take care to keep the same tree. Note that this is a workaround/hack, any future updates of SW could rollback the toolchain in use.

Hope this help.

Unfortunately not, this is something that was considered in the past but not highlighted as a priority due to the lack of user requests pushing for this change.

Waiting for a solution, both proposed alternatives should work.

I guess one would not necessarily want this as a global option for all projects - just for mbed projects.


OK, so I creatd a new Configuration, and used the path to the 4.9 tools in it:
2017 06 07 (8)

I also added a pre-build step - to confirm the version in use:
2017 06 07 (9)

It seemed that didn’t “take” without restarting Eclipse.

After restarting Eclipse, the build fails with “Resource ‘Debug-493/sources.mk’ does not exist”

On repeating the build, sources.mk appears and then the build fails with “Resource ‘Debug-493/makefile’ does not exist”

On repeating the build, makefile appears and then the build fails with “Resource ‘Debug-493/objects.list’ does not exist”

On repeating the build a third time, objects.list appears and, finally, the build actually completes - but it has used the wrong toolchain!

16:59:25 **** Incremental Build of configuration Debug-493 for project L4_Blinky01 **** make -j4 pre-build main-build ‘Check Toolchain Version’ ‘Building file: ../startup/startup_stm32l476xx.s’ ‘Building file: ../Src/main.c’ arm-none-eabi-gcc --version ‘Building file: ../Src/stm32l4xx_hal_msp.c’ ‘Invoking: MCU GCC Compiler’ ‘Invoking: MCU GCC Compiler’ ‘Invoking: MCU GCC Assembler’ arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496] Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. C:\STWork\L4_Blinky01\Debug-493 arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c99 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32L476xx -I”C:/STWork/L4_Blinky01/Inc” -I”C:/STWork/L4_Blinky01/Drivers/STM32L4xx_HAL_Driver/Inc” -I”C:/STWork/L4_Blinky01/Drivers/STM32L4xx_HAL_Driver/Inc/Legacy” -I”C:/STWork/L4_Blinky01/Drivers/CMSIS/Device/ST/STM32L4xx/Include” -I”C:/STWork/L4_Blinky01/Drivers/CMSIS/Include” -O0 -g3 -Wall -fmessage-length=0 -v -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF”Src/main.d” -MT”Src/main.o” -o “Src/main.o” “../Src/main.c” ’ ’ C:\STWork\L4_Blinky01\Debug-493 arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o “startup/startup_stm32l476xx.o” “../startup/startup_stm32l476xx.s” ‘Building file: ../Src/stm32l4xx_it.c’ C:\STWork\L4_Blinky01\Debug-493 arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c99 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32L476xx -I”C:/STWork/L4_Blinky01/Inc” -I”C:/STWork/L4_Blinky01/Drivers/STM32L4xx_HAL_Driver/Inc” -I”C:/STWork/L4_Blinky01/Drivers/STM32L4xx_HAL_Driver/Inc/Legacy” -I”C:/STWork/L4_Blinky01/Drivers/CMSIS/Device/ST/STM32L4xx/Include” -I”C:/STWork/L4_Blinky01/Drivers/CMSIS/Include” -O0 -g3 -Wall -fmessage-length=0 -v -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF”Src/stm32l4xx_hal_msp.d” -MT”Src/stm32l4xx_hal_msp.o” -o “Src/stm32l4xx_hal_msp.o” “../Src/stm32l4xx_hal_msp.c” ‘Invoking: MCU GCC Compiler’ Using built-in specs. COLLECT_GCC=arm-none-eabi-gcc Target: arm-none-eabi Configured with: /home/build/work/GCC-5-build/src/gcc/configure --build=i686-linux-gnu --host=i686-w64-mingw32 --target=arm-none-eabi --prefix=/home/build/work/GCC-5-build/install-mingw --libexecdir=/home/build/work/GCC-5-build/install-mingw/lib --infodir=/home/build/work/GCC-5-build/install-mingw/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-5-build/install-mingw/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-5-build/install-mingw/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-5-build/install-mingw/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-headers=yes --with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-5-build/install-mingw/arm-none-eabi --with-libiconv-prefix=/home/build/work/GCC-5-build/build-mingw/host-libs/usr --with-gmp=/home/build/work/GCC-5-build/build-mingw/host-libs/usr --with-mpfr=/home/build/work/GCC-5-build/build-mingw/host-libs/usr --with-mpc=/home/build/work/GCC-5-build/build-mingw/host-libs/usr --with-isl=/home/build/work/GCC-5-build/build-mingw/host-libs/usr --with-cloog=/home/build/work/GCC-5-build/build-mingw/host-libs/usr --with-libelf=/home/build/work/GCC-5-build/build-mingw/host-libs/usr --with-host-libstdcxx=’-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm’ --with-pkgversion=’GNU Tools for ARM Embedded Processors’ --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r,armv8-m.base,armv8-m.main Thread model: single gcc version 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496] (GNU Tools for ARM Embedded Processors) +-

Hmm... well posting that log went haywire!
Using the ‘np’ tags to stop it getting magled by the Wiki formatting seems to also disable the correct recognition of line breaks!!

rolleyes

Anyhow, we can see:
‘Invoking: MCU GCC Compiler’ ‘Invoking: MCU GCC Assembler’ arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496] Copyright (C) 2015 Free Software Foundation, Inc.
So the wrong vrsion there - not as specified in my PATH

And references to
c:\bin\ac6\systemworkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.13.1.201701261202\tools\compiler\bin\
again - the wrong PATH.

I will try to attach the log ...




Hi Awneil,

Just did a try here on v2.0 using a sample project, and everything work like a charm:

  • Embedded toolchain (5.4)

Tc541 Config
Tc541 Build Log

  • User defined toolchain (4.9)

Tc493 Config
Tc493 Build Log

Note that the clean operation is supposed to delete the entire Debug folder, its content is auto-generate during the build.
Sometimes the clean fails, usually when Eclipse resources are out-of-sync with the filesystem, and you need to perform a refresh on the project to be able to clean/build again.


Cross-checking your SW version (1.13.1) from the other topic and our bugs database I can confirm that you are still facing this issue because it has been fixed in 1.14.
It’s time to give a chance to version 2.0 mrgreen !

OK, thanks - will do the update & give it a try...

I did also try the “hack” on my existing version - and that does seem to work.

v2.0 doesn’t work either.

mad

I changed the path in: Project Properties > C/C++ Build > Settings > Tool Settings > MCU Settings > Path
but the build is still using the v5.4.1 compiler form the installation.

It looks like it is using the Path from: Project Properties > C/C++ Build > Environment question

So the answer appears to be to delete the setting from: Project Properties > C/C++ Build > Settings > Tool Settings > MCU Settings > Path
And make the setting only in: Project Properties > C/C++ Build > Environment