🛠 Maîtriser la chaîne de boot SD/eMMC/SPI NOR et le recouvrement

ODROID-N2 / ODROID-N2+ (Hardkernel) · avance · Schéma : IMG-odroid-n2-avance-1-odroidn2-boot-emmc-spi-recouvrement.svg — Chaîne de boot de l'ODROID-N2 : interrupteur SW1, flash SPI NOR 8 Mo, connecteur eMMC amovible et microSD, avec la procédure de recouvrement mise en évidence.

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

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

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials