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-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-18 3:24 PM - edited 2026-03-18 3:26 PM
With VS Code no need to open the folder with the .ioc2 file, just open the '_cmake' project folder.
Can you please share the cmake_project folder and .zip issue reporter so we can check the error?
2026-03-18 4:09 PM
Well the problem is when I want to create a repository for the cmake project folder, the IOC file is not included.
I've attached the zip file and included the IOC file
2026-03-19 5:27 AM - edited 2026-03-19 6:29 AM
How did you create the attached IOC2?
Could you please open pack manager and send me a screenshot displaying the "Up To date" packs?
2026-03-19 9:35 AM
I started a board project in CubeMX2, then it generated the IOC2 file. It then asked if i wanted to open the project, which i did. In the GUI, i enabled some peripherals and the System Tick. Then i had it generate the cmake project. But the main.c/h and files were missing.
2026-03-19 7:47 PM - edited 2026-03-19 9:58 PM
Hi @Karl Yamashita
It looks like main.c/h are missing because the pack 'stm32cubemx2_templates_no_os_stm32c5' is not installed in the Pack Manager.
and in the attached project, I didn't see the 'stm32cubemx2_templates_no_os_stm32c5' pack which is responsible of generating those files and the startup component.
It contains only 10 packs while a project created from board contains 12 packs.
we need to check whether the template pack is already installed 'up to date" in Pack Manager.
Could you please open pack manager and share a screenshot of the "Up To date" packs?
2026-03-20 1:05 PM
Yes, I looked at the project and only 10 packs are there for that project.
The 1st project i created has 12 packs. That project had errors building in VS Code. I had VS code fix it so it would build. I can't remember what it did.
The 2nd project is the one I attached prior that has the missing main.c/h.
I created a 3rd project. It has 12 packs and it created main.c/h files. However, it has build errors like the 1st project. I've attached the cmake project, IOC and the output.
2026-03-23 6:57 AM
So, for 2nd project is the one you attached that has the missing main.c/h. I suspect that VS Code might be impacting the issue.
Could you please check the cmsis-scanner bundle version used by VS Code under AppData/Local/stm32cube/bundles?
Also, regarding the CMake issue: you should use latest version of STM32CubeIDE for VS Code or for STM32CubeIDE (Eclipse) that we delivered. to ensure that you are using a compatible CMake version (CMake version ≥ 3.30).
To check the CMake version from the VS Code terminal, run the following command: "cube cmake --version"
Could you please check the versions of the cmsis-scanner bundle and CMake, and let me know both?
2026-03-23 11:57 AM
So, for 2nd project is the one you attached that has the missing main.c/h. I suspect that VS Code might be impacting the issue.
How would VS Code have prevented CubeMX2 from generating the missing files?
I think the 2nd project was just a one time fluke with the 10 packs and missing files.
I created 4th project and the main.c/h files are there. But this has build errors just like the 1st and 3rd projects.
Have you taken a look at the 3rd project that i attached to see if you get the same build error?
2026-03-23 12:13 PM
Yes, it works fine on my side.
For that, I suggested you to check the versions of CMake and the cmsis_Scanner on your side to verify which versions you are using.