🛠 Flasher l'eMMC d'un CM3 par USB avec rpiboot
Objectives
Write a system image directly to the 4 GB soldered eMMC of a CM3, without an SD card. The BCM2837 has no bootloader EEPROM: at power-on, it looks for bootcode.bin on the eMMC, and if that fails, it waits for boot code over USB. By connecting EMMC_DISABLE_N to ground, you physically disconnect the eMMC (SDCMD pin) and force this USB device mode, where the module enumerates as a USB mass storage device controlled by rpiboot (official raspberrypi/usbboot repository).
Hardware
- CM3 (with eMMC; the CM3 Lite does not have one and is programmed via SD) on a CMIO3
- Micro-USB cable between the CMIO3's USB slave port and a Linux PC (or another Pi)
- EMMC_DISABLE_N jumper placed on the CMIO3 (eMMC-disable jumper)
- 32-bit Raspberry Pi OS image (armhf, Pi 3 branch)
Complete Code
# Sur le PC hôte (Linux) :
git clone https://github.com/raspberrypi/usbboot
cd usbboot && make && sudo ./rpiboot # le CM3 apparaît comme disque USB
lsblk # repérer le périphérique, p. ex. /dev/sdb
lsblk /dev/sdb # vérifier la taille (~4 Go pour un CM3)
sudo dd bs=4M conv=fsync status=progress \
if=2024-xx-xx-raspios-bookworm-armhf.img of=/dev/sdb
sync
Remove the EMMC_DISABLE_N jumper, power on again: the module boots from its eMMC. The firmware reactivates the eMMC via EMMC_EN_N_1V8 during USB programming (datasheet §8).
Expected Verification
After sudo ./rpiboot, lsblk shows a new disk of approximately 4 GB; after dd and rebooting without the jumper, the Raspberry Pi OS desktop appears on HDMI and lsblk on the CM3 shows the root filesystem on /dev/mmcblk0.
Common Errors
- Writing to the wrong disk (
/dev/sda= the PC's disk!): always check the size withlsblkbefore dd. - Forgetting to remove the EMMC_DISABLE_N jumper after flashing: the module requests USB boot again instead of booting from eMMC.
- Expecting a BOOT_ORDER like on CM4/Pi 4: the CM3 has no EEPROM, the boot order is hardcoded in silicon — USB forcing is purely hardware-based.
- Switching to USB boot costs ~2 s of eMMC timeout after power-on: this is normal, wait a few seconds before plugging in the cable.
- Trying to flash a CM3 Lite this way: without eMMC, there is nothing to flash — write an SD card instead.
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash