🛠 Démarrer le CM5 sur un SSD NVMe dans le socket M.2 de la CM5IO
Objectives
The M.2 M-key (2230 to 2280) socket on the CM5IO is wired to the BCM2712's PCIe Gen 2 x1 (5 Gb/s) host, and official documentation treats NVMe as a first-class boot device: BOOT_ORDER=0xf6. This tutorial installs the system on NVMe and reprograms the module's EEPROM (BOOT_ORDER=0xf641: NVMe, then SD/eMMC as fallback) via the usbboot recovery flow — the only supported method on Compute Modules, as recovery.bin is never executed from storage.
Hardware
- 1 × CM5 (eMMC or Lite) on a CM5IO Board, running a functional 64-bit Raspberry Pi OS
- 1 × M.2 NVMe SSD (2230–2280) — note that Gen 3 "is possible in some cases but unsupported and potentially unreliable" (datasheet §2.3)
- J2 (nRPI_BOOT) jumper + USB-C cable from slave port J11 to a Linux host PC
- usbboot compiled on the host (
git clone https://github.com/raspberrypi/usbboot)
Complete Code
# --- Côté CM5 : vérifier le SSD puis cloner le système dessus ---
sudo apt install -y nvme-cli git
lsblk | grep nvme # nvme0n1 doit apparaître
sudo nvme list
git clone https://github.com/billw2/rpi-clone && cd rpi-clone
sudo ./rpi-clone -f nvme0n1 # copie boot + rootfs vers le NVMe
# --- Côté hôte : reprogrammer l'EEPROM (module en mode recovery, J2 posé) ---
cd usbboot/recovery
cat > boot.conf <<'EOF'
[All]
BOOT_ORDER=0xf641
EOF
./update-pieeprom.sh
sudo ../rpiboot -d . # écrit l'EEPROM (EEPROM_nWP non verrouillé)
# --- Retour sur le CM5 : retirer J2, alimenter, vérifier la racine NVMe ---
lsblk -o NAME,SIZE,MOUNTPOINT | head
df -h /
Expected Verification
After removing the jumper and rebooting, df -h / and lsblk show the root on /dev/nvme0n1p2; cat /proc/cmdline contains root=/dev/nvme0n1p2; boot remains possible via SD/eMMC fallback if the NVMe is removed (last nibble 1). vcgencmd bootloader_version reflects the new build.
Common Errors
- Expecting Gen 3: The datasheet explicitly marks it as unsupported and potentially unstable — buying a Gen 3 SSD is fine (it will negotiate down to Gen 2), but do not persist with unstable links.
- Relying on
rpi-eeprom-update: Disabled by default on Compute Modules; theself-updatemode is not atomic (power loss = potentially corrupted EEPROM). - Forgetting the J2 jumper during
rpiboot, or leavingeeprom_write_protect=1with the EEPROM_nWP pin active: the write does not occur. - 22110 SSDs or M.2 Wi-Fi cards: The socket accepts 2230–2280 M-key NVMe drives; an A/B key card (Wi-Fi) will simply not be recognized.
Other tutorials for this board
- Alimenter un CM5 comme il faut : USB-C PD 5 V / 5 A et bouton d'alimentation
- La première RTC des Compute Modules : câbler et vérifier la VBAT du CM5
- Accès distant sans VPN : enregistrer un CM5 dans Raspberry Pi Connect
- GPIO du CM5 côté RP1 : force de conduite, budget 50 mA et broches pièges
- Refroidir le CM5 : ventilateur PWM sur le connecteur JST-SH et tachymétrie
- Deux ports USB 3.0 simultanés : le CM5 fait du stockage rapide, pas sur une carte CM4
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash