9. Yocto Project User Guide
This section introduces how to use the Yocto project to compile images that can be flashed and run on RUBIK Pi 3.
9.1 Host requirements
-
Configuration
- x86 computer
- At least a quad-core CPU, such as Intel i7-2600 @ 3.4 GHz (equivalent or higher)
- 300 GB of available disk space (swap partition > 32 GB)
- 16 GB RAM
- Ubuntu 22.04
-
Tool
- Git 1.8.3.1 or later
- Tar 1.28 or later
- Python 3.10.2 or later
- GCC 7.5 or later
- GNU Make 4.0 or later
-
Permission
- Some commands require the sudo privilege to run.
To set up a virtual machine (VM) running Ubuntu 22.04 on Microsoft Windows or Apple(®) macOS(®), refer to Qualcomm Linux Virtual Machine Setup Guide. Code compilation on a VM is a relatively slow process and may take several hours. It is recommended to use an Ubuntu host for compilation.
9.2 Configure the Ubuntu host
Install and configure the required software tools on the Ubuntu host.
-
Install the following packages to prepare the host environment required to run Yocto:
sudo apt update
sudo apt install repo git-lfs 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 pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool locales tar python-is-python3 file libxml-opml-simplegen-perl vim whiptail g++ -
Set the locale (if not already set):
sudo locale-gen en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8 -
Update the git configurations:
# Check if your identity is configured in .gitconfig
git config --get user.email
git config --get user.name
# Run the following commands if you do not have your account identity set in .gitconfig
git config --global user.email <Your email ID>
git config --global user.name <"Your Name">
# Add the following UI color option for output of console (optional)
git config --global color.ui auto
# Add the following git configurations to fetch large size repositories and to avoid unreliable connections
git config --global http.postBuffer 1048576000
git config --global http.maxRequestBuffer 1048576000
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
9.3 Synchronize code
This section describes how to use the Repo tool installed during the Ubuntu host configuration to download git repositories and other attributes from the RUBIK Pi manifest. The Repo tool uses the repo init
command to download the manifest.
The table below is an example of the mapping between Yocto layers and the manifest release tag. This mapping is used to download and compile Qualcomm Linux:
- Syntax of the manifest release tag:
rubikpi-<Linux LTS Kernel Version>-<distro>.<version>-Ver.<release>.xml
For example, the manifest release tag rubikpi-6.6.52-QLI.1.3-Ver.1.1.xml
is described as follows:
- 6.6.52: Qualcomm Linux kernel
- QLI.1.3: distro
- 1.1: milestone release
- Syntax for the additional productization manifest release tag:
rubikpi-<Linux LTS Kernel Version>-<distro>.<version>-Ver.<release>_<product/customization>-<release>.xml
For example, the additional productization manifest release tag rubikpi-6.6.52-QLI.1.3-Ver.1.1_qim-product-sdk-1.1.2.xml
is described as follows:
- 6.6.52: Qualcomm Linux kernel
- QLI.1.3: distro
- qim-product-sdk-1.1.2: QIMP SDK version based on QLI.1.3
- Other products/customization examples:
- realtime-linux-1.0
- robot-product-sdk-1.1
- 1.0: milestone release
- 1.1: patch release version related to the milestone release
9.4 Compile the QIMP SDK image
The Qualcomm® Intelligent Multimedia Product (QIMP) SDK is a collection of four separate functional SDKs, namely the Qualcomm® Intelligent Multimedia SDK (IM SDK), Qualcomm® Neural Processing SDK, Qualcomm® AI Engine Direct SDK, and LiteRT. It also includes reference applications that can be used to develop use cases.
For details, refer to Qualcomm Intelligent Multimedia Product (QIMP) SDK Quick Start Guide.
-
Download Qualcomm Yocto layers and the support layers:
noteThe
<manifest release tag>
for the QIMP SDK build is the same as the BSP build. Clone the QIMP SDK layer on the BSP build.# cd to directory where you have 300 GB of free storage space to create your workspaces
mkdir <WORKSPACE_DIR>
cd <WORKSPACE_DIR>
repo init -u https://github.com/rubikpi-ai/rubikpi-manifest -b qcom-linux-kirkstone -m <manifest release tag>
# Example, <manifest release tag> is rubikpi-6.6.52-QLI.1.3-Ver.1.1_qim-product-sdk-1.1.2.xml
# repo init -u https://github.com/rubikpi-ai/rubikpi-manifest -b qcom-linux-kirkstone -m rubikpi-6.6.52-QLI.1.3-Ver.1.1_qim-product-sdk-1.1.2.xml
repo sync -
Compile the software image:
./rubikpi_build.sh
Alternatively, run the following bitbake commands to compile the project:
# Set the compilation environment
export EXTRALAYERS="meta-qcom-qim-product-sdk"
export MACHINE=qcm6490-idp
export DISTRO=qcom-wayland
export FWZIP_PATH="`pwd`/src/vendor/thundercomm/prebuilt/BP-BINs"
source setup-environment_RUBIKPi
export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS FWZIP_PATH CUST_ID"
# Compile
bitbake qcom-multimedia-image
bitbake qcom-qim-product-sdk
9.5 Package and flash the image
-
Enter the following command in the root directory of the code to package the compiled image.
./rubikpi_build.sh --zip_falt_build
-
After the packaging is complete, you can find the packaged image directory and the corresponding compressed file in the <workspace_path>/rubikpi/output directory.
-
Flash the image. For details, refer to 1.3.3 Flash images.
9.6 Compile the eSDK
A pre-compiled eSDK has already been uploaded to GitHub. The following explains the detailed steps for compiling the eSDK.
-
Go to the root directory of the Yocto project.
-
Set up the compilation environment.
export EXTRALAYERS="meta-qcom-qim-product-sdk"
export MACHINE=qcm6490-idp
export DISTRO=qcom-wayland
export FWZIP_PATH="`pwd`/src/vendor/thundercomm/prebuilt/BP-BINs"
source setup-environment_RUBIKPi
export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS FWZIP_PATH CUST_ID" -
Compile the eSDK.
bitbake -c do_populate_sdk_ext qcom-multimedia-image
-
After compilation is complete, the eSDK will be generated in the <WORKSPACE_DIR>/build-qcom-wayland/tmp-glibc/deploy/sdk/ directory. It is a standalone installer designed for users interested in application development without the need for a complete BSP compilation.
-
Install the eSDK.
qcom-wayland-x86_64-qcom-multimedia-image-armv8-2a-qcm6490-idp-toolchain-ext-1.3-ver.1.1.sh
When the prompt message is displayed, enter the file system path where you want to install the eSDK, such as /local/mnt/workspace/Platform_eSDK_plus_QIM.