复制以下代码到你的上述设置当中,注意修改目录文件位置,如果没有elf请继续往下看
{
"cwd": "${workspaceRoot}",
"type": "cortex-debug",
"request": "launch",
"name": "openocd",
"servertype": "openocd",
"executable": "build\\XinLv_GX_Sensor\\XinLv_GX_Sensor.elf",
"runToEntryPoint": "main",
"configFiles": [
"interface/stlink.cfg",
"target/stm32f1x.cfg"
]
}
勾上后重新配置Cortex-Dubug下的openocd即可进行debug
参考部分来源:Vscode EIDE+Cortex Debug搭建STM32开发仿真环境_vscode有串口监视器吗-CSDN博客