2026-03-18 2:28 PM - last edited on 2026-03-23 7:38 AM by Sara BEN HADJ YAHYA
Yesterday I was able to generate a cmake project which included main.c/h files. I opened the project in VS Code but had errors trying to build. I had VS code fix the errors so now I am able to build the project.
Solved! Go to Solution.
2026-03-23 2:29 PM
I've updated STM32CubeCLT_1.20.0 to 1.21.0 and they both report the same version
C:\Users\karl.yamashita>cmake --version
cmake version 3.28.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
C:\Users\karl.yamashita>where cmake
C:\ST\STM32CubeCLT_1.21.0\CMake\bin\cmake.exe
I'm not familiar with cmsis_Scanner?
2026-03-24 6:26 AM
Actually, you need to check the version of Cube Bundle CMake using the command "cube cmake --version" and not "cmake --version".
To make sure all the VS Code Cube bundles are up to date and compatible, run the command "cube bundle update"
in the VS Code terminal.
Please let me know if it works
Regarding STM32CubeMX2, it also uses cmsis_scanner as a resource in background processes. That’s why the version and compatibility are very important and help us investigate the issue more effectively.
2026-03-26 12:28 PM
I ran the following
PS C:\Users\karl.yamashita\STM32CubeIDE\workspace_2\Nucleo-C562RE_Test_cmake> cube cmake --version
cmake version 4.0.1Then ran the update
PS C:\Users\karl.yamashita\STM32CubeIDE\workspace_2\Nucleo-C562RE_Test_cmake> cube bundle update
Do you want to install the following bundles: ["stlink-server@2.1.1+st.8", "st-arm-clangd@21.1.0+st.2", "st-arm-clang-hybrid-21_1_1-description@1.0.0+st.1", "st-arm-clang-hybrid@21.1.1+st.2", "st-arm-clang-21_1_1-description@1.0.1+st.1", "st-arm-clang@21.1.1+st.6", "pack-manager-snapshot@2026.2.27", "ninja@1.13.2+st.1", "gnu-tools-for-stm32-14_3_1-description@1.0.1+st.2", "gnu-tools-for-stm32@14.3.1+st.2", "gnu-gdb-for-stm32@14.3.1+st.2", "cmake@4.2.3+st.1"] (yes, no, show)?After the update
PS C:\Users\karl.yamashita\STM32CubeIDE\workspace_2\Nucleo-C562RE_Test_cmake> cube cmake --version
cmake version 4.2.3I tried building again on a 4th project and I get the same error
[main] Building folder: C:/Users/karl.yamashita/STM32CubeIDE/workspace_2/Nucleo-C562RE_Test_cmake/build/debug_GCC_NUCLEO-C562RE
[main] Configuring project: Nucleo-C562RE_Test_cmake
[driver] NOTE: You are configuring with preset debug_GCC_NUCLEO-C562RE, but there are some overrides being applied from your VS Code settings.
[proc] Executing command: C:\ST\STM32CubeCLT_1.21.0\CMake\bin\cmake.EXE -DCMAKE_BUILD_TYPE=debug_GCC_NUCLEO-C562RE -DTOOLCHAIN_FILE=GCC.14.3.1.cmake -S C:/Users/karl.yamashita/STM32CubeIDE/workspace_2/Nucleo-C562RE_Test_cmake -B C:/Users/karl.yamashita/STM32CubeIDE/workspace_2/Nucleo-C562RE_Test_cmake/build/debug_GCC_NUCLEO-C562RE -G Ninja
[cmake] -- Configuring done (11.7s)
[cmake] CMake Error at cmake/components.cmake:43 (target_link_libraries):
[cmake] Error evaluating generator expression:
[cmake]
[cmake] $<QUOTE>
[cmake]
[cmake] Expression did not evaluate to a known generator expression
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:15 (include)
[cmake]
[cmake]
[cmake] CMake Error at cmake/components.cmake:43 (target_link_libraries):
[cmake] Error evaluating generator expression:
[cmake]
[cmake] $<QUOTE>
[cmake]
[cmake] Expression did not evaluate to a known generator expression
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:15 (include)
[cmake]
[cmake]
[cmake] -- Generating done (0.4s)
[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.
[proc] The command: C:\ST\STM32CubeCLT_1.21.0\CMake\bin\cmake.EXE -DCMAKE_BUILD_TYPE=debug_GCC_NUCLEO-C562RE -DTOOLCHAIN_FILE=GCC.14.3.1.cmake -S C:/Users/karl.yamashita/STM32CubeIDE/workspace_2/Nucleo-C562RE_Test_cmake -B C:/Users/karl.yamashita/STM32CubeIDE/workspace_2/Nucleo-C562RE_Test_cmake/build/debug_GCC_NUCLEO-C562RE -G Ninja exited with code: 1
2026-03-26 3:40 PM
Per our private conversation on exporting with Issue Reporter and not being able to attach a zip file in the private message, I am attaching the zip file here.
2026-03-27 4:19 AM
Hi @Karl Yamashita
Thanks for sharing !!
Regarding the issue with the missing main.c/h files when creating a project from scratch:
just to make it easier to understand what’s going wrong if these issues happen again, it would be great if you could start STM32CubeMX2 in debug mode from now on, using:
Then, once you manage to reproduce issues, please send me the latest log files from:
Those logs with debug mode should give more clues about what’s happening and help investigate the problems further.
2026-03-27 9:59 AM
Hi @Karl Yamashita
Yes, for the Cube bundle, all bundles are now up to date.
What you need to do is check the CMake path in the VS Code settings and set it to "cube-cmake" as shown:
2026-03-27 1:47 PM
I checked the path and it was set for "cmake" instead of "cube-cmake", so updated it.
When building the project i got different errors
[cmakeExecutable] CMake executable not found in cache. Checking again.
[proc] Executing command: cube-cmake --version
[proc] The command: cube-cmake --version failed with error: Error: spawn cube-cmake ENOENT
[proc] Executing command: cube-cmake -E capabilities
[proc] The command: cube-cmake -E capabilities failed with error: Error: spawn cube-cmake ENOENT
[main] Building folder: Nucleo-C562RE_Test_cmake
[cmakeExecutable] CMake executable not found in cache. Checking again.
[proc] Executing command: cube-cmake --version
[proc] The command: cube-cmake --version failed with error: Error: spawn cube-cmake ENOENT
[proc] Executing command: cube-cmake -E capabilities
[proc] The command: cube-cmake -E capabilities failed with error: Error: spawn cube-cmake ENOENT
[rollbar] Unhandled exception: Unhandled Promise rejection: build Error: Build failed: Unable to configure the project {}I had the VS Code agent fix it. It added a wrapper "cube-cmake.cmd" which created this text
@Echo off
"%~dp0cube.exe" cmake %*But it still had the same build error. Then I had the agent try to fix again and it create a settings.json file and added a path.
So now I am able to build the project with zero errors.
2026-03-30 8:49 AM
Nice, to hear it’s working now and that the issue is fixed!
Thanks for sharing what you did too, this will be useful for others who hit the same problem.