Welcome to Firefly
Switch language
Firefly Docsss
Last Updated: 2026-07-21 09:33:19

Yocto Build and Flash Guide

This guide uses the AIO-1126BJD4 Yocto SDK as an example. Machine names, layer paths, and flash artifacts vary by platform; use the release notes for the target product SDK.

RV1126B SDK Profile

This SDK uses the scarthgap Yocto/Poky branch, Linux 6.1, systemd, DEB packages, and NetworkManager. Package management is enabled by default, and the image includes adbd, Bluetooth service, and a rootfs resize helper. Available machine configurations are aio-1126bjd4, aio-1126bjd4v0, aio-1126bq38, and cam-1126bq38. Each machine selects its own device tree and product configuration; this guide uses aio-1126bjd4 in its examples. Every RV1126B machine includes the demo configuration for debug, display, Wi-Fi/Bluetooth, multimedia, and audio. The image enables OpenSSH. Default accounts are root / firefly and an unprivileged firefly / firefly user with sudo access. These passwords are for development only; change them or use key-based login in production images.

Display Backend

display.conf selects X11 by default and adds x11-base with the Xorg modesetting driver. After switching to Wayland, the image adds weston, weston-init, and weston-examples; the procedure appears below.

Compile Yocto Firmware

Compile

Select image

The Yocto Project provides several common base image recipes. The following table lists the available images and their associated layers.

Image nameTargetprovided by layer
core-image-minimalA small image that only allows a device to bootPoky
core-image-minimal-xfceA XFCE minimal demo imagemeta-openembedded/meta-xfce
core-image-satoImage with Sato, a mobile environment and visual style for mobile devices. The image supports X11 with a Sato theme, Pimlico applications, and contains terminal, editor, and file managerPoky
core-image-westonA very basic Wayland image with a terminalPoky
core-image-x11A very basic X11 image with a terminalPoky

Build image

The process of building with the bitbake command needs to ensure that the network connection is normal. If it is a customer in inland China, you need to ensure that it can ping the external network

  • Enter the directory <path/to/yocto/poky> and execute the following commands in sequence
# Install the required environment packages
# sudo apt install zstd
source oe-init-build-env

# add layer
bitbake-layers add-layer ../../meta-openembedded/meta-oe
bitbake-layers add-layer ../../meta-openembedded/meta-python
bitbake-layers add-layer ../../meta-openembedded/meta-networking
bitbake-layers add-layer ../../meta-openembedded/meta-multimedia
bitbake-layers add-layer ../../meta-openembedded/meta-gnome
bitbake-layers add-layer ../../meta-openembedded/meta-xfce
bitbake-layers add-layer ../../meta-lts-mixins
bitbake-layers add-layer ../../meta-clang
bitbake-layers add-layer ../../meta-browser/meta-chromium
bitbake-layers add-layer ../../meta-rockchip

Choose one of the commands to compile the complete core-image recipes. The following is an x11 based core-image.

MACHINE=aio-1126bjd4 bitbake core-image-minimal
MACHINE=aio-1126bjd4 bitbake core-image-minimal-xfce
MACHINE=aio-1126bjd4 bitbake core-image-x11
MACHINE=aio-1126bjd4 bitbake core-image-sato

The following is a core-image based on wayland. You need to modify DISPLAY_PLATFORM to wayland in /path/to/yocto/meta-rockchip/conf/machine/include/display.conf. Modify as follows:

DISPLAY_PLATFORM ?= "wayland"
# DISPLAY_PLATFORM ?= "x11"

After completing the above modifications, execute the command to compile core-image-weston

MACHINE=aio-1126bjd4 bitbake core-image-weston

Note: If you need to change the compiled core-image recipes after you have already compiled core-image once, you need to clean up the currently compiled core-image and then compile a new core-image.

For example: the currently compiled one is core-image-minimal. You need to change it to core-image-sato.

MACHINE=aio-1126bjd4 bitbake core-image-minimal -c clean
MACHINE=aio-1126bjd4 bitbake core-image-sato

If you want to compile some recipes separately, you can refer to the following:

# kernel
MACHINE=aio-1126bjd4 bitbake linux-rockchip
        
# u-boot
MACHINE=aio-1126bjd4 bitbake u-boot-rockchip
        
# rkmpp
MACHINE=aio-1126bjd4 bitbake rockchip-mpp
        
