🛠 Boot microSD/eMMC et chaîne de démarrage Amlogic
Objectives
Understand and master the proprietary Amlogic boot chain of the ODROID-C2 (signed BL1, FIP, U-Boot), migrate the system from a microSD card to an eMMC module (much faster and more reliable: HS200 bus versus SDR50/SDR100 limited in mainline), and know how to reject a fallback media.
Hardware
- ODROID-C2, microSD + Hardkernel eMMC module (8 to 64 GB)
- Card reader and microSD-to-eMMC adapter (or the card itself)
- Serial console uart_AO 115200 8N1 to monitor the boot
- bl1.bin.hardkernel (hardkernel/u-boot repo, odroidc2-v2015.01 branch) and u-boot.bin.gxbb signed via LibreELEC amlogic-boot-fip (build-fip.sh odroid-c2)
Complete code
# 1) Copie integrale du systeme SD -> eMMC (depuis la carte qui boote sur SD)
sudo dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=16M status=progress conv=fsync
# (mmcblk0 = SD, mmcblk1 = eMMC — verifier avec lsblk avant !)
# 2) Refuser la zone de boot Amlogic sur le nouveau media si besoin :
# BL1 sur les 442 premiers octets, puis secteur 1, U-Boot signe au secteur 97
DEV=/dev/mmcblk1; BL1=bl1.bin.hardkernel
sudo dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
sudo dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
sudo dd if=u-boot.bin.gxbb of=$DEV conv=fsync bs=512 seek=97
sync
# 3) Tete-etre headless : editer boot.ini (images vendor) —
# setenv nographics "1" libere ~300 Mo de RAM
# 4) Redemarrer sur l'eMMC puis mesurer le gain :
sudo dd if=/dev/zero of=test.bin bs=1M count=256 oflag=direct conv=fdatasync && rm test.bin
Expected verification
By removing the microSD card, the board boots alone on the eMMC (visible on the serial console: BL1/FIP/U-Boot then kernel). The dd test goes from a few MB/s on a cheap microSD to 100+ MB/s on an HS200 eMMC. The Amlogic boot ROM always reads BL1 first: without the refused boot area, no media boots.
Common errors
- Inverting mmcblk0/mmcblk1 and dd in one direction or the other: destruction of the source system. Always check lsblk and disk sizes.
- Believing in a 100% free chain: BL1/BL3x are non-redistributable blobs, even mainline U-Boot must be signed (amlogic-boot-fip).
- Forgetting sync before unmounting: corrupted system on eMMC.
- Using old vendor images Ubuntu 16.04/Android 5.1 (kernel 3.14) exposed on the network: old vulnerabilities; prefer Armbian/DietPi/ALARM.
- >
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash