l

CM4 Bring-Up Checklist: eMMC Boot, USB Boot, and Recovery Routes

CM4 Bring-Up Checklist: eMMC Boot, USB Boot, and Recovery Routes

During prototyping of our hardware products - Hoomanely EverBowl and EverHub - we leveraged the Raspberry Pi Compute Module 4 (CM4) as the embedded compute platform for early-stage development. The CM4 served as our prototyping vehicle before transitioning to Hoomanely's custom purpose-built System on Module (SOM) for production. The CM4 requires specific initialization procedures to establish reliable boot paths and recovery mechanisms. This article documents the critical bring-up steps we validated during that prototyping phase.

Hardware Configuration

The CM4 IO board includes a J2 jumper header labeled "Fit jumper to disable eMMC boot" . Setting this jumper pulls the nRPIBOOT pin (pin 93) low, forcing the module into USB device mode rather than attempting to boot from eMMC Raspberry Pi.

Key J2 jumper configurations:

  • Pins 1-2 (nRPIBOOT): eMMC disabled, forces USB device boot mode for recovery/flashing
  • Pins 3-4: EEPROM write-protect (prevents bootloader modification)
  • No jumper: Normal boot sequence from configured BOOT_ORDER

eMMC Flashing Procedure

To flash the eMMC, install the J2 jumper on pins 1-2, connect the USB slave micro-USB port to a host computer, apply 12V power to the barrel jack, then run the rpiboot utility . The D1 LED illuminates red but the module won't boot—instead, the eMMC appears as USB mass storage on the host .

# On host machine
git clone https://github.com/raspberrypi/usbboot --depth=1
cd usbboot
make
sudo ./rpiboot
```

After flashing completes, disconnect power and USB, remove the J2 jumper, reconnect power, and the CM4 boots from the freshly-flashed eMMC .

### Boot Order Configuration

The EEPROM stores boot configuration in boot.conf with the BOOT_ORDER parameter (e.g., BOOT_ORDER=0xf25641) specifying boot priority right-to-left . Boot mode values: 1=SD/eMMC, 4=USB-MSD, 5=BCM-USB, 6=NVMe, f=restart .

**The bootloader reads BOOT_ORDER right-to-left (least significant nibble first):**
```
BOOT_ORDER=0xf25641
Actual boot sequence (first attempt → last):
1 = SD/eMMC (rightmost, tried first)
4 = USB-MSD
6 = NVMe
5 = BCM-USB (SoC XHCI)
2 = Network
f = restart (leftmost, tried last)

Example configurations:

  • 0xf25641: Try order is 1→4→6→5→2→f (SD/eMMC first, Network last before restart)
  • 0xf21564: Try order is 6→4→5→1→2→f (NVMe first, Network last before restart)

To modify boot order:

cd usbboot/recovery
# Edit boot.conf, modify BOOT_ORDER line
# Replace pieeprom.original.bin with latest from rpi-eeprom repo
sudo ./rpiboot -d recovery/

A green ACT LED flash indicates successful EEPROM update .

USB Boot Implementation

USB boot via the internal SoC XHCI controller requires boot mode 0x5 in BOOT_ORDER, which wasn't enabled by default in early CM4 modules Raspberry Pi Forums. Modules manufactured after the 2021-01-16 bootloader release include USB boot support by default Raspberry Pi Forums.

Some carrier boards may require enabling USB-related device tree overlays (such as dtoverlay=dwc2 for USB OTG or PCIe initialization overlays) in config.txt, depending on the specific hardware routing and USB controller configuration.

Recovery Mechanism

The nRPIBOOT pin provides hardware-level recovery—when pulled low, the boot ROM enters USB device mode Raspberry Pi. Unlike the Raspberry Pi 4, the CM4 does not read recovery.bin from SD/eMMC. Instead, the host PC actively pushes recovery firmware over USB using the rpiboot utility. The boot ROM is immutable, making the CM4 unbrickable via software corruption Raspberry Pi Forums.

Recovery workflow:

  1. Assert nRPIBOOT (install J2 jumper on pins 1-2)
  2. Connect USB slave port to host computer
  3. Host runs rpiboot which pushes recovery.bin to CM4 over USB
  4. EEPROM firmware update occurs via USB transfer
  5. Remove jumper, reboot to validate

EEPROM write-protection: After finalizing boot configuration, install J2 jumper on pins 3-4 to hardware write-protect the EEPROM, preventing accidental bootloader corruption in production deployments.

Critical Constraints

CM4 modules with eMMC have SD card signals hardwired to the eMMC controller—the SD slot on IO boards cannot be used for booting eMMC variants Stack OverflowRaspberry Pi Forums. Boot from external SD requires USB-SD adapter with modified BOOT_ORDER, or GPIO-conditional boot configuration Raspberry Pi Forums.

Validation Commands

# Check bootloader version
vcgencmd bootloader_version

# View current EEPROM config
rpi-eeprom-config

# Verify boot devices
lsblk

This checklist ensures deterministic boot behavior and robust recovery paths essential for production embedded systems. Boot order verification and recovery testing should be mandatory validation steps before deploying CM4-based products.

Read more