Skip to main content
Vergnani_ElEn
Associate II
June 5, 2025
Question

How to use C++17 standard in STM32CubeIDE

  • June 5, 2025
  • 3 replies
  • 971 views

Hi, 

I'm working on a new Firmware Framework, but I need to use C++17 standard. I used STM32CubeMx tools for generating code and now I'm compiling with C++14.

How I can change standard? Instead to compile with C++14 I want to compile using C++17.

3 replies

ferro
Lead
June 5, 2025
Associate II
June 5, 2025

looks like a solution. But I just tried with a new installation of CubeIDE 1.18.1 with a project for nucleo G0B1RE and there is no entry for "MCU G++ Compiler", only "MCU GCC Compiler".

Then I restarted the IDE, created one more project for a nucleo F401RE. Here I can find your settings "MCU G++ Compiler". The G++ settings in the G0B1RE project are still not to find.

ferro
Lead
June 5, 2025

Hm, interesting. Could it be that toolchain support for C++ is missing for that MCU ?

It is Cortex M0+. I expect it is more about the Project template than C++ support.

https://www.st.com/en/evaluation-tools/nucleo-g0b1re.html#st_all-features_sec-nav-tab

 

https://www.st.com/resource/en/data_brief/nucleo-g0b1re.pdf

 

ferro_0-1749118369246.png

 

https://www.st.com/en/microcontrollers-microprocessors/stm32g070rb.html?ecmp=tt9470_gl_link_feb2019&rt=db&id=DB2196

Associate II
June 5, 2025

One more test with STM32C031 (also M0+): the settings for C++ are there!

So M0+ seems not be the problem in general.

@Vergnani_ElEn: which MCU did you try?

 

 

PS: One more test with Nucleo-G0B1RE: now I have the C++ settings here as well.

Maybe there was something missing after new installation of CubeIDE? Really strange behaviour...

Pavel A.
Super User
June 5, 2025

Convert your Eclipse C project to C++ and settings for C++ compiler will appear.