Skip to content

Zephyr development

Zephyr is an open-source real-time operating system (RTOS) for resource-constrained devices. The F101 Zephyr support is a fork of upstream Zephyr: YuzukiHD/zephyr, default branch zephyr-v4.2.2-f101, based on Zephyr v4.2.2.

  • SoC: sun252i_f101, one XuanTie C907 core (rv32imafdcv, with the vector extension and an optional Sv32 MMU), on-chip SRAM plus 16 MB PSRAM, with no external DDR.
  • Board support: yuzukineko (this board, console on UART1 at PB00/PB01) and f101_evb (the F101 evaluation board, console on UART3 at PE08/PE09).
  • Toolchain: XuanTie 900 elf-newlib GCC, integrated through the cross-compile variant, without using the Zephyr SDK.
  • Build: west manages the source and dependency modules, and west build compiles.

Read the following three pages in order and you can get a program running on the board:

StepDescription
Set up the development environmentHost dependencies, Python virtual environment, west, the XuanTie toolchain, env.sh
Get the Zephyr sourcewest init / west update, directory structure, Python dependencies, building hello_world to verify
Build and runThree ways to run: download to RAM, xfel direct NOR write, UF2 drag-and-drop download

Other pages:

PageDescription
MP4 playerPlay MP4 from a TF card: H.264 hardware decode + AAC software decode
ncnn - neural-network inferencencnn inference library + RVV, benchmark
Doom - gamedoomgeneric, touch-screen buttons
mGBA - GBA emulatorScaled output, touch-screen buttons, sound
NES - FC emulatornofrendo, touch-screen buttons
HTML renderer - litehtmlRenders HTML/CSS to RGB565
Android screen mirroringADB + scrcpy, H.264 hardware decode
iOS screen mirroring - AirPlayAirPlay receiver, H.264 hardware decode
Win95 - Bochs x86 emulationBochs 486 emulator
LVGL - graphical UIDisplay and touch integration, demo and frame rate
USB secondary display - PC extended screenUse the computer’s USB port as a secondary screen
UF2 drag-and-drop flashingCreating .uf2 files and the Flash layout
RVV - RISC-V vector extensionConfiguration, interfaces and examples of the vector extension

Driver pages (each has a devicetree, Kconfig, one complete example per interface, board output and a full demo program):

PageDescription
GPIOInput and output, whole-port operations, interrupts
I2CRead and write, repeated start, bus scan
SPICommand plus data, full duplex, DMA, modes
PWMPeriod and duty cycle, polarity, devicetree references
PWM-BL - analog backlightBacklight-specific module, brightness adjusted by current sinking
DisplayPipeline, adapting RGB and MIPI DSI panels, display interfaces
SDHC host controllerOperate the controller directly with SD commands
AUDIO - audioOn-chip codec, I2S0, S/PDIF
UARTPolling, interrupts, configuration
USBCherryUSB device mode, CDC ACM echo
G2D 2D acceleratorFill, blit, rotate, YUV, blend
Video engine vdecJPEG, PNG, MJPEG, H.264 decoding

Component pages (the same specification, covering protocol stacks and libraries; each has an architecture diagram, a data-flow diagram and board logs):

PageDescription
CherryUSB - USB protocol stackDevice stack, host stack, CDC ACM, MSC
SD - SD card protocol stackSD subsystem, disk access, FAT filesystem
AIC8800 WIFI - wireless adapter driverSDIO, firmware download, scan, connect
AIC8800 Bluetooth - Bluetooth driverHCI, advertising, scan, connect
AAC - AAC decoderOpenCORE AAC decoding
MP4 - MP4 demuxingmoov parsing, sample reading, seek

The drivers are written to Zephyr’s own APIs, and the devicetree bindings are in dts/bindings/*/allwinner,sunxi-*.yaml.

CategoryDescription
BasicsClocks and reset, pinctrl, GPIO, DMA, watchdog, hwinfo (SID fuses), CPU clock frequency
BusesI2C, SPI, PWM (including panel backlight), ADC, SD/MMC (sdhc)
FlashSPIF SPI NOR controller: 100 MHz quad read, saved sampling-point parameters, XIP window and XIP code section
AudioOn-chip codec (DAC/ADC and the analog part), I2S0, S/PDIF
DisplayLayers, TCON, RGB/LVDS/DSI encoders, D-PHY, backlight, YUV/RGB scaling video layer, MIPI DBI
AcceleratorsG2D 2D accelerator (fill, blit with format conversion/scaling/rotation, blend); video engine (H.264, JPEG, PNG decoding)
USBPHY, CherryUSB device (CDC ACM, MSC, vendor display class) and host (EHCI/OHCI)
InputGT967 capacitive touch
RISC-VVector-extension context save, machine-mode Sv32 MMU with demand paging, lib/mp4, AAC decoding

The SoC code is in soc/allwinner/sun252i_f101, the SoC devicetree is in dts/riscv/allwinner/sun252i_f101.dtsi, and the board support is in boards/yuzukihd.