当前位置:   article > 正文

win10下使用vscode无法debug树莓派PICO的问题_openocd: gdb server quit unexpectedly. see gdb-ser

openocd: gdb server quit unexpectedly. see gdb-server output for more detail

先吐槽一下,百度真是一坨xx,找不到有用的东西。
之前调好的一套pico的debug工具,最近翻出来居然调不通了,不知道遇到了什么问题,搞了两三天时间(本身也不懂这些工具链)
w
发现用不了是因为这么一些原因:
1,使用pico作为调试器调试,需要修改launch.json中的interface配置。之前picoprobe固件配置文件为picoprobe.cfg,最近好像改成DAP了,所以配置文件要和自己用的固件版本对应。最新的固件需要改成cmsis-dap.cfg

"configFiles": [
                // This may need to be "interface/picoprobe.cfg" for some previous builds
                "interface/cmsis-dap.cfg",
                "target/rp2040.cfg"
            ],
  • 1
  • 2
  • 3
  • 4
  • 5

2,现象:从GitHub克隆下来的picoprobe工程,在win下编译然后烧录到pico里面,虽然能显示驱动了,但是用openocd是连不上的,显示DAP init failed。
在这里插入图片描述

解决方法:用项目中最新realse的.uf2固件就能正常运行,怀疑和编译环境有关。网上搜的结果都是让检查自己的接线,供电问题,实际和这些没有关系。
在github问了一下,是因为作者没有合并到主分支上,后面更新过了,这点应该没有问题了

3,按照官方get_start文件中配置到最后,然后使用vscode debug时,总是显示openocd:GDB Server Quit Unexpectedly.
在这里插入图片描述
解决方法:在launch.json中加一行,指定一下调试器速度

"openOCDLaunchCommands": [
                "adapter speed 10000"
            ],
  • 1
  • 2
  • 3

完整launch.json文件:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Pico Debug",
            "cwd": "${workspaceRoot}",
            "executable": "${command:cmake.launchTargetPath}",
            "request": "launch",
            "type": "cortex-debug",
            "servertype": "openocd",
            // This may need to be "arm-none-eabi-gdb" for some previous builds
            "gdbPath"           : "arm-none-eabi-gdb",
            "device"            : "RP2040",
            "searchDir"         : [
                "你的路径/openocd/tcl"
            ],
            "openOCDLaunchCommands": [
                "adapter speed 10000"
            ],
            "configFiles": [
                // This may need to be "interface/picoprobe.cfg" for some previous builds
                "interface/cmsis-dap.cfg",
                "target/rp2040.cfg"
            ],
            "svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
            "runToEntryPoint": "main",
            // Work around for stopping at main on restart
            "postRestartCommands": [
                "break main",
                "continue"
            ]            
        }
    ]
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/984522
推荐阅读
相关标签
  

闽ICP备14008679号