2025-07-27 4:54 PM
Solved! Go to Solution.
2025-07-27 11:22 PM
@horizon105457 it's not a regression it's a choice as part of new experience we want to propose.
As always pro & cons. We are happy to get your comments here. We aim to be driven by end users feedbacks. Feel free to share !
You're right <=2.2.1 extension was promoting at STM32CubeMX project import couple of launch.json and tasks.json files. One way was convenient, the other was hard coding too much settings to project structure & co promoted by us. We have ambition to relax end user creativity and support more custom (and possibly more complex, wide, ...) way of working.
So starting 3.4.11 extension versions (currently all pre-release to collect feedbacks) the experience has been updated a bit:
+ Already no need any more to import a project what is not so VSCode way of working. You just have now to add a project your VSCode workspace and like CMake tools extension is doing we are discovering live if added material may be a STM32Cube candidate. As end user you have to confirm it or not.
Part of new experience .. we are forcing nobody: end user has to get the control.
+ Once your project is a STM32Cube one, launch.json (and device flashing coming with) is generated either live under the hood pushing "Run & Debug" button
or if more control required, you can ask for "create a launch.json file" or add an extra configuration if exists already.
Based on launch.json we are fully supporting rich editor experience ... please rely on code completion to access the power of rich debug session we are supporting.
Such said you are in control to create by yourself all tasks you want adapting to your way of working. Brand new STM32Cube bundles based architecture is promoting you all STM32Cube available as a CLI. For example from VSCode integrated terminal STM32CUbe programmer is ready for you. Have a try about:
cube programmer --helpyou can flash erase:
cube programmer -c port=SWD -e allor program:
cube programmer -c port=SWD -d <binary file> or ...
The very same you cam build:
cube cmake ....
2025-07-27 11:22 PM
@horizon105457 it's not a regression it's a choice as part of new experience we want to propose.
As always pro & cons. We are happy to get your comments here. We aim to be driven by end users feedbacks. Feel free to share !
You're right <=2.2.1 extension was promoting at STM32CubeMX project import couple of launch.json and tasks.json files. One way was convenient, the other was hard coding too much settings to project structure & co promoted by us. We have ambition to relax end user creativity and support more custom (and possibly more complex, wide, ...) way of working.
So starting 3.4.11 extension versions (currently all pre-release to collect feedbacks) the experience has been updated a bit:
+ Already no need any more to import a project what is not so VSCode way of working. You just have now to add a project your VSCode workspace and like CMake tools extension is doing we are discovering live if added material may be a STM32Cube candidate. As end user you have to confirm it or not.
Part of new experience .. we are forcing nobody: end user has to get the control.
+ Once your project is a STM32Cube one, launch.json (and device flashing coming with) is generated either live under the hood pushing "Run & Debug" button
or if more control required, you can ask for "create a launch.json file" or add an extra configuration if exists already.
Based on launch.json we are fully supporting rich editor experience ... please rely on code completion to access the power of rich debug session we are supporting.
Such said you are in control to create by yourself all tasks you want adapting to your way of working. Brand new STM32Cube bundles based architecture is promoting you all STM32Cube available as a CLI. For example from VSCode integrated terminal STM32CUbe programmer is ready for you. Have a try about:
cube programmer --helpyou can flash erase:
cube programmer -c port=SWD -e allor program:
cube programmer -c port=SWD -d <binary file> or ...
The very same you cam build:
cube cmake ....
2025-08-01 4:57 AM
I manually added the following task.json file, and now I can compile and upload by running the task, which is in line with my previous EIDE habits.
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "build",
"command": "${command:st-stm32-ide-debug-launch.build}",
"args": [],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"type": "shell",
"label": "flash-with-cubeprogrammer",
"command": "${command:st-stm32-ide-debug-launch.get-programmer-path}/STM32_Programmer_CLI",
"args": [
"-c",
"port=SWD",
"-d",
"${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}"
],
"group": {
"kind": "build",
"isDefault": false
},
"problemMatcher": [],
"dependsOn": [
"build"
]
}
]
}If there are better solutions, please be sure to share them with us.
2025-10-14 2:11 AM
I tried the above solution myself, but it didn't work as is, so I checked the tasks.json file from the previous STMCube VSCode extension and saw that the Flash task had
"-hardRst",
"-rst",
"--start"{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Build",
"command": "${command:st-stm32-ide-debug-launch.build}",
"args": [],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"type": "shell",
"label": "Flash",
"command": "${command:st-stm32-ide-debug-launch.get-programmer-path}/STM32_Programmer_CLI",
"args": [
"-c",
"port=SWD",
"-d",
"${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}",
"-hardRst",
"-rst",
"--start"
],
"group": {
"kind": "build",
"isDefault": false
},
"problemMatcher": [],
"dependsOn": [
"Build"
]
}
]
}
2025-10-14 4:11 AM - edited 2025-10-14 4:12 AM
I've stumbled upon a problem in this. I recently upgraded the extensions as well but I think that it does not migrate the launch.json files properly.
I followed the advice here to remove all existing launch.json configs and just use the cmake run&build but he's unable to perform the dual core run/debugging.
I've had a setup for a dual core STM32H755ZIT6 MCU but after opening up the project using the new extension I'm unable to simply configure a run or debug configuration for both cores. Could you assist in this?
2025-10-14 6:43 AM
Hi Zeno,
For your dual core H755, you need to create 2 debug configurations
In the launch.json file, I start with my CM7 first in this example:
"configurations": [
{
"type": "stlinkgdbtarget",
"request": "launch",
"name": "CM7",
"origin": "snippet",
"cwd": "${workspaceFolder}",
"preBuild": "${command:st-stm32-ide-debug-launch.build}",
"runEntry": "main",
"serverShared": true,
"serverHaltAllCores": true,
"imagesAndSymbols": [
{
"imageFileName": "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context2}"
},
{
"imageFileName": "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}"
}
]
},
{
"type": "stlinkgdbtarget",
"request": "launch",
"name": "CM4",
"origin": "snippet",
"cwd": "${workspaceFolder}",
"preBuild": "${command:st-stm32-ide-debug-launch.build}",
"runEntry": "main",
"serverShared": true,
"serverReset": "None",
"serverPort": "61239",
"imagesAndSymbols": [
{
"symbolFileName": "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}"
}
]
}
]
Important points regarding the attributes:
For the CM7 debug configuration:
For the CM4 debug configuration:
Kind Regards,
Florent
2025-10-15 2:09 AM
Hi @Florent V ,
Thanks for the quick response, this seems to do the trick to flash the CM4 and CM7 with the ST-Link!
However attaching the debugger to CM7 and CM4 doesn't seem to go automatically. I now have to run the launch config for CM7 (which includes CM4) and also run the one for CM4 in order to get the debugger working on both cores.
The VSCode commands causes pop-ups where we still have to select the CM4 or CM7 .elf files when trying to run the configuration.
Using the paths to the build folders directly does the trick.
Slight remark is that the cpp.properties.json file is also completely overridden and contains 4 entries, 2 for CM4 and 2 for CM7, this just doesn't feel right but is there a reason they are duplicated?
{
"configurations": [
{
"name": "STM32_CM7",
"compileCommands": "${workspaceFolder}/CM7/build/Debug/compile_commands.json"
},
{
"name": "STM32_CM4",
"compileCommands": "${workspaceFolder}/CM4/build/Debug/compile_commands.json"
},
{
"name": "STM32_CM7",
"compileCommands": "${workspaceFolder}/CM7/build/Debug/compile_commands.json"
},
{
"name": "STM32_CM4",
"compileCommands": "${workspaceFolder}/CM4/build/Debug/compile_commands.json"
}
]
}
And then I was wondering if there's an easy way to just Build + Flash CM4 & CM7 as we had in the past?
2025-10-15 2:24 AM
@Zeno most probably projecteur setup is going to help you answering uour questions. See https://community.st.com/t5/stm32cubeide-for-visual-studio/stm32-vs-code-extension-disappear-in-vs-code/td-p/847026