Skip to main content
KnarfB
Super User
October 22, 2025
Solved

cpu_PARAMS in CMakeLists.txt misleading

  • October 22, 2025
  • 2 replies
  • 171 views

Hi, 

the current STM32CubeIDE for Visual Studio Code 3.6.4. (and maybe before) "Create empty project" generates in CMakeLists.txt 

# Core MCU flags, CPU type, instruction set and FPU setup
set(cpu_PARAMS 
 # Other parameters
 # -mthumb
 # -mcpu, -mfloat, -mfloat-abi, ...
)

The comments are misleading, because in cmake\vscode_generated.cmake:

set(cpu_PARAMS ${cpu_PARAMS} ${CPU_FLAGS})

and therefore, my cpu_PARAMS will be combined with the CPU_FLAGS which already include -mcpu etc.

which effectively overwrites my settings.

hth

KnarfB

Best answer by vincent_grenet

@KnarfB Thanks for reporting.
I agree not the best. GCC & Clang are considering always the latest if duplicated parameters. Better to get:

set(cpu_PARAMS ${CPU_FLAGS} ${cpu_PARAMS})

We will fix. 

2 replies

vincent_grenetBest answer
ST Employee
October 22, 2025

@KnarfB Thanks for reporting.
I agree not the best. GCC & Clang are considering always the latest if duplicated parameters. Better to get:

set(cpu_PARAMS ${CPU_FLAGS} ${cpu_PARAMS})

We will fix. 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
ST Employee
December 15, 2025

@KnarfB 
Please be aware that the fix is delivered today as an extension update.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.