🛠 Débriquage FEL/xfel et boot SPI NOR sur le Lichee RV Dock
Objectives
When the microSD card is dead or the bootloader is corrupted, the D1 remains recoverable thanks to the Allwinner BROM: by holding the FEL button on the Dock and powering the module via USB-C, the chip waits for an FEL tool. The open-source utility xfel (xboot/xfel) speaks this protocol: read the chip ID, send an SPL+OpenSBI+U-Boot to DRAM, and start without touching the storage — the emergency door for rebriking the board, but also the production path: the Dock embeds an SPI NOR chip (SOP8 footprint) and the module has SD-NAND pads, for autonomous boot without a card. This tutorial covers both.
Hardware
- Lichee RV Dock (FEL button on the daughterboard) + USB-A to USB-C cable (never C-to-C)
- Linux PC with xfel compiled (
git clone https://github.com/xboot/xfel && cd xfel && make && sudo make install) - For SPI: 3.3 V SPI NOR flash (e.g., 16 MB) soldered onto the Dock's SOP8 footprint, or an existing chip to reprogram
- Serial console useful for following the U-Boot phase
Complete Code
# 1) Entrer en FEL : maintenir FEL, brancher l'USB-C, relâcher
lsusb | grep -i '1f3a:efe' # Allwinner FEL (1f3a = sunxi)
sudo xfel version # version du BROM détectée
sudo xfel sid # ID unique de la puce
# 2) Démarrer un SPL en RAM sans toucher au stockage (ex. image Buildroot) :
sudo xfel write 0x200000 u-boot-sunxi-with-spl.bin # adresse SPL D1
sudo xfel exec 0x200000 # saute dedans
# -> U-Boot démarre sur la série, peut booter un kernel depuis l'USB/TFTP
# 3) Reprogrammer le SPI NOR (puce soudée sur l'empreinte SOP8 du Dock) :
sudo xfel spiflash id # la NOR répond ?
sudo xfel spiflash erase 0 -l $((16*1024*1024))
sudo xfel spiflash write 0 u-boot-sunxi-with-spl.bin
# puis retirer le mode FEL : le BROM boote le SPL SPI quand la microSD est absente
# 4) Dépannage bas niveau :
sudo xfel read 0x4100000 64 -o dram.bin # lire la DRAM (test)
sudo xfel help spiflash
Expected Verification
By holding FEL during power-up, lsusb shows a 1f3a:efe8 device (BROM FEL) and sudo xfel version displays the BROM version — proof that the USB link is alive even on a "bricked" board. xfel write + xfel exec start U-Boot, visible on the serial console. After SPI programming and removing the microSD card, the board restarts alone on the NOR SPL: boot continues without a card, validating a setup without an accessible slot.
Common Errors
- C-to-C cable: the BROM will never respond in FEL either (hardware CC trap of the module, documented by Sipeed).
- USB permissions: without a udev rule, run
sudo xfel; otherwise add the rule for 1f3a:efe8. - Wrong SPL execution address on D1: the SRAM/DRAM address expected by the D1 BROM is specific (0x200000 in xboot examples); follow the xfel README for sun20i.
- NOR SPI not soldered: the Dock often ships with only the empty SOP8 FOOTPRINT — check visually before
spiflash id, which fails otherwise. - Powering from the PC during SPI flash: current spikes from flash + Wi-Fi cause brownouts on some USB ports; use a powered hub if write errors appear.
- Waiting for FEL mode without holding the button: the BROM stays in FEL only if the pin is held at boot (hence the Dock's dedicated button).
Other tutorials for this board
- Premier boot du Lichee RV Dock avec Ubuntu 24.04 RISC-V
- LEDs du Lichee RV Dock : LED verte et RGB WS2812 pilotée par le LEDC du D1
- Audio sur le Dock : enregistrer au micro numérique et jouer sur le haut-parleur 3 W
- Wi-Fi et Bluetooth du module RTL8723DS sur le Lichee RV Dock
- GPIO, touche utilisateur ADC et PWM sur le connecteur 2×20 du Lichee RV
- Tina Linux : l'OpenWrt vendor d'Allwinner pour le Lichee RV, installation et sysconfig
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash