cancel
Showing results for 
Search instead for 
Did you mean: 

Custom toolchain for STM32CubeIDE

MaH
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
mattias norlander
ST Employee

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.

View solution in original post

12 REPLIES 12
berendi
Principal

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.

mattias norlander
ST Employee

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.

MaH
Associate

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.

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.

** 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.

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..

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.

0693W000005BbvpQAC.png0693W000005BbvaQAC.png

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.

RhSilicon
Lead

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)