Modern Yocto/OpenEmbedded build system for Luckfox Pico boards based on Rockchip RV1106 SoC. This project provides a clean, maintainable alternative to the vendor SDK with full integration into the Yocto ecosystem.
- β Yocto Walnascar (5.1) - Latest stable Yocto release
- β Multiple Boot Media - eMMC (tested β), SD card (tested β), SPI NAND (tested β) with SDK-compatible partition layouts
- β A/B Dual Boot System - Automatic rollback after 3 boot failures with A/B partitions for OTA updates
- β FIT Boot Images - Flattened Image Tree format with kernel, DTB, and ramdisk
- β U-Boot Integration - Custom bootloader with environment configuration and A/B slot management
- β WiFi Drivers - AIC8800DC wireless support with utilities (iw, wpa-supplicant)
- β
Complete Disk Images - Ready-to-flash
.imgfiles for all boot media - β UBI/UBIFS Support - Full UBI/UBIFS implementation for SPI NAND flash
- β SDK Compatibility - Partition layout compatible with Luckfox SDK format
- β USB Gadget Support - Serial console (ttyGS0) and Ethernet over USB (RNDIS)
- β Userdata Partition - Persistent storage partition with auto-format and resize on first boot
- β Python3 Support - Full Python3 environment in luckfox-image-full
- β Self-Contained Build - Toolchain automatically fetched from git, no external dependencies
- OS: Ubuntu 22.04 LTS or Debian 12 (other distros may work)
- Disk Space: At least 100GB free space
- RAM: 8GB minimum, 16GB+ recommended
- CPU: Multi-core processor recommended for faster builds
- Ubuntu 22.04 LTS (Recommended)
- Debian 12 (Bookworm)
- Fedora 38+
- openSUSE Leap 15.4+
sudo apt update
sudo apt install -y gawk wget git diffstat unzip texinfo gcc build-essential \
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils \
debianutils iputils-ping python3-git python3-jinja2 python3-subunit \
mesa-common-dev zstd liblz4-tool file locales libacl1 \
gcc-multilib g++-multilib
# Generate required locale
sudo locale-gen en_US.UTF-8sudo dnf install -y gawk make wget tar bzip2 gzip python3 unzip perl patch \
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue \
python3-GitPython python3-jinja2 python3-pexpect xz which SDL-devel \
zstd lz4 file hostname rpcgen# Create workspace directory
mkdir -p ~/luckfox-workspace/yocto-walnascar
cd ~/luckfox-workspace/yocto-walnascar
# Clone Yocto Poky (Walnascar)
git clone -b walnascar https://github.com/yoctoproject/poky.git
# Clone meta-openembedded
git clone -b walnascar https://github.com/openembedded/meta-openembedded.git# Clone this repository
cd ~/luckfox-workspace
git clone https://github.com/zavdimka/luckfox-pico-yocto.gitYour directory structure should now look like:
~/luckfox-workspace/
βββ luckfox-pico-yocto/ # This meta-layer
βββ yocto-walnascar/
βββ poky/ # Yocto Poky (core)
βββ meta-openembedded/ # Additional OE layers
# Source the Yocto build environment
cd ~/luckfox-workspace/luckfox-pico-yocto
source ../yocto-walnascar/poky/oe-init-build-env ../yocto-walnascar/build-luckfox
# You should now be in ~/luckfox-workspace/yocto-walnascar/build-luckfoxThis creates the build directory and initial configuration files.
You need to add the Luckfox layer and configure the build. Edit conf/bblayers.conf:
nano conf/bblayers.confAdd the luckfox-pico-yocto and meta-oe layers (use your actual paths):
BBLAYERS ?= " \
/home/<username>/luckfox-workspace/yocto-walnascar/poky/meta \
/home/<username>/luckfox-workspace/yocto-walnascar/poky/meta-poky \
/home/<username>/luckfox-workspace/yocto-walnascar/poky/meta-yocto-bsp \
/home/<username>/luckfox-workspace/yocto-walnascar/meta-openembedded/meta-oe \
/home/<username>/luckfox-workspace/luckfox-pico-yocto \
"Then edit conf/local.conf to set the machine and distro:
nano conf/local.confAdd or modify these lines:
MACHINE ?= "luckfox-pico" # Or luckfox-pico-sd or luckfox-pico-spi-nand
DISTRO ?= "luckfox"Note: You can override MACHINE at build time without editing local.conf:
# Default (eMMC)
bitbake luckfox-image-minimal
# SD card
MACHINE=luckfox-pico-sd bitbake luckfox-image-minimal
# SPI NAND
MACHINE=luckfox-pico-spi-nand bitbake luckfox-image-minimal# Build minimal bootable image (~30-60 minutes on modern hardware)
bitbake luckfox-image-minimal# Build image with development tools and utilities
bitbake luckfox-image-fullAfter successful build, images will be in:
~/luckfox-workspace/yocto-walnascar/build-luckfox/tmp/deploy/images/<machine-name>/
Where <machine-name> is:
luckfox-picofor eMMC buildsluckfox-pico-sdfor SD card buildsluckfox-pico-spi-nandfor SPI NAND builds
The main image file is: luckfox-image-minimal-<machine-name>.img
# Navigate to the images directory
cd ~/luckfox-workspace/yocto-walnascar/build-luckfox/tmp/deploy/images/luckfox-pico-sd/
# Find your SD card device (BE CAREFUL!)
lsblk
# Flash the image (replace /dev/sdX with your SD card device)
sudo dd if=luckfox-image-minimal-luckfox-pico-sd.img of=/dev/sdX bs=4M status=progress conv=fsync
sudo sync
# Safely remove the SD card
sudo eject /dev/sdXUse win32diskimager :
- Download and install win32diskimager
- Select the
.imgfile - Select your SD card
- Click "Write"
For eMMC and SPI NAND, you need to use Rockchip upgrade_tool. The board must be in MaskROM mode.
-
Install Rockchip upgrade_tool
Download from Luckfox Github:
- Linux:
upgrade_tool(Linux version) - Windows:
upgrade_tool.exe(Windows version)
Both use the same commands (just add
.exeon Windows). - Linux:
-
Put Board in MaskROM Mode
- Power off the board
- Short the MaskROM pins (or hold BOOT button if available)
- Connect USB cable to PC
- Power on the board
- Release the short/button after 2 seconds
-
Verify Connection
# Linux lsusb | grep Rockchip # Should show: Bus XXX Device XXX: ID 2207:110b Fuzhou Rockchip Electronics Company # Check with upgrade_tool sudo upgrade_tool ld # Linux upgrade_tool.exe ld # Windows # Should show: Found one MASKROM device
Navigate to your build images directory:
# Linux
cd ~/luckfox-workspace/yocto-walnascar/build-luckfox/tmp/deploy/images/<machine-name>/
Where `<machine-name>` is `luckfox-pico` (eMMC) or `luckfox-pico-spi-nand` (SPI NAND).
**Step 1: Upload bootloader**
```bash
# Linux
sudo upgrade_tool db download.bin
# Windows
upgrade_tool.exe db download.binThe download.bin is the MiniLoaderAll bootloader (find in your SDK or build output).
Step 2: Erase flash (SPI NAND only)
For SPI NAND flash, erase before first flash or after partition changes:
# For 128MB SPI NAND flash
sudo upgrade_tool EL 0 8000000 # Linux
upgrade_tool.exe EL 0 8000000 # Windows
# For 256MB SPI NAND flash
sudo upgrade_tool EL 0 10000000 # Linux
upgrade_tool.exe EL 0 10000000 # WindowsSkip this step for eMMC - erasing eMMC is not necessary and may take a very long time.
Step 3: Write the image
# Linux - eMMC
sudo upgrade_tool wl 0 luckfox-image-minimal-luckfox-pico.img
# Linux - SPI NAND
sudo upgrade_tool wl 0 luckfox-image-minimal-luckfox-pico-spi-nand.img
# Windows - eMMC
upgrade_tool.exe wl 0 luckfox-image-minimal-luckfox-pico.img
# Windows - SPI NAND
upgrade_tool.exe wl 0 luckfox-image-minimal-luckfox-pico-spi-nand.imgStep 4: Reset the device
# Linux
sudo upgrade_tool rd
# Windows
upgrade_tool.exe rdThe device will reboot automatically.
# Linux
cd ~/luckfox-workspace/yocto-walnascar/build-luckfox/tmp/deploy/images/luckfox-pico/
sudo upgrade_tool db download.bin
sudo upgrade_tool wl 0 luckfox-image-minimal-luckfox-pico.img
sudo upgrade_tool rd
# Windows
cd C:\path\to\images\luckfox-pico\
upgrade_tool.exe db download.bin
upgrade_tool.exe wl 0 luckfox-image-minimal-luckfox-pico.img
upgrade_tool.exe rd# Linux
cd ~/luckfox-workspace/yocto-walnascar/build-luckfox/tmp/deploy/images/luckfox-pico-spi-nand/
sudo upgrade_tool db download.bin
sudo upgrade_tool EL 0 10000000
sudo upgrade_tool wl 0 luckfox-image-minimal-luckfox-pico-spi-nand.img
sudo upgrade_tool rd
# Windows
cd C:\path\to\images\luckfox-pico-spi-nand\
upgrade_tool.exe db download.bin
upgrade_tool.exe EL 0 10000000
upgrade_tool.exe wl 0 luckfox-image-minimal-luckfox-pico-spi-nand.img
upgrade_tool.exe rdAfter flashing:
- Power cycle the board (disconnect and reconnect power)
- Connect to serial console (115200 8N1):
- USB serial:
/dev/ttyUSB0(Linux) orCOMx(Windows) - After boot:
/dev/ttyGS0(USB gadget serial console)
- USB serial:
- Login:
- Username:
root - Password: (none - press Enter)
- Username:
- Check boot:
# Check kernel version uname -a # Check mounted filesystems mount # Check storage df -h
The system provides multiple serial console options:
- ttyFIQ0: Debug serial port (hardware UART, 115200 8N1)
- ttyGS0: USB gadget serial console (USB ACM, appears after boot)
To connect via USB gadget serial (after boot):
# Linux
sudo minicom -D /dev/ttyACM0 -b 115200
# Or using screen
sudo screen /dev/ttyACM0 115200
# Windows: Use PuTTY, TeraTerm, or similarluckfox-pico-yocto/
βββ conf/
β βββ layer.conf # Layer configuration
β βββ bblayers.conf # Build layers configuration
β βββ local.conf # Local build settings
β βββ distro/ # Distribution configs
β βββ machine/
β βββ luckfox-pico.conf # eMMC machine config
β βββ luckfox-pico-sd.conf # SD card machine config
β βββ luckfox-pico-spi-nand.conf # SPI NAND machine config
βββ classes/
β βββ luckfox-ext-toolchain.bbclass # External toolchain support
β βββ rockchip-disk.bbclass # Disk image creation
β βββ rockchip-partition.bbclass # Partition layout parser
βββ recipes-kernel/
β βββ linux/ # Linux kernel 5.10.160
β β βββ linux-luckfox_5.10.160.bb # Kernel recipe
β β βββ linux-luckfox_5.10.160.bbappend # FIT image support
β β βββ files/ # Kernel configs & DTS files
β βββ aic8800dc/ # AIC8800DC WiFi driver
β βββ make-mod-scripts/ # Kernel module build support
βββ recipes-bsp/
β βββ u-boot/
β βββ u-boot-luckfox/ # U-Boot 2017.09 recipe
β βββ u-boot-env/ # Environment configuration
βββ recipes-core/
β βββ images/
β β βββ luckfox-image-minimal.bb # Minimal bootable image with A/B boot
β β βββ luckfox-image-full.bb # Full image with Python3
β βββ base-files/ # Base system files
β βββ sysvinit/ # Init system configuration
β β βββ sysvinit-inittab_%.bbappend # Serial console support (ttyFIQ0, ttyGS0)
β βββ usb-gadget/ # USB gadget support
β β βββ usb-gadget_1.0.bb # ACM serial + RNDIS ethernet
β βββ ab-boot-success/ # A/B boot success marker
β β βββ ab-boot-success_1.0.bb # Reset boot counter on successful boot
β βββ userdata-init/ # Userdata partition initialization
β βββ userdata-init_1.0.bb # Auto-format and resize userdata partition
βββ recipes-devtools/
β βββ toolchain/ # Rockchip ARM toolchain (auto-fetched from git)
β βββ arm-rockchip830-toolchain-native.bb # GCC 8.3.0 + uclibc toolchain
βββ recipes-extended/
β βββ xz/ # XZ compression utilities
βββ README.md
βββ README-PARTITIONS.md # Partition layout documentation
βββ .gitignore
βββ README.md
## ποΈ Configuration
### Build for Different Boot Media
#### eMMC (default) β
Tested & Working
```bash
# Edit conf/local.conf or use:
MACHINE=luckfox-pico bitbake luckfox-image-minimal
# Build for SD card (uses mmcblk1 instead of mmcblk0)
MACHINE=luckfox-pico-sd bitbake luckfox-image-minimal# Build for SPI NAND with UBI/UBIFS support
MACHINE=luckfox-pico-spi-nand bitbake luckfox-image-minimalImportant: Before flashing to SPI NAND for the first time, or when upgrading from old images, erase the flash in U-Boot console to prevent UBI image sequence conflicts:
# In U-Boot console:
nand erase.part rootfs
Then flash the image using rkdeveloptool or upgrade_tool as usual.
Edit your machine config or local.conf:
# Example: Larger boot partition
ROCKCHIP_PARTITION_LAYOUT = "32K(env),512K@32K(idblock),256K(uboot),32M(boot),-(rootfs)"
See README-PARTITIONS.md for details.
Edit conf/local.conf:
# Add packages to all images
IMAGE_INSTALL:append = " python3 htop nano"
# Or edit image recipe directlyThe AIC8800DC WiFi driver is fully integrated with automatic firmware deployment:
# Add to conf/local.conf to include WiFi support
IMAGE_INSTALL:append = " kernel-module-aic8800dc"What's included:
- β
3 kernel modules (
aic8800_bsp.ko,aic8800_fdrv.ko,aic8800_btlpm.ko) - β
21 firmware files installed to
/lib/firmware/aic8800/ - β
Auto-load init script (
/etc/init.d/aic8800dc-wifi) - β Modules load automatically at boot
Firmware files deployed:
- WiFi firmware patches and calibration data
- User configuration files (
aic_userconfig_8800dc.txt) - LMAC/FMAC firmware variants for different chip revisions
Manual module loading (if needed):
modprobe aic8800_bsp
modprobe aic8800_fdrv
modprobe aic8800_btlpm # For Bluetooth low-power management# Clean specific recipe
bitbake -c cleanall linux-luckfox
# Clean specific package
bitbake -c cleansstate u-boot-luckfox
# Clean everything (fresh start)
rm -rf tmp sstate-cache# Open development shell for a recipe
bitbake -c devshell linux-luckfox
# This opens a shell with all build environment variables set# Build SDK for application development
bitbake -c populate_sdk luckfox-image-minimal
# SDK will be in tmp/deploy/sdk/After modifying recipes, rebuild efficiently:
# Rebuild only changed components
bitbake luckfox-image-minimal
# Force rebuild of specific component
bitbake -c compile -f linux-luckfox
bitbake luckfox-image-minimalMinimal bootable system with:
- Linux kernel 5.10.160
- BusyBox userland
- Basic networking
- Serial console
- USB gadget (serial + ethernet)
- WiFi support (AIC8800DC driver + utilities)
- A/B dual boot with automatic rollback
- Userdata partition with auto-format
- ~60MB rootfs
Full-featured system with:
- Everything from luckfox-image-minimal
- Python3 environment (core + modules)
- Development tools (gcc, make, cmake)
- Network utilities
- System administration tools
- ~250MB rootfs
Ensure you have at least 100GB free space. Clean old builds:
rm -rf tmp/work/*sudo locale-gen en_US.UTF-8
export LC_ALL=en_US.UTF-8Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- A/B Update System Guide - Dual boot A/B partition system with automatic rollback
- Partition Layout System - SDK-compatible partition configuration
- Yocto Project Documentation
- Luckfox Wiki
- Rockchip RV1106 Documentation
This project is licensed under mixed licenses. See individual recipe files for specific license information:
- Layer configuration: MIT
- Recipes: Various (GPL-2.0, MIT, Apache-2.0)
- Linux kernel: GPL-2.0
- U-Boot: GPL-2.0+
- Luckfox Team - Original SDK and hardware
- Yocto Project - Build system
- Rockchip - SoC vendor
- OpenEmbedded Community - Metadata layers
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Luckfox Forum: Official Forum
- Basic Yocto layer structure
- U-Boot integration
- Linux kernel 5.10.160
- WiFi driver support (AIC8800DC)
- FIT boot image generation
- Complete disk image creation
- SDK-compatible partition layouts
- eMMC boot (tested)
- SD card boot (tested)
- SPI nand boot (tested)
- Dual boot A/B system
- Automatic boot failure rollback
- WiFi utilities (iw, wpa-supplicant)
- Userdata partition with auto-format
- Python3 environment
- OTA update mechanism
- Custom BSP layer separation
Made with β€οΈ for the Luckfox Pico community