stacksmashing / pdnd-picoprobe

A fork of Picoprobe, an SWD progammer firmware, for the Pico Debug'n'Dump
21 stars 4 forks source link

DAP init failed #2

Closed nechry closed 3 years ago

nechry commented 3 years ago

Hello I try to use the board as picoprobe but the OpenOCD GDB Server won't start

/Users/nechry/pico/openocd/src/openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /Users/nechry/pico/openocd/tcl -f interface/picoprobe.cfg -f target/rp2040.cfg
Open On-Chip Debugger 0.10.0+dev-g18b4c35-dirty (2021-08-18-23:43)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 5000 kHz
Info : DAP init failed

Same command with the default picoprobe work

I don't know what I'm missing

many thank for your help

debug-silicon commented 3 years ago

Hi,

I ran into the same problem, and after a bit of research, I may have found the reason. It looks like it is a hardware problem: the resistor between SDA/IO and Out1 is too large - 10 kOhm. For normal operation, it must be replaced with a resistor of about 330 Ohms (450 Ohm in my case).

SWD_patch

And after that, the connection to the another RPi pico was successful:

$ openocd -f interface/picoprobe.cfg -f target/rp2040.cfg
Open On-Chip Debugger 0.10.0+dev-g18b4c35-dirty (2021-08-20-18:21)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 5000 kHz
Info : SWD DPIDR 0x0bc12477
Info : SWD DLPIDR 0x00000001
Info : SWD DPIDR 0x0bc12477
Info : SWD DLPIDR 0x10000001
Info : rp2040.core0: hardware has 4 breakpoints, 2 watchpoints
Info : rp2040.core1: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections
nechry commented 3 years ago

@debug-silicon you right! I also put s 470ohm in paralle on the 10kohm and now the probe allow to debug.

Did you also try to get serial debuging output? In my case no echo on serial port. The sample pdnd-uart-bridge work so I did supect device issue, but the serial comm is not handled same in picoprobe

debug-silicon commented 3 years ago

@nechry it looks like this feature hasn't been implemented yet. According to src/picoprobe_config.h, GPIO26 and GPIO27 used as UART1 pins:

#define PICOPROBE_UART_TX 26
#define PICOPROBE_UART_RX 27
#define PICOPROBE_UART_INTERFACE uart1

But this is not possible, only the following GPIOs can be mapped as UART1 (TX and RX):

nechry commented 3 years ago

@debug-silicon thanks again for your help.

I flashed all of the combinations you mention, but still no trace of debugging the DUT. My initial problem regarding the DAP is resolved with the proposed hardware modification.

I will close the topic and open a new one to avoid polluting this one. thanks again

nezza commented 3 years ago

Oh, thank you for noticing this! The manufacturing files specified 330 Ohm, not sure why there is a 10k Ohm placed.. Will investigate if that's the case on all boards!