raspberrypi / debugprobe

761 stars 202 forks source link

OpenOCD Unable to Connect to debugprobe #122

Closed darranl closed 7 months ago

darranl commented 7 months ago

I am currently setting up a new laptop so reinstalling my Pico development environment however something seems to be out of sync with the latest debugprobe code and OpenOCD.

For OpenOCD the commit checked out is 4d87f6dcae77d3cbcd8ac3f7dc887adf46ffa504

For debugprobe I checkout out commit 327e15f1766fb0ab51df2a55d5c1dccb1842f840 and built and installed.

I try and connect OpenOCD but this fails:

$ openocd -f interface/cmsis-dap.cfg -c "adapter speed 5000" -f target/rp2040.cfg
Open On-Chip Debugger 0.12.0-g4d87f6d (2024-02-23-14:57)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 5000 kHz

Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E6614C311B8B4122
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 5000 kHz
Error: Failed to connect multidrop rp2040.dap0

I also have an old checkout of picoprobe at commit 721b69cf5c8535e57995dbdd2e74f1bbc2f36944 - obviously this is quite old as it is April 2023, if I rebuild this one and install the same OpenOCD connects just fine:

$ openocd -f interface/cmsis-dap.cfg -c "adapter speed 5000" -f target/rp2040.cfg
Open On-Chip Debugger 0.12.0-g4d87f6d (2024-02-23-14:57)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 5000 kHz

Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E6614C311B8B4122
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 5000 kHz
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x00000001
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x10000001
Info : [rp2040.core0] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core0] target has 4 breakpoints, 2 watchpoints
Info : [rp2040.core1] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core1] target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections

In both cases picoprobe / debugprobe was built against the same pico-sdk checkout, I have not replaced OpenOCD and this is against the same Pico hardware.

Please let me know if there is further information I can provide.

darranl commented 7 months ago

Sorry for the noise I am following through the steps in the getting started guide, I see on the readme for this repo there is a small change in the build instructions:

cmake -DDEBUG_ON_PICO=ON ..