Thanh Le / bench notes
EMBEDDED · BOARD HUB · IN PROGRESS

Allwinner D1-H Nezha (RISC-V C906)

A single-core RISC-V board: my own boot0 on SPI-NAND, FreeRTOS, a webcam on HDMI with no Linux, XR829 Wi-Fi on mainline

Last change2026-11-22: hub page with five STAR write-ups

Allwinner D1-H Nezha (RISC-V C906)

My FreeRTOS OSD over the webcam picture on HDMI

The Nezha is Allwinner’s reference board for the D1-H: one T-Head XuanTie C906 core (RV64GC plus their own pre-1.0 vector extension) at 1008 MHz, a HiFi4 DSP, 1 GiB of DDR3, 256 MB of SPI-NAND, Ethernet, an XR829 for Wi-Fi/BT, HDMI, USB host and a USB-C OTG port. A RISC-V chip with an MMU, a boot ROM with a USB mode, and a public user manual: plenty to dig into.

I started in late September 2026 the boring way: reading Allwinner’s own D1 docs end to end, then plugging in an FTDI cable on the debug UART and checking each claim against what the board actually said. It still ran the stock Tina Linux in NAND. Within a week I was replacing pieces of the boot with my own.

Where it got to: FEL from a shell command with no hand on the button, my own eGON boot0 in NAND block 0 (first an LED from SRAM, then an SPL that trains the DDR3 and loads an app), FreeRTOS on the C906, HDMI and a USB webcam on screen with no Linux, and the XR829 Wi-Fi at 22 Mbit/s on mainline Linux 6.8 booted through my own chain over FEL.

Stock boot chain vs the ones I built Four boot chains: the stock Tina one I found in NAND, then mine. Grey is vendor code, green is mine, blue is upstream I built myself. (No photo of my Nezha yet, so this is the overview.)

The stories

#StoryResultStatus
1 First contact: what the stock Nezha really runs, and which vector it really has
Checking the vendor docs against the board over UART and OTG: RVV 0.7.1 not 1.0, ADB as root, FEL with no button
vl=4 at e32 -> VLEN 128, vsetivli SIGILL (RVV 0.7.1); FEL via reboot efex, no button Done
2 My own boot0 in NAND block 0: an LED from SRAM, then an app in DRAM
Replacing Tina's first stage with an eGON image I build with zig, then a 24 KiB SPL that trains the DDR3 itself
Boot ROM -> my code from NAND, no Tina; my SPL trains 1 GiB of DDR3 in 51 ms Done
3 FreeRTOS on the C906: a 27x cache surprise, and an RTOS that never slept
The generic RISC-V port in M-mode, loaded over FEL; two things only the measurements caught
Task switch 19907 -> 734 cycles with the D-cache on; tick wake-up 0.50 us; idle wfi ~2.5 C cooler Done
4 A USB webcam on HDMI with no Linux: 1080p MJPEG at 29.4 fps on one RISC-V core
HDMI bring-up from FreeRTOS, my own EHCI isochronous driver, and the D1's Video Engine decoding the JPEGs
1920x1080 MJPEG webcam -> HDMI at 29.4 fps, CPU ~1.2 % (YUY2 640x480 first: 29.9 fps, 23 %) Done
5 XR829 Wi-Fi on mainline Linux 6.8: from 2 to 22 Mbit/s, and the culprit was the console
A community port of the vendor driver, booted through my own FEL chain, five bugs before a ping, then one printk
WPA2 + DHCP + TCP on mainline 6.8; PC -> board 2.1 -> 22 Mbit/s once the console went quiet Done

Still open

Wi-Fi from FreeRTOS stops at the scan. SDIO, the firmware download and a passive/active scan work; join, WPA2, DHCP and ping don’t exist yet. The FreeRTOS image is 84 KB, over the 64 KiB app slot my SPL loads from NAND, so it only runs over FEL for now.

The boot chain (my boot0, OpenSBI, U-Boot) also only runs from FEL. Nothing of it is flashed, and it hasn’t booted a real Linux userspace by itself yet (the Wi-Fi work booted Linux 6.8 through it over FEL). I have no current measurement either: the power demos use die temperature as a proxy, and I need a USB-C meter between the supply and the board. And the C906 JTAG pins: I never found the schematic (the sunxi wiki blocked me), so no debugger yet.