2020-02-26 02:34 AM
The STM32CubeIDE uses toolchains from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads and the version it uses is 7.
I'd like to use some C++17 features which are not available with gcc7.
How can I add a custom toolchain to the IDE? Is there an easy way? Is there a way to get updates or alternatives to achieve my goal?
Regards,
Marcel
Solved! Go to Solution.
2020-02-26 03:16 AM
This use case is not tested and not officially supported. I suggest you try this in a new workspace on a new dummy project to not mess up your production stuff. If working well you can apply to real project.
There is no easy recommended way to do this in CubeIDE. CubeIED currently bundles two toolchains one built by us, and one from GNU ARM Embedded. Both slightly old. To be addressed at a later point.
Anyway, you could probably go to this folder (identifiers differnt on your system, but you get the point):
C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-arm-embedded.7-2018-q2-update.win32_1.0.0.201904081647\tools
Backup this content, then replace with the latest GCC toolchain downloaded from ARM.
Your project will however still not by default use this toolchain so you have to go to Project Properties > C/C++ Build > Settings > Toolchain version.
Here change from "Default" to "Fixed" and switch Type from "GNU Tools for STM32" to "GNU ARM Embedded".
That should make sure that the toolchain you copied into the tools folder is called.
2020-02-26 02:45 AM
I couldn't find a way to change/upgrade the toolchain (of course it doesn't mean that there is none).
Check out this project https://gnu-mcu-eclipse.github.io/ basically it's CubeIDE minus the CubeMX plugin (which you can run separately if you can suffer it), with flexible tool selection.
2020-02-26 03:16 AM
This use case is not tested and not officially supported. I suggest you try this in a new workspace on a new dummy project to not mess up your production stuff. If working well you can apply to real project.
There is no easy recommended way to do this in CubeIDE. CubeIED currently bundles two toolchains one built by us, and one from GNU ARM Embedded. Both slightly old. To be addressed at a later point.
Anyway, you could probably go to this folder (identifiers differnt on your system, but you get the point):
C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-arm-embedded.7-2018-q2-update.win32_1.0.0.201904081647\tools
Backup this content, then replace with the latest GCC toolchain downloaded from ARM.
Your project will however still not by default use this toolchain so you have to go to Project Properties > C/C++ Build > Settings > Toolchain version.
Here change from "Default" to "Fixed" and switch Type from "GNU Tools for STM32" to "GNU ARM Embedded".
That should make sure that the toolchain you copied into the tools folder is called.
2020-02-26 04:35 AM
I thought about replacing the binaries on the hard drive, but I didn't like the option.
Using another IDE is an option, but that isn't my choice ;)
Thanks for your solutions! I will discuss it in our team.
2020-02-26 04:51 AM
The interface is the same, the same plugins work. Apart from the missing CubeMX (which I don't use much anyway), I can hardly name a feature in CubeIDE which is not present in the gnu-mcu-eclipse tool set. YMMV though, I haven't explored all the features of CubeIDE.
2020-11-08 03:44 AM
** I highly second an option to add custom toolchains to a workspace/project **
We are currently using GNU-ARM 9-2020-q2 via CMake and would like to set this project up in CubeIDE, but cannot as were are using `-std=gnu18` which is not available ST's customised gnu-tools-for-stm32.7-2018-q2.
2020-11-16 01:52 AM
We will investigate how-to allow better support for 3rd party toolchain. It will not be possible in the release schedule for 2020, but let's see during early 2021..
2020-11-17 12:46 AM
Sounds excellent! We've resorted to using VSCode and CLion for now which do not offer the excellent debugging experience in STM32CubeIDE, but it will do for now.
Directly related to this, we also spent a lot of time trying to make STM32CubeIDE work with CMake but failed repeatedly using various methods, like editing the project build settings, Marketplace plugins, and even tried hacking the .project and .cproject files without success. Many places have now moved over to using CMake as this works seamlessly when running locally or on a build server.
As a stop-gap measure it would really help to have STM32CubeIDE work properly with the Marketplace cmake4eclipse plugin for those of us must use CMake for our company projects. This way we can use STM32CubeIDE as our main editor and debugger, instead of having to fallback to other weaker tools.
If I remember correctly, the only thing which seemed to prevent the use of the cmake4eclipse plugin was the STM32CubeIDE project type forcefully hiding the Toolchain entry under project settings > C/C++ Build. If you do allow us to add/modify toolchains, this might automatically unlock the use of this CMake pluging – which would be a massive win for your editor!
I would gladly work with your team in helping test both the custom Toolchain ability and CMake integration.
2023-06-22 02:43 PM
It is now half way through 2023 and I see no evidence of support for custom 3rd party toolchains for STM32CubeIDE. Am I missing something? Why wasn't this support added? Why do we still, for instance, not have the ability to use llvm/clang? Thanks.
2023-06-22 03:31 PM
Interesting, apparently GCC is at version 13, but does the IDE still use version 7?
GCC 13.1 released [2023-04-26] (https://gcc.gnu.org/releases.html)
GCC 7.1 released [2017-05-02] (https://gcc.gnu.org/gcc-7/)
C++17 mode is the default since GCC 11 (https://gcc.gnu.org/projects/cxx-status.html#cxx17)