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) andf101_evb(the F101 evaluation board, console on UART3 at PE08/PE09). - Toolchain: XuanTie 900 elf-newlib GCC, integrated through the
cross-compilevariant, without using the Zephyr SDK. - Build: west manages the source and dependency modules, and
west buildcompiles.
Where to start
Section titled “Where to start”Read the following three pages in order and you can get a program running on the board:
| Step | Description |
|---|---|
| Set up the development environment | Host dependencies, Python virtual environment, west, the XuanTie toolchain, env.sh |
| Get the Zephyr source | west init / west update, directory structure, Python dependencies, building hello_world to verify |
| Build and run | Three ways to run: download to RAM, xfel direct NOR write, UF2 drag-and-drop download |
Other pages:
| Page | Description |
|---|---|
| MP4 player | Play MP4 from a TF card: H.264 hardware decode + AAC software decode |
| ncnn - neural-network inference | ncnn inference library + RVV, benchmark |
| Doom - game | doomgeneric, touch-screen buttons |
| mGBA - GBA emulator | Scaled output, touch-screen buttons, sound |
| NES - FC emulator | nofrendo, touch-screen buttons |
| HTML renderer - litehtml | Renders HTML/CSS to RGB565 |
| Android screen mirroring | ADB + scrcpy, H.264 hardware decode |
| iOS screen mirroring - AirPlay | AirPlay receiver, H.264 hardware decode |
| Win95 - Bochs x86 emulation | Bochs 486 emulator |
| LVGL - graphical UI | Display and touch integration, demo and frame rate |
| USB secondary display - PC extended screen | Use the computer’s USB port as a secondary screen |
| UF2 drag-and-drop flashing | Creating .uf2 files and the Flash layout |
| RVV - RISC-V vector extension | Configuration, 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):
| Page | Description |
|---|---|
| GPIO | Input and output, whole-port operations, interrupts |
| I2C | Read and write, repeated start, bus scan |
| SPI | Command plus data, full duplex, DMA, modes |
| PWM | Period and duty cycle, polarity, devicetree references |
| PWM-BL - analog backlight | Backlight-specific module, brightness adjusted by current sinking |
| Display | Pipeline, adapting RGB and MIPI DSI panels, display interfaces |
| SDHC host controller | Operate the controller directly with SD commands |
| AUDIO - audio | On-chip codec, I2S0, S/PDIF |
| UART | Polling, interrupts, configuration |
| USB | CherryUSB device mode, CDC ACM echo |
| G2D 2D accelerator | Fill, blit, rotate, YUV, blend |
| Video engine vdec | JPEG, 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):
| Page | Description |
|---|---|
| CherryUSB - USB protocol stack | Device stack, host stack, CDC ACM, MSC |
| SD - SD card protocol stack | SD subsystem, disk access, FAT filesystem |
| AIC8800 WIFI - wireless adapter driver | SDIO, firmware download, scan, connect |
| AIC8800 Bluetooth - Bluetooth driver | HCI, advertising, scan, connect |
| AAC - AAC decoder | OpenCORE AAC decoding |
| MP4 - MP4 demuxing | moov parsing, sample reading, seek |
Driver support
Section titled “Driver support”The drivers are written to Zephyr’s own APIs, and the devicetree bindings are in dts/bindings/*/allwinner,sunxi-*.yaml.
| Category | Description |
|---|---|
| Basics | Clocks and reset, pinctrl, GPIO, DMA, watchdog, hwinfo (SID fuses), CPU clock frequency |
| Buses | I2C, SPI, PWM (including panel backlight), ADC, SD/MMC (sdhc) |
| Flash | SPIF SPI NOR controller: 100 MHz quad read, saved sampling-point parameters, XIP window and XIP code section |
| Audio | On-chip codec (DAC/ADC and the analog part), I2S0, S/PDIF |
| Display | Layers, TCON, RGB/LVDS/DSI encoders, D-PHY, backlight, YUV/RGB scaling video layer, MIPI DBI |
| Accelerators | G2D 2D accelerator (fill, blit with format conversion/scaling/rotation, blend); video engine (H.264, JPEG, PNG decoding) |
| USB | PHY, CherryUSB device (CDC ACM, MSC, vendor display class) and host (EHCI/OHCI) |
| Input | GT967 capacitive touch |
| RISC-V | Vector-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.