cancel
Showing results for 
Search instead for 
Did you mean: 

Run without debugging on VSCode

DamianoF
Associate III

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

10 REPLIES 10
istery
Associate II

我发现了可以创建一个task.json文件,加入以下内容

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": ":down_arrow: Flash",
            "type": "shell",
            "command": "STM32_Programmer_CLI.exe",
            "args": [
                "-c",
                "port=SWD",
                "-w",
                "${workspaceFolder}/build/Debug/TEST.bin",
                "0x08000000",
                "-v",
                "-rst"
            ],
            "group": {
                "kind": "build",
                "isDefault": false
            },
            "problemMatcher": []
        }
    ]
}
这样就可以在终端中运行这个任务,只下载而不进入调试。配合Task插件可以将这个任务直接一键运行,和IDE内的操作一致