Debug_tool = raspberrypi-swd - error on Windows 10: bcm2835gpio not found

Hi PlatformIO Geniuses,

I am trying to do some low level debugging of my firmware for a RaspberryPi Pico for which I am using a prepared RaspberryPi PicoProbe.

I have used the Arduino IDE 2.0 (which now also is based on Electron like VSCode) and this seems to be able to run my code in debug as the OpenOCD toolchain being used by Arduino has all of it’s configurations and dependencies.

When I try to perform a similar debugging exercise using PlatformIO I receive an error message when uploading:

Generating UF2 image
elf2uf2 ".pio\build\pico\firmware.elf" ".pio\build\pico\firmware.uf2"
Checking size .pio\build\pico\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  15.1% (used 40696 bytes from 270336 bytes)
Flash: [          ]   0.2% (used 4034 bytes from 2097152 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, jlink, picotool, raspberrypi-swd
CURRENT: upload_protocol = raspberrypi-swd
Uploading .pio\build\pico\firmware.elf

Open On-Chip Debugger 0.11.0+dev-gec0240e6a-dirty (2021-03-09-09:44)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

Error: The specified debug interface was not found (bcm2835gpio)
The following debug adapters are available:
1: ftdi
2: usb_blaster
3: ft232r
4: presto
5: usbprog
6: openjtag
7: jlink
8: vsllink
9: rlink
10: ulink
11: arm-jtag-ew
12: remote_bitbang
13: hla
14: osbdm
15: opendous
16: aice
17: cmsis-dap
18: kitprog
19: xds110
20: st-link
*** [upload] Error 1

My current platformio.ini file contains the following simple configuration:

[env:pico]
framework = arduino
platform = raspberrypi
board = pico
debug_tool = raspberrypi-swd
upload_protocol = raspberrypi-swd

I am not sure how I can change and configure the OpenOCD tool and would appreciate any insight or help with this as I really like PlatformIO and would not like to move back to the Arduino IDE.

Kind Regards,

Larry

This debug method expects you to run on a Raspberry Pi (single board computer), on which you connect some of its GPIO pins to the SWD pins of the Raspberry Pi Pico (SWDIO+SWCLK). It’s not meant to be exectued on a Windows computer at all.

What debug adapter / method did you use in the Arduino IDE 2.0? Did you use two Picos, one with the PicoProbe firmware, the other one your debugged Pico?

Hi Max,

Yes I was using 2 picos, where 1 was configured as the probe.

Kind Regards,

Larry

Then you need to use my additions to the platform-raspberry, since PicoProbe is not supported in mainline right now: Arduino-Pico (Earlephilhower) support, PicoProbe Debugging by maxgerhardt · Pull Request #36 · platformio/platform-raspberrypi · GitHub

[env]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
framework = arduino
; uncomment this to use Arduino-Pico
; keep commented to use ArduinoCore-mbed (official RP2040 core)
;board_build.core = earlephilhower
;board_build.filesystem_size = 0.5m

[env:pico]
board = pico
; if using picoprobe SWD upload / debugging
upload_protocol = picoprobe
debug_tool = picoprobe

is what your platformio.ini should look like.

1 Like

That’s amazing. I will look at this now :slight_smile: thanks!

Hi Max,

You are a star! This works perfectly.

Kind Regards,

Larry