2025-04-23 11:29 PM
I have setup STM32 VSCode extension on my PC and it is amazing. The only problem that I have encountered is that it is not possible to run the code without debugging. I removed the "runToEntryPoint": "main" line in launch.json. But every time I launch the code it attaches a debugger. How can I simply run the code without debugging?
Thank you,
Damiano
Solved! Go to Solution.
2025-09-02 4:24 AM
我发现了可以创建一个task.json文件,加入以下内容
2025-09-23 12:44 PM - edited 2025-09-23 12:44 PM
I prefer to do common operations like this with a keyboard, and I couldn't get most of Sarra.S's suggestions to work. Also, the "Build + Flash" task is the one to use, since it also builds. Here's what works for me:
Option 1: Do this every time you want to run without debugging: Ctrl+Shift+P, type "Tasks: Run Task" (or enough of it so it's at the top of the autocomplete list that pops up), Enter, use up and down arrow keys to select "Build + Flash" (which is defined in your project's autogenerated .vscode/tasks.json), Enter.
Option 2: Add a hotkey by doing Ctrl+Shift+P, and selecting "Preferences: Open Keyboard Shortcuts (JSON)". Set the file contents to this, overwriting what was there (or merge it if there's something important there). After you save the file, you can press Ctrl+F5 to run the command. Unfortunately, this applies to all your VSCode projects.
[
{
"key": "ctrl+f5",
"command": "workbench.action.tasks.runTask",
"args": "Build + Flash"
}
]