cancel
Showing results for 
Search instead for 
Did you mean: 

VSCode impossible workflow

AntekZa
Associate II

Hi,

I’m trying to use VSCode extensions but i find it hard to understand and debug my workflow constantly. When i want to create new project i first generate code scaffold in CubeMX. Then i use VSCode extension to configure the project, then i try to build or flash my project to the board and im met with huge amount of errors with cmake, toolchains etc. 

I Think im missing something here becouse it’s impossbile to work like that. If you have any ideas what am i doing wrong please leave your suggestions. Id be happy to provide any additional details too.

5 REPLIES 5
Cartu38 OpenDev
Lead III

@AntekZa 

Not sure about, your report is opening many doors possibly - let's be more accurate if possible -, may you lack about project setup step ?

Have a try to call it back explicitly:

Cartu38OpenDev_0-1778513782752.png

I'm saying "back" because adding some supported (Cmake project for now) material to VS Code workspace you may had got the following notification:

Cartu38OpenDev_1-1778513887432.png

 

Thank you for your reply.

Yes indeed I performed project setup and configuration step before trying to build with cmake. My issue is that ability to build with cmake behaves unpredictably. Sometimes i need to have generated by CubeMX folder open as workspace and sometimes i don't. I think all my issues would be resolved if i had acces to suggested folder structure (with settings.json, lanuch.json etc.). Maybe there is such doc? I didn't stumble upon...

If needed i could provide my current project state.

@AntekZa 

Is your project looks like ? Right after workspace addition and project setup.
Debug and so launch.json being next step.

Cartu38OpenDev_0-1778532673302.png

 

When it’s opened like this it works just fine. But when this folder is placed in bigger repo (and thus this repo is workspace) everything messes up. In my case I have a folder \targets with my code versions (cubemx projects) for different STM32s. When I have global repo opened as workspace then I’m unable to set up the cmake for chosen target and it is a huge headache so I have to work in these smaller ones which is suboptimal for my workflow…

@AntekZa 
Most possibly VS Code workspace management (https://code.visualstudio.com/docs/editing/workspaces/multi-root-workspaces) is helping or not. As extra Cmake Tools https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools extension has its own way of working on top of or synced with.

 

Having a single parent root folder hosting multiple CMake projects is not supported (STM32Cube is not the guilty contributor here). What you have to do is to get one workspace root per CMake project. This ia enabling you to get all of them within very VS Code instance. It first requires to add to workspace the right - expected in real - way. Have a try to add one by one each CMake project adding to workspace CMake projects root folders one by one. This should already helps Cmake Tools to operate.
Accept then to get STM32Cube setup foreach of them.
You should be set then !