RP2040 Dev Tools

~/ ../

About

I recently migrated from VoidLinux to Fedora, so I need to setup my development tools on Fedora.

It’s easy to spend too much time doing the thing before you can do the thing… So, I’m going to do my best to resist shaving yaks and focus on setting up a minimal cross platform C/C++ development environment for the RP2040.

Let's get started!

Tooling Setup

Fedora

The official pico-setup instructions are for Raspbian running on a Raspberry Pi (ARM). I had previously adapted them for use with VoidLinux (x86_64).

I’ve created a setup script for Fedora, with the additional goal of not using VSCode or VSCode plugins.

Surprise! Fedora does not package arm-none-eabi-gdb anymore, which is needed for debugging ARM binaries.

Goals

  • Install Fedora dependencies
    • compile arm-none-eabi-gdb
  • compile openocd
  • add udev rules for openocd usb plugdev group
  • compile pico-sdk
  • compile picoprobe
  • compile picotool
  • compile pico-examples
  • compile pico-extras
  • compile pico-playground
  • configure environmental variables

Boiler Plate Project

In order to make it easier to start a new RP2040 based project, I am creating a boilerplate project.

Goals

  • Automate compilation.
  • Automate running openocd.
  • Automate monitoring serial output of pico being debugged.
  • Automate flashing pico.
  • Automate connecting to remote gdb using a non-vscode gdb frontend.
    • Demonstrate step debugging.
    • Demonstrate reading registers and variables.

Serial Wire Debugging Setup

One Pico can be used to reprogram and debug another Pico, using Serial Wire Debugging (SWD) with Picoprobe. Also, it can provide a serial console interface over USB. Very helpful!

This is the expected configuration for the boiler plate.

Left Pico has been programmed to run picoprobe. Right Pico will be debugged. Connect computer to Left Pico USB.

Picoprobe Wiring

Left Pico Right Pico
GND GND
GP2 SWCLK
GP3 SWDIO
GP4/UART1 TX GP1/UART0 RX
GP5/UART1 RX GP0/UART0 TX
VSYS VSYS
Pico Pinout
Created: