Getting started with debugger for arduino framework

Hello. I am new to using the debug tool for a project that is under an Arduino framework for platformIO.

Is there a beginner guide on how to use the debug tool?
I’ve been reading the documentation on the platformIO website, but it would help if I had more step-by-step references on how to enable the debug tool.

It may help to show what my ini file looks like for anyone to see what I am working with.

[env]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
platform_packages =
  framework-arduinopico@symlink://C:\Users\USER\Documents\Dev\arduino-pico
framework = arduino
monitor_speed = 115200
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m

[env:adafruit_feather]
board = adafruit_feather
debug_tool = blackmagic
debug_port = \\.\COM17

lib_deps = 
	mikalhart/Streaming @ ^1.0.0
	adafruit/Adafruit GFX Library @ ^1.11.9
	arduinogetstarted/ezButton @ ^1.0.4
	adafruit/Adafruit ST7735 and ST7789 Library @ ^1.10.3
	adafruit/Adafruit MAX1704X @ 1.0.2
	bogde/HX711 @ 0.7.5
	adafruit/Adafruit MCP23017 Arduino Library @ ^2.3.2
	robtillaart/MCP23S17 @ ^0.4.0
	lennarthennigs/Button2 @ ^2.3.2
	fbiego/ESP32Time @ ^2.0.6
	hardmax/ADS1232 @ ^1.0.2
	vshymanskyy/Preferences@^2.1.0
	adafruit/Adafruit BluefruitLE nRF51@^1.10.0
	sparkfun/SparkFun Qwiic 6Dof - LSM6DSO@^1.0.4
	arduino-libraries/Arduino_LSM6DSOX @ ^1.1.2
	pfeerick/elapsedMillis @ ^1.0.6
	sparkfun/SparkFun MAX1704x Fuel Gauge Arduino Library @ ^1.0.4

So you do have a blackmagic debug probe connected to your Pico?

The way to debug is usually with a second Pico board acting as a CMSIS-DAP thanks to the Debugprobe firmware, as explained in the documentation.

https://arduino-pico.readthedocs.io/en/latest/platformio.html#debugging

UPDATE: I found out I don’t have my hardware setup to use debug. I don’t have the SWD pins connected to anything on my board design.

Since I am using a RP2040 as my controller, I did find this. Now, I don’t know how well this works with the arduino-pico platform.

We did remove Pico-Debug self-debugging support some time ago because the repository was archived. It also hogged up the USB connection and some part of either Cache or SRAM, so it wasn’t 100% optimal (but of course awesome if you only have one Pico board). The way to go here is really with two Pico boards.

The needed signals SWCLK and SWDIO (+ GND ofc) can be grabbed from the points specified in https://learn.adafruit.com/adafruit-feather-rp2040-pico/pinouts#debug-interfaces-3084856.

1 Like

Thanks for the insight.