Hi WizIO, I installed your platform, I tried bare metal, it’s working very well. Thank you for the great work.
The compiler and the upload is working. There is no usb-serial port. Not sure, what is the target of the printf()?
Do you plan to implement the swi debugger as well? (with another Pico or jlink)
I am usually working with the stm32 family in Keil, but this uC is interesting too. While the Python environment is easy to use, it’s too slow for my usual real-time projects. With a working PIO C++ solution this chip could be really great.
Debug session is working in Segger Ozone.
My debug adapter: J-Link Edu mini, v6.96 firmware
Ozone v3.22b
I added “build_flags = -g3” to .ini to get debug info in the .elf file.
In Ozone: RP2040_M0_0, SWD, 4MHz
The upload is not working in Ozone, but “attach to running program” is OK, single step, breakpoints are working, so I simply use the usb upload in PIO.
Did you test a Raspberry PI for debugging instead of picoprobe?
I tried picoprobe and an old RPI3, RPI+openocd is far more efficient.
Almost instant upload and access to the peripheral registers…
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
(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 arm-none-eabi-gdb here).
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!
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…
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 targets/TARGET_RASPBERRYPI/TARGET_RP2040 and [..]/TARGET_NANO_RP2040_CONNECT.
We might be seeing mbed-os integration and official Arduino core integration from that soon.
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?