2025-06-05 1:30 AM
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.
2025-06-05 2:37 AM - edited 2025-06-05 2:39 AM
2025-06-05 3:01 AM
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.
2025-06-05 3:11 AM
Thanks !!
I'm moving the first steps on STM32. They are great microcontroller!
2025-06-05 3:13 AM
Hello @Vergnani_ElEn and welcome to the community, if @ferro answered your question please accept his reply as solution.
Thank you
2025-06-05 3:13 AM - edited 2025-06-05 3:17 AM
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
2025-06-05 3:21 AM
"They are great microcontroller!"
Absolutely. And dev tools as well, TouchGfx. If I may suggest, use C++20.
2025-06-05 4:34 AM
I asked my g++ compiler, what MCUs it supports and below is the list of Cortex M. Your board is cortex-m0plus so the compiler's backend is there. I dont know what is the proper command to generate the list but error message gives what I wanted.
>> arm-none-eabi-g++ -mcpu=h
cortex-m1
cortex-m0
cortex-m0plus
cortex-m1.small-multiply
cortex-m1.small-multiply
cortex-m0.small-multiply
cortex-m0.small-multiply
cortex-m0plus.small-multiply
cortex-m0plus.small-multiply
cortex-m7
cortex-m4
cortex-m3
exynos-m1
cortex-m23
cortex-m33
cortex-m35p
cortex-m55
You can find compiler here
c:\ST\STM32CubeIDE_1.17.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.1.0.202410251130\tools\bin\
2025-06-05 4:46 AM - edited 2025-06-05 4:51 AM
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...
2025-06-05 12:13 PM - edited 2025-06-05 12:13 PM
Convert your Eclipse C project to C++ and settings for C++ compiler will appear.