Lab Notes

~clarkema >_

Hello World on the Raspberry Pi Pico

23 January 2021

The Raspberry Pi Foundation announced the new Pi Pico a few days ago; their first foray into the world of microcontrollers.

I have a few embedded projects in mind and the board has some very interesting specs (and certainly an interesting price, at £3.60!) so I picked one up to play with.

The first hurdle with boards of this type is generally to get anything running on them at all, but the RPi team have done an outstanding job of making it easy to get started without the baroque proprietary or hacked-up build-chains or IDEs that are often required.

If you're using another Pi running Raspbian as your development machine they have a simple script that installed the Pico SDK and dependencies.

If not, they have some very thorough documentation and an SDK repository that you can submodule into your project. Then it’s just a case of Vim -> standard C -> the Pico CMake build system -> a firmware file that you drag-and-drop onto the Pico, which presents as a USB drive.

The only part that tripped me up was the ARM GCC toolchain coming as a few different packages on Arch, leading to an obscure build error because I’d only installed GCC and not -newlib; if it hadn’t been for that I would have had an LED blinking in 5 minutes.

I put together a quick hello-world project on GitHub that includes everything required to build an LED-blinking firmware on Arch without the use of the RPi Raspbian setup script.