Using the PICO2 with the Arduino Framework on PlatformIO

The title says it all really. I’m working on my Connected Little Boxes and I really want to run the code on the Raspberry Pi PICO2. Annoyingly, this is not one of those things that “just works”. But it can be done. First you need to make sure that your PlatformIO installation is up to date. Navigate to the PlatformIO tab in the Visual Studio plugins. Then select New Terminal from the options. This will open up a terminal window. Now issue the following commands:

platformio pkg update -g
platformio platform update raspberrypi
platformio run -t clean

Once this has completed we can create a PlatformIO.ini entry for the PICO2 platform:

[platformio]
; uncomment the build that you want to select
;default_envs = rpipico
;default_envs = ESP32_DOIT
;default_envs = d1_mini
default_envs = rpipico2

; other environments go here...

[env:rpipico2]
platform = raspberrypi
board = rpipico2w
framework = arduino

; Use Philhower core (RP2040/RP2350 support)
platform_packages =
  framework-arduino-pico @ https://github.com/earlephilhower/arduino-pico.git
board_build.filesystem_size = 0.5m

This fetches the libraries from the Earle Phillhower site and configures the target device. The system will only have a half a megabyte of data storage, you can increase this size if you wish. When you have built the code you can find the firmware.uf2 file in the .pio/build/rpipico2 folder. Turn on your PICO with the BOOTSEL button pressed so that it pops up a storage device and then drag this file onto device.

upload_protocol = cmsis-dap
debug_tool = cmsis-dap

If you have a Raspberry Pi Debug probe you can add the above lines to the file so that the program will be deployed to the probe. If you want to deploy to the PICO2 (not the Wi-Fi version) just change the board to rpipico2

A first look at the Pimoroni PicoSystem

Pico.jpg

I’ve always liked Pimoroni stuff. I’ve just bought another one of their products; a tiny handheld gaming machine powered by the Raspberry Pi PICO. It’s called the PicoSystem and it arrived earlier this week.

It’s a tiny handheld device that looks very like a Gameboy Micro (if you can remember them). The tiny screen is bright and clear and the controls have a very nice feel. The packaging looks great and the device itself is a treat to hold. It’s made of machined aluminium and has a really classy feel. It is shipped with a cute little built-in game, but the fun really starts when you start creating your own games. I’m hoping to get doing this soon.