Skip to main content

1-4 Yocto Project Build

Let's start and enter Docker container,

docker start my_container_for_20.04
docker exec -it my_container_for_20.04 /bin/bash

According to the Linux Start-up Guide, For the first time, we need to install additional packages in the Dcoker container,

sudo apt-get update
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping libsdl1.2-dev xterm p7zip-full libyaml-dev \
libssl-dev bmap-tools

Some additional packages like Cmake and Meson may be used later, we also install them.

sudo apt update
sudo apt install software-properties-common

sudo apt-add-reporitory 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt update
sudo apt install cmake

sudo apt install meson ninja-build

We need to download some zip files for the Yocto build. In the below page, Please find the items to download under "For RZ/G2L"

RZ/G Verified Linux Package (5.10-CIP)

Download these items,

  1. RZ/G Verified Linux Package v3.0.6-update3
  2. RZ MPU Graphics Library Evaluation Version for RZ/G2L and RZ/G2LC
  3. RZ MPU Video Codec Library Evaluation Version for RZ/G2L

Then, please follow the content in RZ/G2L EVK - Linux Start-up Guide
to prepare the Yocto build step by step, include files copy and decompression, modify .conf file and run the commands to start Yocto build.
We here only emphasis some important points.

Please be aware, Each time, when we enter the container, it's necessary to run the below to set the environment variables

cd <work dir> 
TEMPLATECONF=$PWD/meta-renesas/meta-rzg2l/docs/template/conf/ source poky/oe-init-build-env build

Start the Yocto build command, there are some choises of the build option, we would recommend you to use the most complete build option as below,

MACHINE=smarc-rzg2l bitbake core-image-qt

The build process always takes a long time, it is depend
on the performance of your PC, plase always check for remaining free space of the harddisk.

Yocto_build

Sometimes there are some error messages shown and
the build stop at a certain percentage of progress. It is possible caused by fetch operation ( network problem) or sometimes the dependency of the packages was not set properly.

Don't worry, you can try to execute the same command again, it is possible to move on for a while. A succefully Yocto build not always at the first try.

Write image to SD card

After Yocto compilation, check the output directory

cd build/tmp/deploy/images/smarc-rag2l/

The output files of the build are

core-image-qt-smarc-rzg2l.wic.gz
core-image-qt-smarc-rzg2l.wic.bmap

Exit the Docker container, insert SD card to the PC

enter the commands below,

sudo fdisk -l       # check device ID of SD card 
umount /dev/sdc1 # suppose SD card mounted on /dev/sdc1 and /dev/sdc2
umount /dev/sdc2
sudo bmaptool copy core-image-qt-smarc-rzg2l.wic.gz /dev/sdc

Remove SD card, insert it to RZ/G2L and boot up. Now you can click on the Qt Demo items or open a terminal then input some Linux commands for test.

Important Yocto forders
  1. Final Linux image :

Where you can find the images files used to write to SD Card.

<work dir>/build/tmp/deploy/images/smarc-rzg2l/

  1. Yocto build output files for each recipes

These folders are helpful to find out the problems during compiling and deployment.

<work dir>/build/tmp/work/aarch64-poky-linux/

  1. Root folder ("/") of the Linux images.

You can check if the package has been build succefully by checking this folder. not necessarily wait SD card burning and booting on RZ/G2L

<work dir>/build/tmp/work/smarc_rzg2l-poky-linux/core-image-qt/1.0-r0/rootfs