Skip to content

๐Ÿ“Ÿ Raspberry Pico plugin

Overview

The microCI raspberry_pico plugin provides a Raspberry Pi Pico build environment for RP2040 and RP2350 devices. Use it when your pipeline needs the Pico SDK, CMake, the ARM cross-toolchain, and picotool to build firmware images for pico, pico_w, pico2, or pico2_w.

Features

  • Pico SDK environment โ€” ships the Raspberry Pi Pico SDK. Use case: compile firmware without installing the SDK on the host.
  • Cross-compilation toolchain โ€” ARM toolchain required for Pico targets. Use case: build .elf and .uf2 firmware artifacts.
  • CMake-based builds โ€” standard Pico SDK CMake workflows. Use case: cmake -S . -B build.
  • picotool support โ€” provides picotool for post-build inspection and firmware handling. Use case: inspect generated binaries or prepare images for deployment.

Setup and configuration

Add a pipeline step in .microCI.yml and configure the raspberry_pico plugin under plugin.

Specific configuration

Parameter Type Required Description
name string yes Must be raspberry_pico.
board string no Target board selector (pico, pico_w, pico2, pico2_w).
bash string conditional Shell script run by the step (/bin/bash). Alternative sh. One of bash or sh must be present.
sh string conditional Shell script run by the step (/bin/sh).

Environment variables (in-container)

Variable Value Purpose
PICO_SDK_PATH /opt/pico-sdk Location of the Pico SDK.
picotool_DIR /opt/picotool Location of picotool.
PICO_BOARD board name Set by the parser when board is valid.

Configuration notes

  • The board name is validated against pico, pico_w, pico2, pico2_w; an invalid board triggers a debug warning (not an error).
  • The default image is intmain/microci_raspberry_pico; network defaults to none, run_as to user.
  • The info step requires run_as: root, privileged: true and a volumes mount of /dev/bus/usb โ€” see the template new/raspberry_pico.yml.

Example

steps:
  - name: "Build Raspberry Pi Pico firmware"
    docker: "intmain/microci_raspberry_pico:latest"
    plugin:
      name: raspberry_pico
      board: pico2 # pico | pico_w | pico2 | pico2_w
      bash: |
        rm -rf build
        cmake -S . -B build
        cmake --build build

Board information (requires USB access):

steps:
  - name: "Pico board Information"
    docker: "intmain/microci_raspberry_pico:latest"
    only: info
    run_as: root
    privileged: true
    volumes:
      - source: /dev/bus/usb
        destination: /dev/bus/usb
        mode: rw
    plugin:
      name: raspberry_pico
      bash: |
        /opt/picotool/picotool info > info.txt

Notes

  • The image is intended for Raspberry Pi Pico family firmware projects based on RP2040 and RP2350 (pico, pico_w, pico2, pico2_w).
  • The same documentation is mirrored in dockerfiles/raspberry_pico/README.md for image-specific usage.

โš™๏ธ Common configuration

All microCI steps share the same set of common fields. These are not plugin-specific: they apply to every plugin and are documented once in the shared snippet so each plugin page stays focused on its own parameters.

Plugin common

Structure

---
docker: "debian:stable-slim"    # optional global default image for all steps
envs:                           # optional global env vars (map)
steps:                          # required; a list of steps
  - name: "Step title"          # required; unique-ish human label
    description: "..."          # optional
    plugin:                     # required
      name: <plugin>            # required; exact plugin id string
      # ... plugin-specific fields (read the plugin page!)

Step-level common fields

Field Type Default Notes
name string โ€” (required) shown by microCI -l, used in logs
description string โ€” free text, stored in the observability db
docker string global docker: or debian:stable-slim image used for the step container
network none | bridge | host none bridge/host when the step needs network (fetch, apt, git push)
run_as root | user user in templates user id inside the container
uid / gid string host $(id -u) / $(id -g) custom ownership for outputs
envs map โ€” values may reference ${VAR} from .env, .env.yml or $HOME/.microCI.env
volumes list of {source, destination, mode} โ€” mode: rw (or ro); host paths mounted in the container
devices list of strings โ€” e.g. "/dev/dri/"; passed to docker
privileged bool false needed for picotool USB access
ssh map {copy_from, copy_to, format} โ€” inject SSH keys; format: "id_ed25519" etc.; with only format, the key is mounted from the default location for git ops
only string tag โ€” step runs ONLY via microCI -O <tag>; otherwise skipped in normal runs

Workspace

The workspace inside the container is /microci_workspace (the repo root is mounted there). The generated script is plain Bash: microCI | bash.

Secrets and environment files

Secrets (tokens, credentials for minio/jfrog/git) are never hardcoded in .microCI.yml. They live in environment files, referenced as "${VAR}":

File Format
$HOME/.microCI.env VAR=VALUE
.env (project root) VAR=VALUE
.env.yml (project root) VAR: VALUE

unsafe plugin exception

The unsafe plugin runs commands directly on the host and rejects these step fields: docker, network, volumes, run_as, devices, ssh.