win10下使用vscode无法debug树莓派PICO的问题

先吐槽一下,百度真是一坨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"
            ],

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"
            ],

完整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"
            ]            
        }
    ]
}
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值