SW4STM32 - use GCC v4.9 ? Posted by awneil on 2017-05-30 11:55 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.
Posted by Gobstopper1708 on 2017-05-31 07:10 I would just second this question. Mbed clearly says not to use 5.4 which is installed with SW 1.14.0. https://developer.mbed.org/forum/helloworld/topic/27833/ I don't know what the answer is, but mbed clearly has a system workbench export option, yet this is incompatible out of the box.
Posted by jLn_38 on 2017-05-31 08:54 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.
Posted by awneil on 2017-05-31 09:07 OK - thanks. As Gobstopper1708 says, this is a Big Issue for anyone wanting to export anything for STM32 from mbed. Is there not a general (non-"hack") way to configure alternative toolchains for Eclipse? Cross-post: https://community.st.com/message/158580-re-can-sw4stm32-be-configured-to-use-gcc-v49
Posted by jLn_38 on 2017-05-31 09:16 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.
Posted by awneil on 2017-05-31 11:15 I guess one would not necessarily want this as a global option for all projects - just for mbed projects.
Posted by awneil on 2017-06-07 14:59 I found this article - which is how GNU ARM Eclipse recommends handling it: http://gnuarmeclipse.github.io/toolchain/path/ Sadly, the options they point to are not present in SW4STM32!
Posted by awneil on 2017-06-07 18:03 OK, so I creatd a new Configuration, and used the path to the 4.9 tools in it: I also added a pre-build step - to confirm the version in use: 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) +-
Posted by awneil on 2017-06-07 18:25 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!! 🙄 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 ... L4_Blinky01.build.log (212.96 Kb)
Posted by awneil on 2017-06-08 11:47 Working with exported mbed projects requires GCC v4.9. This is not mentioned in Documentation > System Workbench for STM32 > User Guide > Importing an mbed program http://www.openstm32.org/Importing+an+mbed+program?structure=Documentation
Posted by awneil on 2017-06-08 19:10 the build fails with "Resource 'Debug-493/sources.mk' does not exist" Seems to be the same as: http://www.openstm32.org/forumthread563 And: https://bugs.eclipse.org/bugs/show_bug.cgi?id=296095 Looks like the fault is that 'clean' is deleting stuff that it shouldn't ?
Posted by jLn_38 on 2017-06-09 11:16 Hi Awneil, Just did a try here on v2.0 using a sample project, and everything work like a charm: Embedded toolchain (5.4) User defined toolchain (4.9) 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.
Posted by jLn_38 on 2017-06-09 11:20 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 😁 !
Posted by awneil on 2017-06-09 12:41 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.
Posted by awneil on 2017-06-21 14:50 v2.0 doesn't work either. 😧 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 ❓ 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