🛠 Boot sur microSD et eMMC, procédure de recouvrement
Objectives
Understand the Amlogic boot chain on the ODROID-C4 (BL1 in the SoC OTP, proprietary BL2/DDR blob, then U-Boot), install Armbian on microSD, migrate the system to an eMMC module (up to 256 GB, driven in HS200 mode under mainline), and know how to recover from a corrupted card. This is the foundation of any reliable 24/7 deployment.
Hardware
- ODROID-C4 + 12 V/2 A DC jack power supply
- UHS-I microSD card (SDR104 supported) ≥ 16 GB + USB reader
- Optional Hardkernel eMMC module (8 to 256 GB)
- Armbian odroidc4 image (archive.armbian.com/odroidc4), balenaEtcher or
dd - >
Complete code
#!/usr/bin/env bash
# 1) Écrire l'image sur la microSD (périphérique à vérifier !)
zcat Armbian_*_Odroidc4_bookworm_current_*.img.xz | sudo dd of=/dev/sdb bs=4M status=progress conv=fsync
sync
# 2) Démarrer sur SD, puis identifier les stockages
lsblk -o NAME,SIZE,MODEL,MOUNTPOINT # mmcblk0 = eMMC, mmcblk1 = SD (typique)
cat /proc/device-tree/memory@0/reg | xxd | tail -1 # vérifier les 4 GB vus
# 3) Cloner SD -> eMMC (carte NE DOIT PAS être la racine active)
sudo dd if=/dev/mmcblk1 of=/dev/mmcblk0 bs=16M status=progress conv=fsync
sync && sleep 5
# 4) Redémarrer éjecté-SD pour valider le boot eMMC ; en cas d'échec,
# remettre la SD de secours : elle reprend la main (boot de repli).
sudo poweroff
Expected verification
After writing, the blue LED switches from heartbeat mode to a slow blink once the system is up; lsblk shows the root on mmcblk1p2 (SD) and then on mmcblk0p2 after migration. free -h must confirm ~4 GB (or 2 GB depending on SKU) — if only 1 GB is shown, the bootloader did not correct the memory node in the DTS. hdparm -Tt /dev/mmcblk0 compares SD and eMMC (HS200).
Common errors
- Writing the image to
/dev/sdb1instead of the entire disk/dev/sdb: no bootable partition. - Cloning while the source is mounted: copy from a rescue system or use a live USB.
- Believing in HS400 under mainline: the mainline tree limits eMMC to HS200; HS400 only exists in the vendor 4.9 kernel.
- Forgetting the proprietary blob: a mainline U-Boot
odroid-c4_defconfigalone does not boot without the Amlogic FIP BL1/BL2 — stick to Armbian/Hardkernel images which bundle them. - >
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash