adafruit / ArduinoCore-samd

114 stars 116 forks source link

Arduino IDE v2 debuging suport #346

Closed hathach closed 1 year ago

hathach commented 1 year ago

itsybitsy M4 image

Note: Metro M4 mux swd pin with neopixel or so, and is difficult to test with

KurtE commented 1 year ago

I am trying it out, but unclear of the best way to force the M4 to use the 0.11.0 openOCD. I do have that version installed but it is not finding the config file.

Waiting for gdb server to start...[2023-06-22T20:01:45.295Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\openocd\\0.10.0-arduino7/bin/openocd" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "c:\\Users\\kurte\\Documents\\Arduino\\Blink_hello" -f "C:/arduino-ide_nightly/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl" -f "C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\adafruit\\hardware\\samd\\1.7.12/scripts/openocd/daplink_samd51.cfg"
Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
CDRTOSConfigure
C:\Users\kurte\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.12/scripts/openocd/daplink_samd51.cfg:27: Error: Can't find target/atsame5x.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file "C:\Users\kurte\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.12/scripts/openocd/daplink_samd51.cfg", line 27
[2023-06-22T20:01:45.333Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

Will debug more tomorrow

KurtE commented 1 year ago

Quick update.

@mjs513 - tested on the M0, and showed his changes to platform.txt to force using OpenOCD 0.11, which I did and it now work on my Feather M4 express.

For what it is worth, I am using an Raspberry Pi Pico as the CMIS-DAP using a free-dap image. https://github.com/ataradov/free-dap

hathach commented 1 year ago

@KurtE thank you for testing, another daplink can be used with pico is https://github.com/raspberrypi/picoprobe , which is the firmware running on pi debug probe. It has an advantage that implement multidrop and can also be use to debug another pico.