Containerised Zephyr RTOS build environment for the Raspberry Pi Pico W, with SWD flashing via the Raspberry Pi Debug Probe.
| Platform | Build | Flash | Serial |
|---|---|---|---|
| macOS Intel | ✅ | ✅ | ✅ |
| macOS Apple Silicon | ✅ | ✅ | |
| Linux (Ubuntu/Debian) | ✅ | ✅ | ✅ |
| Windows (WSL2) |
- Raspberry Pi Pico W (target)
- Raspberry Pi Debug Probe
- USB-C cable (debug probe)
- USB-Micro or USB-C cable (Pico W power, optional)
Refer to the official Debug Probe documentation for the SWD and UART pinout.
brew install openocdInstall Docker Desktop for Mac
sudo apt install openocdAdd yourself to the dialout group for serial access:
sudo usermod -aG dialout $USERUse WSL2 with Docker Desktop. Flash and serial steps require additional setup — see the OpenOCD Windows guide.
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 build2. 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.shBuild
docker compose run zephyr ./scripts/build.shOutput: app/build/zephyr/zephyr.elf
Flash (run on host, not in Docker)
./scripts/flash.shSerial monitor
macOS:
ls /dev/tty.usbmodem*
screen /dev/tty.usbmodem* 115200Linux:
ls /dev/ttyACM*
screen /dev/ttyACM0 115200Exit screen with Ctrl-A then K, then y to confirm.
.
├── 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:
v4.4.0 - Zephyr SDK:
1.0.1 - Board:
rpi_pico/rp2040/w