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