I not have idea how to link VSCode Debuger to PlatformIO
Well @zpm1066 has per Using PlatformIO debugger with Raspberry Pi Pico & Picoprobe gotten debugging to work. Even if the development platform doesn’t support debugging out of the box, users can always declare their own debugging tools – in a nutshell, through
platformio.ini directives like
debug_tool = custom debug_server = executable-that-starts-gdb-server -arg1 value1 --other-flag ; where the GDB server port will be opened -- this is the default for OpenOCD debug_port = localhost:3333 ; optional: provide path to SVD file for decoded periphal registers debug_svd_path = C:\...
So, theoretically, if you have a build (or build it yourself with some config) of the Raspberry Pi OpenOCD version, you can tell PlatformIO to invoke that for debugging and it should work. The openocd invocation should be in some style like
bin\openocd.exe -f interface/stlink.cfg -f target/rp2040.cfg
(not checked if that works as I don’t have the hard or software.)
The linked repo also has a
rp2040_jlink branch – so maybe JLink support is also functional?
Note that the tool debug server must start a GDB server though, not some custom other thing. PlatformIO will use the GDB executable of the toolchain to connect to it (aka
Once my Pico arrives I’ll play around with debugging and will try to PR into @wizio’s repo. The stm32 platform (see
platform.py, debug sections in the board definition files, and main.py for using defined debugging protocols for normal upload) contains good hints on how it can be implemented.
Agreed. Although, currently PlatformIO doesn’t offer an out-of-the-box solution, users can certainly debug the Raspberry Pi Pico with it. Most of the debugging seems to be fine other than a few quirks with inspecting variables.
I’ve managed to hookup & debug a couple of different displays (ssd1306, st7789) & some sensors to the Pico.
I haven’t tried WizIO’s repo yet but will test out the
rp2040_jlink branch, as I prefer to use J-Link Edu mini where possible.
I use J-Link with nRF5240 devices (Nordic Dongle, Particle Xenon) and more recently with BBC micro:bit v2. Segger updated their J-Link OB for the micro:bit v2 last month. J-Link with Segger Ozone is a great option.
I’m sure in the next 3-4 months, we’ll have a much smoother Pico development process with PlatformIO. Hopefully later this year, we may even get Zephyr-RTOS support for the Pico!
I add some changes for future-debug
but I need to get second pico for picoprobe and/or some hard debug interface
IF anyone has experience with picoprobe I need step by step all terminal commands
You would also need to add the svd file to a new folder in the platform, called
misc/svd, like e.g. in ststm32.
Also for the debug interface with Raspberry Pi’s GPIO pins, the config files are described here. And for the picoprobe it would need the
interface/ picoprobe.cfg file. But attention: This is again in a different branch in the openocd repo,
picoprobe. Seems confusing to me that there’s a a
rp2040 branch (which doesn’t have the picoprobe file), a
picoprobe branch and a
rp2040_jlink branch, each featuring something different…
today I run openOCD but need arguments…
openOCD for picoprobe
New version 1.0.1
PICO-SDK as is, but the file organization has been restructured to be flexible and have a fast compilation
Added some libraries as
- TinyUSB ( is added as lib )
- FatFS ( FatFs - Generic FAT Filesystem Module )
- LFS ( littlefs )
Arduino can work as Baremetal ( by default ) and with FreeRTOS
lib_deps = freertos ; load FreeRTOS Arduino version
Added support of PIO-ASM - Windows and Ubuntu
board_build.pio_src = src/ws2812.pio
;board_build.pio_dst = include/ws2812.pio.h
Added pico-sdk v 1.1.0 release
will support last release and one old last
board_build.sdk = SDK101 or SDK110 ( default / empty )
Please, help me to configure the new version for baremetal USB Uart.
The USB CDC is working now with the new 1.02 version.
Maybe interesting: I’ve noted that the ArduinoCore-mbed repo, which holds the Arduino core implementation based on mbed-os for a few boards, has a new member since 5 days:
RASPBERRY_PI_PICO. With patch files in the “patches” folder for adding all target dependent stuff with it in the folders
We might be seeing mbed-os integration and official Arduino core integration from that soon.
simple tube demos
Raspberry Pi Pico RP2040 - PlatformIO & Arduino ( Blink )
Raspberry Pi Pico RP2040 - POSIX Threads in Arduino ( FreeRTOS )
BTW: this is version 1.0.4 - will update git this days…
Meanwhile, there’s another youtube video (#377 Arduino Support for the Pi Pico available! And how fast is the Pico? - YouTube) about an unofficial Arduino core implementation GitHub - earlephilhower/arduino-pico: Raspberry Pi Pico Arduino core, for all RP2040 boards.
It seems to get really fragmented really fast
Thanks for alerting the progress on the ArduinoCore-mbed repo.
Glad to see that the Arduino Team are making good progress with the RP2040 / Raspberry Pi Pico ArduinoCore-mbed support. Hopefully we’ll see the official release by April/May.
Will the official ArduinoCore-mbed support for RP2040 mean that we could potentially see a PlatformIO support a few months afterwards?
Debug ( CMSIS-DAP, without probe @ core 1 )
but need more experiments, maybe will work and with picoprobe ( I not have second board )
the example from the movie
We added official support for Raspberry Pi Pico. Please check this post:
See comment above. We’ve not published dev-platform into the registry. It is still in testing. You need to use
[env:pico] platform = https://github.com/platformio/platform-raspberrypi.git framework = arduino board = pico