# rockchip-librga
MACHINE=aio-1126bjd4 bitbake rockchip-librga
        
# See more compilation objects
MACHINE=aio-1126bjd4 bitbake -s

Adjust compilation speed

BB_NUMBER_THREADS and PARALLEL_MAKE are supplied as commented defaults in firefly-kernel6.1-rv1126b.conf. Uncomment and adjust them according to the CPU cores and memory of the build host; too many threads can exhaust memory and cause the build to fail.

BB_NUMBER_THREADS = "4"
PARALLEL_MAKE = "-j 4"
  • BB_NUMBER_THREADS: The maximum number of threads BitBake simultaneously executes.
  • BB_NUMBER_PARSE_THREADS: The number of threads BitBake uses during parsing.
  • PARALLEL_MAKE: Extra options passed to the make command during the do_compile task in order to specify parallel compilation on the local build host.
  • PARALLEL_MAKEINST: Extra options passed to the make command during the do_install task in order to specify parallel installation on the local build host.

More bitbake options

Fundamentally, BitBake is a generic task execution engine that allows shell and Python tasks to be run efficiently and in parallel while working within complex inter-task dependency constraints. One of BitBake’s main users, OpenEmbedded, takes this core and builds embedded Linux software stacks using a task-oriented approach.For more detailed usage, please check《bitbake-user-manual》

MACHINE=aio-1126bjd4 bitbake <target> <paramater>
# e.g
MACHINE=aio-1126bjd4 bitbake u-boot-rockchip -c clean
MACHINE=aio-1126bjd4 bitbake u-boot-rockchip
Bitbake paramaterDescription
-c fetchFetches if the downloads state is not marked as done
-c cleanRemoves all output files for a target
-c cleanallRemoves all output files, shared state cache, and downloaded source files for a target
-c compile -fIt is not recommended that the source code under the temporary directory is changed directly, but if it is, the Yocto Project might not rebuild it unless this option is used. Use this option to force a recompile after the image is deployed.
-c listtasksLists all defined tasks for a target

Partition firmware upgrade

The compiled firmware is located in the directory <path/to/yocto>/build/tmp/deploy/images/<board>/

$ sudo upgrade_tool di -boot boot.img
$ sudo upgrade_tool di -uboot uboot.img
$ sudo upgrade_tool di -misc misc.img
$ sudo upgrade_tool di -recovery recovery.img
  • Partition burning is suitable for debugging stage. For firmware verification, please use the unified firmware burning below.
  • Rootfs does not support separate burning. You need to pack the complete firmware before burning.

Unified firmware upgrade

The compiled firmware is located in the directory <path/to/yocto>/build/tmp/deploy/images/<board>/, the files to be downloaded are .wic and update.img, and after entering the loader mode, execute the following commands :

$ sudo upgrade_tool wl 0 <IMAGE NAME>.wic
$ sudo upgrade_tool uf update.img
  • The default login account of the firmware is: root, password: firefly. The firmware contains a common user account named firefly, and the password is firefly.

Note: If you are developing on a Windows PC, you can use RKdevtool to directly burn update.img, no need to burn <IMAGE NAME>.wic. However, please note that update.img is a link file, so you must select the actual file that the link file points to.

The Yocto Project is an open source collaborative project focused on embedded Linux® operating system development that provides a flexible toolset and development environment that allows embedded device developers worldwide to share technologies, software stacks, configurations and tools for creating these customizations Best Practices for Linux Imaging Collaboration. For more information about the Yocto Project, please refer to the official Yocto Project website:www.yoctoproject.org/. The Yocto Project home page has the Yocto Project Reference Manual and the Yocto Project Overview and other related documents describe in detail how to build the system.

Introduction to Yocto Project Release layer

layerpathpriority(The higher the number, the higher the priority)describe
meta-oemeta-openembedded/meta-oe6contains a large amount of additional recipes
meta-pythonmeta-openembedded/meta-python7Provide Python recipes
meta-qt5meta-qt57Provides QT5 recipes
meta-clangmeta-clang7clang compiler
meta-rockchipmeta-rockchip9Rockchip board level support available
metameta5Contains the OpenEmbedded-Core metadata
meta-pokymeta-poky5Holds the configuration for the Poky reference distribution
meta-yocto-bspmeta-yocto-bsp5Configuration for the Yocto Project reference hardware board support package.
meta-chromiummeta-chromium7Provide chromium browser recipe

On this page