A Compute Module with eMMC has no SD card to swap. rpiboot from raspberrypi/usbboot solves this: it loads software into the target over USB, and by default makes the target appear to the host as a USB drive. You then write an image with Raspberry Pi Imager as with an SD card.
Two boot images
| Image | Devices | Notes |
|---|---|---|
mass-storage-gadget (Linux-based) |
Zero 2 W, 3A+, CM3/3+/3E, Pi 4B*, CM4/4S, 400*, Pi 5, 500*, 500+, CM5 | exposes SD/eMMC, NVMe and USB; console login on UART and USB serial; fast writes |
legacy msd firmware |
Pi 1A+, CM1, Zero (and Pi 4 and older) | SD/eMMC only, no console, much slower writes |
* requires rpiboot to be enabled first (see below).
Put the target into rpiboot mode
| Device | How |
|---|---|
| Compute Module 3 | fit EMMC-DISABLE on the IO board before powering on |
| Compute Module 4 | fit EMMC-DISABLE / nRPIBOOT (GPIO 40) |
| Compute Module 5 | fit EMMC-DISABLE / nRPIBOOT (BCM2712 GPIO 20) |
| Pi 5 / 500 / 500+ | remove power, hold the power button, then connect USB-C from the host (a shutdown isn't enough) |
| Pi 4B / 400 | no jumper: select an nRPIBOOT GPIO with make-pi4-rpiboot-gpio-sd. This permanently programs OTP and cannot be changed; the chosen GPIO must never be pulled low by a HAT unless you want rpiboot |
Run it
sudo apt install rpiboot # Raspberry Pi OS package
sudo rpiboot -d mass-storage-gadget
# the target's storage now appears as a USB drive: write the image with Raspberry Pi Imager
The README recommends a Raspberry Pi 4 or 5 as host, a powered USB hub and short, high-quality cables.
More than flashing
recovery/recovery5directories: update the bootloader EEPROM on CM4 / Pi 5 (the recommended path for CM4, whererpi-eeprom-updateis disabled by default).rpiboot -j metadatawrites each device's OTP metadata (MAC address, board revision, EEPROM hash, …) as JSON, which is useful for manufacturing records.secure-boot-recovery/secure-boot-recovery5: secure boot provisioning (see the secure boot item before touching it; it's irreversible).