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 name | Target | provided by layer |
|---|---|---|
| core-image-minimal | A small image that only allows a device to boot | Poky |
| core-image-minimal-xfce | A XFCE minimal demo image | meta-openembedded/meta-xfce |
| core-image-sato | Image 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 manager | Poky |
| core-image-weston | A very basic Wayland image with a terminal | Poky |
| core-image-x11 | A very basic X11 image with a terminal | Poky |
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-rockchipChoose 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-satoThe 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-westonNote: 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-satoIf 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 -sAdjust 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
makecommand during the do_compile task in order to specify parallel compilation on the local build host. - PARALLEL_MAKEINST: Extra options passed to the
makecommand 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 paramater | Description |
|---|---|
| -c fetch | Fetches if the downloads state is not marked as done |
| -c clean | Removes all output files for a target |
| -c cleanall | Removes all output files, shared state cache, and downloaded source files for a target |
| -c compile -f | It 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 listtasks | Lists 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.
Related overview
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
| layer | path | priority(The higher the number, the higher the priority) | describe |
|---|---|---|---|
| meta-oe | meta-openembedded/meta-oe | 6 | contains a large amount of additional recipes |
| meta-python | meta-openembedded/meta-python | 7 | Provide Python recipes |
| meta-qt5 | meta-qt5 | 7 | Provides QT5 recipes |
| meta-clang | meta-clang | 7 | clang compiler |
| meta-rockchip | meta-rockchip | 9 | Rockchip board level support available |
| meta | meta | 5 | Contains the OpenEmbedded-Core metadata |
| meta-poky | meta-poky | 5 | Holds the configuration for the Poky reference distribution |
| meta-yocto-bsp | meta-yocto-bsp | 5 | Configuration for the Yocto Project reference hardware board support package. |
| meta-chromium | meta-chromium | 7 | Provide chromium browser recipe |

