cancel
Showing results for 
Search instead for 
Did you mean: 

Can't build on VSCode

hasansyr
Associate II

Hello, I have opened someone else's STM32 project in VSCode but I'm getting errors and I can't build. I think it has something to do with CMake, the extension is not asking me to generate a CMAKE config. Do I have to genereate a new project from IDE/MX to work with CMAKE or can I generate the CMAKE files in the exisiting project?

 

Also, it seems that the extension wants you to disable clangd or cpp intellisense extensions because they conflict with the extension's intellisense, is there a way to enable the extention intellisense only for STM32 projects?

Thanks in advance

hasansyr_0-1753450249011.png

 

7 REPLIES 7
Cartu38 OpenDev
Lead III

If you prefer Microsoft C/C++ extension code indexing just disable or unsinstall STM32Cube one

Cartu38OpenDev_0-1753454672090.png

STM32Cube is adding indexing directives for both conributors Microsoft & clangd ... so you have choice !

Cartu38 OpenDev
Lead III

"someone else's STM32 project in VSCode" processed Thanks STM32Cube already (sign of is / do you get at project root a .settings\ide.store.json) ? 

Any trace / log / snapshot more to share about build issue ?

There is no build error because I didn't build, there is no build icon maybe because of the missing CMAKE config

I know I can disable the extensions, my question was if I can use the STM32 one only for STM32 projects since it seems best.

@Cartu38 OpenDev is right, currently - but more ambition here in future, so rational for forking today - promoted STM32Cube clangd extension is on par vanilla one except STM32Cube bundles management addition serving you clangd utility another way.

This extension can be disabled, we are promoting settings for both clangd and Microsoft C/C++ extension embedded indexer, allowing end user to get choice.

VSCode is not supporting to enable / disable an extension per project but workspace based it's possible if helping:

vincent_grenet_0-1753684165900.png

Not expected experience sharing project from one friend to another ... but let's have a try as a work around to reset" your project removing .settings and build folders and restart your VSCode instance.
CMake tools extension should initiate a project discovery process then STM32Cube turn. Let's accept:

vincent_grenet_1-1753684372492.png

Wait a bit until tools install completion (<=> .settings folder & content back) and CMake configure step conclusion. Build should be ok then.
Would be helpful if instead trashing .settings folder you may keep a copy of. If "reset" process ok, we have kind of interest about delta diff between failing one and new one. Feel free to feedback us !