本帖最后由 zxzx8059 于 2019-5-19 19:52 编辑
求助VS Code用cortex-debug插件debug顯示failed to launch undefined gdb server : timeout
vsc_failed.jpg (204.73 KB, 下载次数: 0)
下载附件
2019-5-19 19:52 上传
用VS Code+IAR的插件,能正常寫Code與Build,
launch.json用地一種配置能download、跑單步,但是只能查看main裡的局部int,全域的看不到,也無法查看寄存器
看到VS Code有個cortex-debug的插件,看起來是能顯示寄存器與其他的MCU狀態,但是怎麼配置都顯示failed to launch undefined gdb server : timeout
還請有用cortex-debug插件的莫友提供一下操作方式
launch.json第一種配置
- {
- "version": "0.2.1",
- "configurations": [
- {
- "name": "Debug J-Link",
- "type": "cppdbg",
- "request": "launch",
- "program": "F:\code\ke02\test001\USER\Debug\Exe\test001.out",
- "stopAtEntry": true,
- "cwd": "${workspaceRoot}",
- "externalConsole": false,
- "MIMode": "gdb",
- "miDebuggerPath": "D:\Program Files (x86)\GNU Tools ARM Embedded\8 2018-q4-major\bin\arm-none-eabi-gdb.exe",
- "debugServerPath": "C:\Program Files (x86)\SEGGER\JLink_V600\JLinkGDBServerCL.exe",
- "debugServerArgs": "-if swd -singlerun -strict -endian little -speed auto -port 3333 -device MKE02Z64xxx4 -vd -strict -halt",
- "serverStarted": "Connected\ to\ target",
- "serverLaunchTimeout": 5000,
- "filterStderr": false,
- "filterStdout": true,
- "setupCommands": [
- {"text": "target remote localhost:3333"},
- {"text": "monitor flash breakpoints = 1"},
- {"text": "monitor flash download = 1"},
- {"text": "monitor reset"},
- {"text": "load F:/code/ke02/test001/USER/Debug/Exe/test001.out"},
- {"text": "monitor reset"}
- ]
- }
- ]
- }
复制代码
launch.json第二種配置
- {
- "version": "0.2.0",
- "configurations": [
- {
- "type": "cortex-debug",
- "request": "launch",
- "cwd": "${workspaceRoot}",
- "servertype": "jlink",
- "executable": "F:/code/ke02/test001/USER/Debug/Exe/test001.out",
- "name": "Debug (jlink)",
- "device": "MKE02Z64XXX4",
- "interface": "swd",
- "ipAddress": null,
- "serialNumber": "null",
- "postLaunchCommands": [
- "load",
- "b main",
- "c"
- ],
- "runToMain": true,
- }
- ]
- }
复制代码
VS Code的settings.json設置
- {
- "cortex-debug.JLinkGDBServerPath": "C:\Program Files (x86)\SEGGER\JLink_V600\JLinkGDBServerCL.exe",
- "cortex-debug.armToolchainPath": "D:\Program Files (x86)\GNU Tools ARM Embedded\8 2018-q4-major\bin",
- "cortex-debug.openocdPath": "D:\openocd-0.10.0\openocd-0.10.0\bin",
- }
复制代码
VS Code+IAR的參考文章
4 磨刀不误砍柴工
用VS Code开发STM32(三)——调试
VSCode下搭建STM32开发环境part2
一周热门 更多>