Closed openconcerto closed 2 years ago
hello, have you tried another pico, the first log seems that the e Pico-PMOD-ExtBoard is good, but it didn't detect the pico (rp2040)
and do you have another MCU board, this Pico-PMOD-ExtBoard can also debug other ARM Cortex-M series MCU, please reference here https://github.com/wuxx/openocd-toolbox
Luckily, I have 5 rpi pico and 3 Pico-PMOD-ExtBoard, so I tried with a new pico and a new board.
Same behaviour... :(
I looked at the signals with a logic analyzer, I see activity on SWDIO and SWCLK but I'm not able to decode them.
Using a rpi pico with picoprobe, openocd was able to flash the pico with the WSD protocol.
IMHO, there is a bug in the firmware of the Pico-PMOD-ExtBoard.
eh... lots board already shipped with this firmware... strange..
have you tried the Pico-PMOD-ExtBoard. with some MCUs like STM32 and others..
don't know what logic analyzer you use, but if you use fx2lafw based logic analyzer https://github.com/wuxx/nanoDLA the pulseview support SWD protocol
I use an AnalogDiscovery2.
Here is the capture that you can view/load/export with their (free) WaveForms software (https://mautic.digilentinc.com/waveforms-download)
=> capture : https://www.openconcerto.org/swd.dwf3logicacq
I have no STM32 card or nanoDLA to go further. From my tests, all I can say is
Hello, here is my local test, everything is well. tested on raspberry pi, here is the detail log
pi@raspberrypi:~/oss/pico/pico-lab $ cd tools/
pi@raspberrypi:~/oss/pico/pico-lab/tools $ ls
dap_attach.sh dap_flash_write.sh dfw env.sh rpi_attach.sh rpi_flash_write.sh rreset
dap_flash_dump.sh dap_reset.sh dreset rfw rpi_flash_dump.sh rpi_reset.sh
pi@raspberrypi:~/oss/pico/pico-lab/tools $ source env.sh
pi@raspberrypi:~/oss/pico/pico-lab/tools $ cd ..
pi@raspberrypi:~/oss/pico/pico-lab $ ls
demo doc firmware LICENSE README_cn.md README.md software tools
pi@raspberrypi:~/oss/pico/pico-lab $ cd demo/
pi@raspberrypi:~/oss/pico/pico-lab/demo $ ls
blink.bin breakout_board hello_serial_io01.uf2 hello_serial_io1617.uf2 pico_ws2812.uf2
blink.uf2 hello_serial_io01.bin hello_serial_io1617.bin pico_ws2812.bin vgademo_board
pi@raspberrypi:~/oss/pico/pico-lab/demo $ dfw blink.bin
EXT: bin
Open On-Chip Debugger 0.10.0+dev-g7c96119-dirty (2021-02-03-19:20)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 10000 kHz
Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 0256
Info : CMSIS-DAP: Serial# = 07000001004200354b0000144e4d3434a5a5a5a597969908
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : High speed (adapter speed 10000) may be limited by adapter firmware.
Info : clock speed 10000 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
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
Info : RP2040 B0 Flash Probe: 2097152 bytes @10000000, in 512 sectors
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
Info : Writing 16384 bytes starting at 0x0
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
shutdown command invoked
pi@raspberrypi:~/oss/pico/pico-lab/demo $
how I connect
and notice the script dap_flash_write.sh assume you has opneocd installed under /home/pi/oss/pico/openocd, maybe you need to modify the path in dap_flash_write.sh
Interesting!
The differences I see :
I try to add adapter speed 10000 in cmsis-dap.cfg, but that's not solving the problem. (of course, dap_flash_write.sh was modified to point to my install folder)
So it could be a problem on the cmsis-dap driver on x64 provided by raspberri via git clone https://github.com/raspberrypi/openocd.git --recursive --branch rp2040 --depth=1
yes, it's Raspbian on raspberrypi 3B+, I will also try it on my x64 ubuntu, please wait for a while.
also try on my x64 ubuntu, it's still ok, openocd (https://github.com/raspberrypi/openocd.git) commit id is 7c96119 detail log
wuxx@ubuntu:~/oss/pico/pico-lab/demo$ uname -a
Linux ubuntu 4.4.0-173-generic #203-Ubuntu SMP Wed Jan 15 02:55:01 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
wuxx@ubuntu:~/oss/pico/pico-lab/demo$ dfw blink.bin
EXT: bin
Open On-Chip Debugger 0.10.0+dev-g7c96119-dirty (2021-10-04-19:26)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 10000 kHz
Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 0256
Info : CMSIS-DAP: Serial# = 07000001004200354b0000144e4d3434a5a5a5a597969908
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : High speed (adapter speed 10000) may be limited by adapter firmware.
Info : clock speed 10000 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
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
Info : RP2040 B0 Flash Probe: 2097152 bytes @10000000, in 512 sectors
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
Info : Writing 16384 bytes starting at 0x0
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00
shutdown command invoked
wuxx@ubuntu:~/oss/pico/pico-lab/demo$
I decided to investigate a little, I cooked a correct install script :
and ran it on a other computer (Ubuntu 20.04 too).
After adding adapter speed 5000 in tcl/interface/cmsis-dap.cfg and modifying the path in dap_flash_write.sh
I was happy to see
Open On-Chip Debugger 0.10.0+dev-g71510a7-dirty (2021-10-06-17:42)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 5000 kHz
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 0256
Info : CMSIS-DAP: Serial# = 0700000100390074390000084e50364aa5a5a5a597969908
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
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
I will transfer my opencd directory to the other computer for a last check, but I suppose that there is something wrong on the USB stack of the ext-board. That's not the first time I see microcontrolers having issues with some motherboards controllers.
the source code of debugger is here https://github.com/ARMmbed/DAPLink , already used with many boards, my experience is pretty stable.
Some good and bad news.
Bad news :
Good news :
My conclusions :
Thank you for your tests that guided quest of finding a solution.
ok... maybe a logic analyzer is needed for get the truth, actually the max frequence of SWD clock is about 3MHz on this DAPLink.
document will update, thanks.
Hah! Looked this over, found a blog that went on an on about checking the wiring. .... It was the wiring for me. Maybe for you too? A loose dupont connector on ground.
Mac mini and PicoProbe v.1.0.2 needed adapter speed 1000
(but also seems to work with anything up to 5000).
For people using VSCode, instead of modifying tcl/interface/cmsis-dap.cfg it's probably better to use OpenOCDLaunchCommands
in your .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
... other commands ...
"openOCDLaunchCommands": [
"adapter speed 3000"
],
... other commands ...
}
]
}
Hi,
Something goes wrong for SWD programming. It's seems that the DAPLink is not working as expected.
OS : Ubuntu 20.04 (64bits) The installation was done as specified on the github page (ie compiling openocd from the raspberry repository). I tried with 2 different USB cables, and on USB2 and USB3 ports, same results...
So, having only the Pico-PMOD-ExtBoard plugged :
I tried to add "transport select swd" and "adapter speed 5000" in the cmsis-dap.cfg file, it fails with
Running openocd in debug mode gives more interesting information :
Any idea is welcome. Thanks.