🛠 Maîtriser la chaîne de boot SD/eMMC/SPI NOR et le recouvrement
Objectives
Understand and master the specific boot chain of the ODROID-N2: a slide switch SW1 selects between the SPI NOR and eMMC/SD paths; an 8 MB SPI NOR flash (Macronix MX25U6435F) can host mainline U-Boot flashed via flashcp (Armbian procedure, u-boot-spi.bin to /dev/mtd0). The goal: boot from eMMC, keep the SD card as a fallback, and know how to recover a card that no longer boots. Beware of pitfall #1: eMMC pins D4–D7 are shared with the SPI NOR — enabling SPI requires a dedicated DTB (-spi) and the correct SW1 position. Note: no NVMe on N2/N2+ (fast storage relies on removable eMMC or USB 3.0, ~340 MB/s measured).
Hardware
- ODROID-N2/N2+, microSD (fallback) + Hardkernel eMMC module (main system)
- 12 V/2 A power supply; serial console access via the 4-pin debug header (recommended)
- Armbian "server" image written to both media (balenaEtcher or
dd)
Complete code
# 1. Premier boot sur SD (SW1 en position SD/eMMC), puis installation eMMC :
sudo armbian-install -t emmc # copie le système vers l'eMMC
# 2. (Avancé) Flasher U-Boot mainline dans le SPI NOR — ATTENTION :
# il faut le DTB « -spi » (bus 4 bits) ET SW1 en position SPI.
sudo apt install mtd-utils
fdtget /boot/dtb/amlogic/*.dtb / compatible # vérifier le DTB actif
cat <<'EOF' | sudo tee /boot/armbianEnv.txt
fdtfile=amlogic/meson-g12b-odroid-n2-plus-spi.dtb
EOF
sudo flashcp -v u-boot-spi.bin /dev/mtd0
# 3. Recouvrement : SD de secours insérée, SW1 côté SD/eMMC, alimenter.
# Si l'eMMC est corrompue : booter la SD puis réécrire l'eMMC.
sudo dd if=Armbian.img of=/dev/mmcblk1 bs=4M status=progress oflag=sync
Expected verification
After armbian-install, remove the SD card and reboot: the board should boot from the eMMC (check lsblk — / on mmcblk1 or equivalent). With U-Boot in the SPI NOR and SW1 set to the SPI side, the serial console displays the U-Boot banner even before reading the SD card. Recovery works: with the fallback SD card, the board reboots regardless of the eMMC state.
Common errors
- Forgetting that SW1 takes precedence: wrong position = the board sees neither eMMC nor SPI, black screen.
- Enabling SPI without the
-spiDTB: eMMC/SPI pin conflict, eMMC unreadable (known issue #1 on this board). - Confusing N2 and N2+: U-Boot reports
n2_plusbut the kernel expectsn2-plus— Armbian patches this, third-party images may fail to boot. - Removing the eMMC while powered on: the module is removable but not hot-pluggable.
- Android image with mainline U-Boot: Android images require the vendor Amlogic bootloader, do not mix them.
- >
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash