Skip to main content
Associate III
February 14, 2026
Question

STM32CubeMX CMake generated project will not load in VSC

  • February 14, 2026
  • 1 reply
  • 398 views

I found if you generate a CMake project with STM32CubeMX and then try to open it Visual Studio Code w/extensions installed it does not always open and Ninja crashes.

I found if Cmake was previously installed ... as I assume most cross platforms developer probably have already done the STM32 Ninja has start up issues.

I always get things like:

[proc] Executing command: C:\ST\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-gcc.exe -v
[proc] Executing command: cube-cmake -S C:/GitHub/dv/Rcn600/stm32H563 -B c:/GitHub/dv/Rcn600/stm32H563/build -G Ninja
[proc] The command: cube-cmake -S C:/GitHub/dv/Rcn600/stm32H563 -B c:/GitHub/dv/Rcn600/stm32H563/build -G Ninja exited with code: 1
[extension] Using kits, skip selecting configure preset

 The kit scanner always seems to choke.

I did find a fix by placing following line in the .vscode/settings file:

 

 

 

 

 

1 reply

Cartu38 OpenDev
Graduate II
February 14, 2026

@dvescovi 
Not able to see in your message what update done as part of .vscode/settings file ... could you share it back ?

Such said looking at toolchain path used I can conclude your setup is not ok. Toolchain is expected to be part of STM32Cube bundles repository. You're pointing on CLT stuff which is deprecated with this new extension set.

Cartu38OpenDev_0-1771058674388.png

Not an issue to have locally your own cmake, ninja, CLT install it's well managed BUT you have to get proper setup to get stuff working with expected assets. Have got a chance to perform a project setup ? See: https://community.st.com/t5/stm32cubeide-for-visual-studio/how-to-reopen-the-initial-cubemx-popup-in-vs-code/td-p/877737.
This process is adding right pointers to expected utilities like ninja, toolchain & co.


 

dvescoviAuthor
Associate III
February 14, 2026

the "cmake.useCMakePresets": "always",     made all the difference

{
"cmake.cmakePath": "cube-cmake",
"cmake.configureArgs": [
"-DCMAKE_COMMAND=cube-cmake"
],
"cmake.preferredGenerators": [
"Ninja"
],
"cmake.useCMakePresets": "always",
"stm32cube-ide-clangd.path": "cube",
"stm32cube-ide-clangd.arguments": [
"starm-clangd",
"--query-driver=${env:CUBE_BUNDLE_PATH}/st-arm-clang/19.1.6+st.10/bin/starm-clang.exe",
"--query-driver=${env:CUBE_BUNDLE_PATH}/st-arm-clang/19.1.6+st.10/bin/starm-clang++.exe"
]
}

 

dvescoviAuthor
Associate III
February 14, 2026

Oh and by the way the documentation about using CubeMX for project creation and then loading VSC is missing a few steps ... like pressing the "CODE GENERATION" button!