🛠 Booter sur un SSD NVMe et récupérer une carte bloquée (MaskROM)
Objectives
Install the system on an NVMe SSD in the M.2 M-Key slot (the RK3566 boots via a small loader written to the 16/32 MB SPI NOR, while the rootfs remains on the SSD) and know how to restore the board to MaskROM mode if the bootloader is corrupted.
Hardware
- Orange Pi 3B (2/4/8 GB), M.2 2280/2242 SSD — the slot is electrically PCIe 2.0/2.1 x1, capped at ~500 MB/s theoretical throughput: an entry-level SSD is sufficient
- 5 V / 3 A power supply, microSD card for initial boot, USB-C data cable
- Windows PC with RKDevTool (or
rkdeveloptoolon Linux) for MaskROM mode (MaskROM button present on the board)
Complete code
# 1. Depuis Armbian sur microSD : vérifier que le kernel voit le SSD (slot &pcie2x1 activé)
sudo fdisk -l | grep nvme # attendu : /dev/nvme0n1
sudo dmesg | grep -i "pci.*link.*Gen" # attendu : "2.5 GT/s PCIe" (Gen2 x1)
# 2. Benchmark de cohérence (attendu ~300-450 MB/s, pas 3000+)
sudo apt install fio
fio --name=nvme --rw=write --bs=1M --size=256M --numjobs=1 --direct=1 \
--filename=/mnt/ssd/testfile --runtime=30 --group_reporting
# 3. Copier le système en cours sur le SSD (écrit le chargeur en SPI NOR puis le rootfs en NVMe)
sudo apt install armbian-config
sudo armbian-install # cible "NVMe", puis redémarrer sans la microSD
# 4. Recouvrement : carte qui ne boote plus
# Éteindre -> maintenir la touche MaskROM -> brancher l'USB-C vers le PC -> RKDevTool
# détecte « Found OneDevice » (USB 2.0 device) : réécrire mini-loader / uboot puis
# effacer la SPI NOR, ou reflasher eMMC, puis rebooter sur microSD propre.
Expected verification
After armbian-install and rebooting without the microSD card: lsblk shows / on /dev/nvme0n1, uname -a starts, and the boot follows the RK3566 ROM order: SPI flash → eMMC → microSD → USB. In MaskROM mode, lsusb (Linux) lists a "Rockchip USB Peripheral" device.
Common errors
- Expecting 3 GB/s: the slot is limited to PCIe 2.1 x1 (~500 MB/s theoretical, official wiki §2.6).
- Old Armbian images: separate NVMe/SATA U-Boot builds were required, and an overlay prefix bug broke one or the other (armbian/build#10896) — update.
- Confusing revisions v1.1/v2.1 for the device tree: Ethernet/Wi-Fi may fail after cloning.
- Using a SATA SSD in a slot wired for NVMe (the slot is switchable between SATA/PCIe, check the setting) or missing mounting screw: intermittent contact in Gen2.
- Forgetting the MaskROM button: without it, a corrupted bootloader in the SPI NOR cannot be rewritten via USB.
Other tutorials for this board
- Faire clignoter une LED via le GPIO avec libgpiod
- Lire un bouton poussoir et afficher l'état dans la console
- Premier script Python : bouton + LED avec python3-libgpiod
- Variation d'intensité d'une LED avec un signal PWM
- Interroger un capteur I2C sur les broches 3/5 du connecteur
- Configurer Ethernet gigabit et Wi-Fi puis se connecter en SSH
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash