Skip to content

aaronduignan/rpi-pico-w-zephyr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPi Pico W — Zephyr Development Environment

Containerised Zephyr RTOS build environment for the Raspberry Pi Pico W, with SWD flashing via the Raspberry Pi Debug Probe.

Supported Platforms

Platform Build Flash Serial
macOS Intel
macOS Apple Silicon ⚠️ Slow (Rosetta emulation)
Linux (Ubuntu/Debian)
Windows (WSL2) ⚠️ Partial ⚠️ Complex ⚠️ PuTTY

Hardware Required

  • Raspberry Pi Pico W (target)
  • Raspberry Pi Debug Probe
  • USB-C cable (debug probe)
  • USB-Micro or USB-C cable (Pico W power, optional)

Wiring

Refer to the official Debug Probe documentation for the SWD and UART pinout.

Prerequisites

macOS (Intel & Apple Silicon)

brew install openocd

Install Docker Desktop for Mac

Linux (Ubuntu/Debian)

sudo apt install openocd

Install Docker Engine

Add yourself to the dialout group for serial access:

sudo usermod -aG dialout $USER

Windows

Use WSL2 with Docker Desktop. Flash and serial steps require additional setup — see the OpenOCD Windows guide.


Setup (one-time)

Warning: The workspace initialization (init-workspace.sh) downloads the entire Zephyr source tree and all module dependencies (~5 GB). It will take a long time and peg your CPU. Run it when you don't need your machine for anything else and are due a coffee.

1. Build the Docker image — downloads the Zephyr SDK ARM toolchain and host tools. Takes ~5-10 min.

docker compose build

2. Initialize the Zephyr workspace — clones Zephyr and all modules into workspace/. Uses --depth=1 shallow clones (latest commit only, no history) to keep the download manageable. Still takes 20-40 min and ~3 GB on first run. Only needed once per machine; workspace/ is gitignored.

docker compose run zephyr ./scripts/init-workspace.sh

Usage

Build

docker compose run zephyr ./scripts/build.sh

Output: app/build/zephyr/zephyr.elf

Flash (run on host, not in Docker)

./scripts/flash.sh

Serial monitor

macOS:

ls /dev/tty.usbmodem*
screen /dev/tty.usbmodem* 115200

Linux:

ls /dev/ttyACM*
screen /dev/ttyACM0 115200

Exit screen with Ctrl-A then K, then y to confirm.


Project Structure

.
├── Dockerfile                  # Zephyr SDK build environment
├── docker-compose.yml
├── openocd/
│   └── picoprobe.cfg           # OpenOCD config for Debug Probe
├── scripts/
│   ├── init-workspace.sh       # One-time west workspace setup
│   ├── build.sh                # Build firmware (run in Docker)
│   └── flash.sh                # Flash via OpenOCD (run on host)
└── app/
    ├── CMakeLists.txt
    ├── prj.conf
    └── src/
        └── main.c

Zephyr Version

  • Zephyr: v4.4.0
  • Zephyr SDK: 1.0.1
  • Board: rpi_pico/rp2040/w

About

Zephyr RTOS development environment for the Raspberry Pi Pico W with Docker-based builds and SWD debugging via the Raspberry Pi Debug Probe.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors