2026-02-13 6:58 PM
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:
2026-02-14 12:47 AM
@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.
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.
2026-02-14 4:48 AM
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"
]
}
2026-02-14 4:51 AM
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!
2026-02-16 6:32 AM
Interesting point @dvescovi.
I'm wondering if cmake.useCMakePresets should be set to always by default in the extensions for managed projects.
However, since our STM32CubeMX projects should contain a CMakePresets.json file in the project root directory, the CMake Tools documentation makes me doubt that we fully understand this issue:
(see here)