openOCD参考的launch.json文件
{
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"type": "cortex-debug",
"request": "launch",
"executable": "build/Debug/F405_USB_CDC.elf", //elf文件看当前工程名称或是看build文件夹下的elf文件名称
"cwd": "${workspaceRoot}",
"servertype": "openocd",
"device":"STM32F405RG", //当前芯片型号
"interface":"swd",
"configFiles":[
"D:/toolChain/openocd-0.12.0/tcl/interface/stlink-v2-1.cfg", //使用ST-LINK,路径根据你的openOCD的安装位置修改
"D:/toolChain/openocd-0.12.0/tcl/target/stm32f4x.cfg", //根据芯片型号更改/stm32f4x.cfg ,路径根据你的openOCD的安装位置修改
]
}
]
}