Compile Yocto Image from Source Code

Make sure your Build Host meets the following requirements:

  • At least 90 Gbytes of free disk space, though much more will help to run multiple builds and increase performance by reusing build artifacts.
  • At least 8 Gbytes of RAM, though a modern modern build host with as much RAM and as many CPU cores as possible is strongly recommended to maximize build performance.
  • Runs a supported Linux distribution (i.e. recent releases of Fedora, openSUSE, CentOS, Debian, or Ubuntu). For a list of Linux distributions that support the Yocto Project, see the Supported Linux Distributions section in the Yocto Project Reference Manual. For detailed information on preparing your build host, see the Preparing the Build Host section in the Yocto Project Development Tasks Manual.
    • Git 1.8.3.1 or greater
    • tar 1.28 or greater
    • Python 3.8.0 or greater.
    • gcc 8.0 or greater.
    • GNU make 4.0 or greater

If your build host does not meet any of these three listed version requirements, you can take steps to prepare the system so that you can still use the Yocto Project. See the Required Git, tar, Python, make and gcc Versions section in the Yocto Project Reference Manual for information.

Build Host Packages

You must install essential host packages on your build host. The following command installs the host packages based on an Ubuntu distribution:

$ sudo apt install 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 libegl1-mesa libsdl1.2-dev python3-subunit mesa-common-dev zstd liblz4-tool file locales libacl1
$ sudo locale-gen en_US.UTF-8

Use Repo to Clone Yocto For Mixtile Core3588E

repo init -u https://github.com/mixtile-rockchip/manifests.git -b master -m mixtile_core3588e_yocto_kirkstone.xml && repo sync

After repo sync, enter the yocto folder and you can see the following files

➜  tree -L 1
.
├── bitbake -> poky/bitbake
├── build
├── meta-browser
├── meta-clang
├── meta-openembedded
├── meta-poky -> poky/meta-poky
├── meta-qt5
├── meta-rockchip
├── oe-init-build-env -> poky/oe-init-build-env
├── poky
└── scripts -> poky/scripts

10 directories, 1 file

Source the configuration script

source poky/oe-init-build-env

After executing this command, the current directory is switched to the build directory.

Select board level profile

ln -fs rockchip-rk3588-mixtile-core3588e.conf conf/local.conf

Compile Yocto image file

You should then be able to build a image as such:

bitbake core-image-minimal

At the end of a successful build, you should have an .wic image in /path/to/yocto/build/tmp/deploy/images/<MACHINE>/, also with an rockchip firmware image: update.img.

Flashing your Device

Under Linux, you can use upgrade_tool: http://opensource.rock-chips.com/wiki_Upgradetool to flash the image:

  1. Put your device into rockusb mode: http://opensource.rock-chips.com/wiki_Rockusb
  2. If it’s maskrom rockusb mode, try to enter miniloader rockusb mode:
sudo upgrade_tool db <IMAGE PATH>/loader.bin
  1. Flash the image (wic image or rockchip firmware image)
sudo upgrade_tool wl 0 <IMAGE PATH>/<IMAGE NAME>.wic # For wic image
sudo upgrade_tool uf <IMAGE PATH>/update.img # For rockchip firmware image
Was this article helpful?

Related Articles