Skip to main content
MaH
Associate
February 26, 2020
Solved

Custom toolchain for STM32CubeIDE

  • February 26, 2020
  • 4 replies
  • 18101 views

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

Best answer by mattias norlander

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.

4 replies

berendi
Principal
February 26, 2020

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
February 26, 2020

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.

Matthew1
Associate
November 8, 2020

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

mattias norlander
ST Employee
November 16, 2020

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

MaH
MaHAuthor
Associate
February 26, 2020

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.

berendi
Principal
February 26, 2020

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.

RhSilicon
Lead
June 22, 2023

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)