Raspberry Pi RP2040 microcontroller - PIO support when? :)

Per Buy a Raspberry Pi Pico – Raspberry Pi the Raspberry Pi Foundation has released, just today, a new microcontroller with it’s own silicon, the RP2040.

Blog: Meet Raspberry Silicon: Raspberry Pi Pico now on sale at $4 - Raspberry Pi

grafik

The board can be programmed with Micropython and also has a C/C++ SDK available:

Datasheet: https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf

Programmable via the built-in USB bootloader (file drag-and-drop) and SWD.

PIO SUPPORT WHEN? :smiley: @ivankravets

4 Likes

Hi @maxgerhardt, hope you are well and staying safe.

Funnily enough, I thought that same thing this morning when I read the news of the new board.

Take care.

Cheers,
Norm.

3 Likes

Well if we do have itchy fingers and implement it ourselves we might end up duplicating work that’s done by the main devs.

But on another note, the CMake-based pico-sdk might be replicated in PIO with what the esp32 platform is doing with ESP-IDF – “just” call into cmake, too. Or use the ‘normal’ build path with SCons. If my board arrives and there’s not yet a PIO integration, I might have a play with it.

Note, the official docs already show how to use VSCode, Eclipse and CLion as IDEs.

I have to say I’m extremely impressed by the amount and quality of the documentation for this new board, all of it available on “day 1” too.

Cheers,
Norm.

1 Like

Thanks for posting it here! There is also a feature request

It’s unclear how to debug that board. Let’s wait a few months when we have normal software.

2 Likes

@ivankravets
Not sure how useful this is but chapter 5 of the Getting Started document discusses using GDB and OpenOCD

It’s fantastic to see Raspberry offer an alternative to the very low cost MCUs. Top notch documentation!

The RP2040 Pico has a SWD port for debug via J-Link, ST-Link, etc. Hope in a few months time we’ll have PlatformIO and Zephyr support for it.

I hope the next iteration adds Bluetooth 5 or Wifi at the same price point.

In the mean time, it’ll time to place an order for a few Picos and test out the new kid on the block!

How about add it now, and in a few months add debug support :wink:
Debugging is not a critical thing,

1 Like

Let’s move to the original issue. We will need official integration from RPi side. See my comment

Pretty much what I was thinking also… Once there’s an Arduino IDE for it… It’ll turn in Platformio shortly afterwards. It certainly made a splash though the other day… shall be an interesting board to follow, with the two programmable logic/io chips, built in boost buck regulator, etc…

Morning Peter,

I got one yesterday stuck to the cover of Hackspace Magazine. :grinning:

I haven’t had a chance (been allowed) to play yet. The docs are amazing though. I think the Programmable IO is going to be big. Given there are 2banks of 4 state machines,each with 32bytes of code space, you can build DVI, SPI, UARTs etc. Also rumoured, a proper network interface!

Arduino are building their own board(s) using the RP2040 microcontroller. Welcome Raspberry Pi to the world of microcontrollers | Arduino Blog

Stay safe.

Cheers,
Norm.

2 Likes

Hi…these are two very different devices, a microcontroller and a microcomputer, intended for different purposes. Pico is a great device for dedicating to a very specific task, whereas Zero is a multipurpose device. Raspberry Pi Zero has HDMI out, a camera interface, etc; Raspberry Pi Pico does not. However, Pico has an on-board ADC as well as other peripherals not present on Raspberry Pi Zero, and consumes considerably less power; it is therefore much more suited to embedded applications than Raspberry Pi Zero.

just experiment as beginning…
https://github.com/Wiz-IO/wizio-pico

3 Likes

48MHz ( -Os ) CoreMark 1.0 : 146.58
150MHz ( -Os ) CoreMark 1.0 : 293.19

example: https://github.com/Wiz-IO/wizio-pico/tree/main/examples/arduino/CoreMark

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.

Hi,

for Baremetal ( pico-sdk ) printf() is retarget to uart 0
pins is defined in …pico-sdk/src/boards/include/boards/pico.h

for Arduino printf() is retarget to SerialX …
Serial.begin(115200, true);

Arduino platform use defaul gcc stdio “-specs=nano.specs”

USB is TODO … need to find include files

Debug session is working in Segger Ozone. :slight_smile:
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.

1 Like

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…

I not have idea how to link VSCode Debuger to PlatformIO :frowning:

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 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.

1 Like