Sapphire Stream Technology
Home Yocto Project User Guide

Yocto Project User Guide

This section introduces how to use the Yocto project to compile images that can be flashed and run on IQ9.

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.

Note

To set up a virtual machine (VM) running Ubuntu 22.04 on Microsoft Windows or Apple(®) macOS(®), refer to Set up the Windows 11 development environment, Set up an Ubuntu Server VM on an Arm64 Mac using UTM, and Set up an Ubuntu VM on an x86_64 Mac using UTM. 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. :::

Configure the Ubuntu host

Install and configure the required software tools on the Ubuntu host.

1. Install the following packages to prepare the host environment required to run Yocto:

``shell 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++ ``

2. Set the locale (if not already set):

``shell 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 ``

3. Update the git configurations:

```shell # 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 ```

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 IQ9 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:

Yocto LayerManifest Release TagReference Distribution (DISTRO)
meta-qcom, meta-qcom-hwe, meta-qcom-distro, meta-qcom-qim-product-sdk, meta-IQ9, meta-IQ9-extras, meta-qt5, meta-rosBSP build + QIMP SDK build:IQ9-6.6.52-QLI.1.3-Ver.1.1_qim-product-sdk-1.1.2.xml qcom-wayland
meta-qcom, meta-qcom-hwe, meta-qcom-distro, meta-qcom-qim-product-sdk, meta-IQ9, meta-IQ9-extras, meta-qt5, meta-rosBSP build + QIMP SDK build:IQ9-6.6.52-QLI.1.3-Ver.1.2_qim-product-sdk-1.1.2.xml qcom-wayland
Note

1. Syntax of the manifest release tag:

IQ9-<Linux LTS Kernel Version>-<distro>.<version>-Ver.<release>.xml

For example, the manifest release tag IQ9-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

2. Syntax for the additional productization manifest release tag:

IQ9-<Linux LTS Kernel Version>-<distro>.<version>-Ver.<release>_<product/customization>-<release>.xml

For example, the additional productization manifest release tag IQ9-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

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.

1. Download Qualcomm Yocto layers and the support layers:

:::note

The <manifest release tag> for the QIMP SDK build is the same as the BSP build. Clone the QIMP SDK layer on the BSP build. :::

``bash # 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/IQ9-ai/IQ9-manifest -b qcom-linux-kirkstone -m <manifest release tag> # Example, <manifest release tag> is IQ9-6.6.52-QLI.1.3-Ver.1.1_qim-product-sdk-1.1.2.xml # repo init -u https://github.com/IQ9-ai/IQ9-manifest -b qcom-linux-kirkstone -m IQ9-6.6.52-QLI.1.3-Ver.1.2_qim-product-sdk-1.1.2.xml repo sync ``

2. Download pre-compiled binaries:

``bash cd src/vendor/thundercomm/prebuilt/BP-BINs git lfs pull cd - ``

3. Compile the software image:

``bash ./IQ9_build.sh ``

Alternatively, run the following bitbake commands to compile the project:

``yaml # 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_IQ9 export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS FWZIP_PATH CUST_ID"

# Compile bitbake qcom-multimedia-image bitbake qcom-qim-product-sdk ```

Package and flash the image

1. Enter the following command in the root directory of the code to package the compiled image.

``shell ./IQ9_build.sh --zip_flat_build ``

2. After the packaging is complete, you can find the packaged image directory and the corresponding compressed file in the \<workspace_path>/IQ9/output directory.

3. Flash the image. For details, refer to Flash images.

Compile the eSDK

A pre-compiled eSDK has already been uploaded to IQ9 official website. The following explains the detailed steps for compiling the eSDK.

1. Go to the root directory of the Yocto project.

2. Set up the compilation environment.

``bash 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_IQ9 export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS FWZIP_PATH CUST_ID" ``

3. Compile the eSDK.

``bash bitbake -c do_populate_sdk_ext qcom-multimedia-image ``

4. 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.

5. Install the eSDK.

``bash 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.

SPECIAL OFFER

45% OFF

Meet IQ9, the Affordable Edge AI Dev Kit Built on the Qualcomm Dragonwing™ QCS6490