🛠 Premier démarrage d'un CM4 Lite depuis la microSD de l'IO Board
Objectives
Mount a Compute Module 4 on its IO Board and boot for the first time from the microSD slot — the simplest path when starting with a CM4 Lite (no eMMC). You will mainly learn how to decode a CM4 ordering code (format CM4xyzwww: x = wireless, y = RAM in GB, z = tens of GB of eMMC) and the golden rule of the CM4: a module with eMMC completely ignores the microSD slot, because the eMMC is wired to the primary SD controller.
Hardware
- 1 × Raspberry Pi Compute Module 4 Lite (z=0 in the code, e.g., CM4004000 = no wireless, 4 GB, no eMMC)
- 1 × Official CM4 IO Board (CM4IO, 160 × 90 mm, sold separately — the bare module does not work without it)
- 1 × 12 V power supply on the IO Board's barrel connector (up to 26 V only if PCIe is not used)
- 1 × microSD card 8 GB minimum, 1 HDMI screen + cable, Ethernet cable, PC with Raspberry Pi Imager
Complete Code
On the PC, flash Raspberry Pi OS 64-bit onto the microSD card using Raspberry Pi Imager (pre-setting hostname, SSH, and Wi-Fi is recommended). Ensure that no jumper is on J2 (nRPI_BOOT) — if present, it forces USB device mode and the module will never boot on its own. Insert the SD card, power the IO Board, connect the screen and network, then at the first shell:
# Vérifier que le système est bien sur la microSD et l'identité du module
lsblk -o NAME,SIZE,MOUNTPOINT | head # /dev/mmcblk0p2 monté sur /
cat /proc/device-tree/compatible # attendu : raspberrypi,4-compute-module
vcgencmd versionboot # le bootloader charge bcm2711-rpi-cm4.dtb
dmesg | grep -iE 'mmc|emmc' # mmc0 = microSD ; aucune eMMC sur un Lite
vcgencmd measure_temp # throttle à 85 °C, à surveiller
Expected Verification
lsblk shows the root on /dev/mmcblk0p2; /proc/device-tree/compatible contains raspberrypi,4-compute-module; the ACT LED blinks during boot and then turns off; vcgencmd versionboot mentions the DTB bcm2711-rpi-cm4.dtb (the fallback to bcm2711-rpi-4-b.dtb only occurs if it is missing).
Common Errors
- Non-Lite module believed to boot from SD: a CM4 with eMMC completely ignores the microSD slot — if a valid SD card does not boot, check the SKU (z=0 is mandatory).
- Jumper J2 (nRPI_BOOT) left in place: the module waits for rpiboot on the micro-USB instead of booting.
- Undersized power supply: the 5 V rail must hold > 4.75 V (ideally > 4.9 V) under 2 A, otherwise brownouts and SD corruption occur.
- Confusing CM4 and CM4S: the CM4S (older SODIMM format) has neither PCIe, nor a second HDMI, nor embedded Ethernet.
Other tutorials for this board
- GPIO du CM4 : comprendre les banks 1,8 V / 3,3 V avant de câbler
- Basculer le Wi-Fi du CM4 sur l'antenne externe U.FL (dtparam=ant2)
- Bootloader EEPROM du CM4 : maîtriser BOOT_ORDER via usbboot
- Ajouter une RTC au CM4 (PCF8523 sur I2C1 via dt-blob)
- Son sur CM4 : DAC I2S/PCM (PCM5102) sans prise jack
- Horodatage industriel : PTP IEEE 1588 sur le PHY Ethernet du CM4
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash