Yocto Linux BSP Ver.H User Guide for iMX9 series - Yocto 5.2
Introduction
This document provides a comprehensive guide for using the Yocto Linux BSP Ver.H for iMX9 series processors with Yocto 5.2.
Getting Started
System Requirements
- CPU Cores: Intel Core-i7 Processor (>= 8 cores)
- Memory: >= 16GB of Memory
- Disk Space: 500GB (more is recommended and SSD is suggested for better performance)
Conventions
The following conventions are used throughout this document:
${PREBUILT_IMAGE}: compressed prebuilt image (*.img.gz)${CONTAINER_NAME}: container name (e.g. imx9LBVH0001)${BSP_TARBALL}: BSP tarball (*.tgz)${BSP_HOME}: home directory of the BSP${BDIR}: build directory (e.g. build_xwayland)${MX9PROC}: i.MX9 Processor (mx95 for iMX95)${IMX9PROC}: i.MX9 Processor (imx95)${BOARD}: available target boards list below (aom5521)${BOARD_REV}: board revision (a2)${MC}: machine code combined with${IMX9PROC}${BOARD}${BOARD_REV}(for example, imx95aom5521a2 for AOM-5521 A2)
You can also use the command below to check supported machines on BSP:
$ source setup-environment
${MEM_SIZE}: memory size (1G/2G/4G/6G/8G)${UC}: u-boot config (1G/2G/4G/6G/8G/FSPI_1G/FSPI_2G/FSPI_4G/FSPI_6G/FSPI_8G...)${SD_DEVICE}: device name of SD card in Linux (e.g. /dev/sdf)${SDCARD_IMAGE}: sdcard image built by bitbake (*.wic.zst)${WORKSPACE}: host workspace folders${UBOOT}: u-boot version (e.g. v2025.04_6.12.20-2.0.0)${KERNEL}: linux kernel version (e.g. 6.12.20_2.0.0)${TOOLCHAIN}: toolchain installed directory (e.g. /opt/fsl-imx-xwayland/6.12-walnascar/environment-setup-armv8a-poky-linux)
Console Types
- debug console / serial console: serial terminal program (e.g. minicom, putty, teraterm ...) that serial port is configured to 115200 8N1
- terminal console: terminal program (e.g. gnome-terminal, xfce4-terminal ...)
Docker install and setting
If you don't have docker in your system, then you can follow the below steps to install docker and run it first.
To install Docker Engine on your platform
Please refer to Docker Installation Guide for details
To pull ubuntu 22.04 image from Docker Hub
$ docker pull advrisc/u22.04-imx9lbv1
To create container
$ docker run --privileged -it --name ${CONTAINER_NAME} -v ${WORKSPACE}:/home/adv/adv-release-bsp -v /dev:/dev advrisc/u22.04-imx9lbv1 /bin/bash
Get BSP
You have two methods to put BSP into container created above
Download BSP From GitHub
The following example shows how to download the Advantech Yocto BSP from GitHub. For this example, a directory called adv-release-bsp is created for the project. Refer to IoTGateway/BSP/Linux/iMX9/OS_Support_List, Official version "imx9LBVHXXX" is taken as an example:
AOM5521 BSP From Github
$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com
$ sudo chown adv:adv adv-release-bsp
$ cd adv-release-bsp
$ repo init -u https://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-walnascar -m adv-6.12.20-2.0.0.xml
$ repo sync
AOM2521 BSP From Azure Git
Git source latest version
$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com
$ sudo chown adv:adv adv-release-bsp
$ cd adv-release-bsp
$ repo init -u https://AIM-Linux@dev.azure.com/AIM-Linux/adv-arm-yocto-bsp/_git/adv-arm-yocto-bsp -b imx-linux-walnascar -m adv-6.12.20-2.0.0.xml
$ repo sync
AOM2521 BSP From Azure Git
Tag version xml (Check release note)
$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com
$ sudo chown adv:adv adv-release-bsp
$ cd adv-release-bsp
$ repo init -u https://AIM-Linux@dev.azure.com/AIM-Linux/adv-arm-yocto-bsp/_git/adv-arm-yocto-bsp -b imx-linux-walnascar -m aom2521b0_yocto5.2-linux6.12.20-2.0.0_v0.0.3_kernel-6.12.20_imx95.xml
$ repo sync
If you suffer "server certificate verification failed", you can use the following command to disable SSL verification in git repositories with self-signed certificates:
export GIT_SSL_NO_VERIFY=1
or
git config --global http.sslverify false
If you get "The unauthenticated git protocol on port 9418 is no longer supported.", you can try it:
git config --global url."https://".insteadOf git://
Copy BSP tarball to Container
If you have BSP tarball (eg. imx9LBVH0001_2025-08-12.tgz), then you have to copy it into container.
Follow the steps below:
- Exit container and back to local machine
exit
- Copy BSP tarball to
${WORKSPACE}, and change owner
$ cp imx9LBVH0001_2025-08-12.tgz ${WORKSPACE}
$ sudo chown adv:adv ${WORKSPACE}/imx9LBVH0001_2025-08-12.tgz
- Back to container
$ docker start ${CONTAINER_NAME}
$ docker attach ${CONTAINER_NAME}
- Unpack BSP tarball
tar zxvf imx9LBVH0001_2025-08-12.tgz
Downloads tarball
Not necessarily step. During building Yocto image, it will generate downloads folder which includes all packages we need, but it usually can't fetch normally, so we keep this downloads folder. Then we can reduce some fetch failed issue. You can get Downloads tarball (walnascar-6.12.20_downloads.tar.gz) from following URL: [walnascar-6.12.20_downloads.tar.gz]
If you get downloads tarball, you can copy to your ${WORKSPACE}
Follow the steps below:
- Exit container and back to local machine
exit
- Copy Downloads tarball to
${WORKSPACE}, and change owner
$ cp walnascar-6.12.20_downloads.tar.gz ${WORKSPACE}
$ sudo chown adv:adv ${WORKSPACE}/walnascar-6.12.20_downloads.tar.gz
- Back to container
$ docker start ${CONTAINER_NAME}
$ docker attach ${CONTAINER_NAME}
- Unpack Downloads tarball
tar zxvf walnascar-6.12.20_downloads.tar.gz
- Make link to downloads folder
$ cd adv-release-bsp
$ ln -s ${WORKSPACE}/walnascar-6.12.20_downloads downloads
Introducing BSP
The BSP is based on Yocto Project with Freescale enhanced features for i.MX95, plus specific target board features from Advantech Inc.
The Advantech Yocto Project BSP Release directory contains a "sources" directory, which contains the recipes used to build, one or more build directories, and a set of scripts used to set up the environment.
The recipes used to build the project come from both the community and Advantech. The Yocto Project layers are downloaded to the sources directory. This sets up the recipes that are used to build the project.
Naming Rule
The tarball/prebuilt image name is consist of the model name followed by "LB" or "LI" plus version number and released date.
For example, BSP file name: 'imx9LBVG0006_2025-01-14.tgz'
- "LB" is acronym of Linux BSP
- "VH0001" stands for Version H.0001
For example, Yocto image name: '5521A2Y052LIVH0001_iMX95_8G_2025-08-12.img.gz'
- "5521A2" stands for AOM-5521 A2
- "LI" is acronym for prebuilt Linux Image
- "8G" is DDR size
BSP Content
The description of some important folders list below:
sources/meta-advantech/: meta layer by Advantechmeta-fsl-*/: meta layer by Freescalefsl-setup-release.sh: to create one new build environmentsetup-environment: to continue an exist build environment
Build Instructions
To create one new build environment
Perform the following commands in terminal console:
$ cd ${BSP_HOME}
$ MACHINE=${MC} DISTRO=fsl-imx-xwayland source imx-setup-release.sh -b ${BDIR}
We can specify u-boot default config like below:
$ MACHINE=${MC} UBOOT_CONFIG=${UC} DISTRO=fsl-imx-xwayland source imx-setup-release.sh -b ${BDIR}
You need to read and accept the EULA.
To continue an exist build environment
Perform the following commands in terminal console:
$ cd ${BSP_HOME}
$ source setup-environment ${BDIR}
To build sdcard image
To create/continue a build environment perform the following command in terminal console:
$ bitbake imx-image-full
The two files, imx-image-full-${MC}.wic.zst and ...wic.bmap, will be located in directory, ./tmp/deploy/images/${MC}, while building process finished successfully.
To build toolchain installer
To create/continue a build environment perform the following command in terminal console:
$ bitbake meta-toolchain
The below installer will be located in the directory "./tmp/deploy/sdk":
fsl-imx-xwayland-glibc-x86_64-meta-toolchain-armv8a-imx95aom5521a2-toolchain-6.12-walnascar.sh
To build bootloader
To create/continue a build environment perform the following command in terminal console:
$ bitbake imx-boot
To build linux kernel
To create/continue a build environment. If you operate on docker images, please install tmux application before running this command:
$ sudo apt-get install tmux
Type following command to enter tmux:
$ tmux
Perform the following command in terminal console to show up menuconfig:
$ bitbake linux-imx -c menuconfig
After edit menuconfig, type following command to exit tmux windows:
$ exit
To build kernel image:
$ bitbake linux-imx
The two files, Image & Image-${IMX9PROC}-${BOARD}-${BOARD_REV}.dtb, will be located in the directory, ./tmp/deploy/images/${MC}.
Creating boot-up on-board flash from prebuilt image
To create one boot-up SD card
Perform the following command in terminal console:
# gunzip -c ${PREBUILT_IMAGE} | dd of=${SD_DEVICE} bs=1M
# sync
Creating boot-up on-board flash from built sdcard image
To create one boot-up SD card
Perform the following commands in terminal console:
$ pushd ${BSP_HOME}/${BDIR}/tmp/deploy/images/${MC}
$ zstd -cd ${SDCARD_IMAGE} | sudo dd of=${SD_DEVICE} bs=1M
(or using bmaptool to take less time elapsed)
$ sudo bmaptool copy --bmap ${SDCARD_IMAGE/zst/bmap} ${SDCARD_IMAGE} ${SD_DEVICE}
$ sync
$ popd
Debug console information
If you want to see debug message from device, you need to prepare for hardware device and software tool.
Preparing for hardware device
The following URL provides information about the debug port slot and the debug port line for each device: Debug Port Information
Preparing for software tool
You need to prepare the debug console tool. For example: "minicom" tool or "putty" tool. Baud rate: 115200
Customization
Setting up SDK
Please follow the section "To build toolchain installer" to build one toolchain installer.
Perform the following command in terminal console:
$ cd ${BSP_HOME}/${BDIR}/tmp/deploy/sdk
$ sudo ./fsl-imx-xwayland-glibc-x86_64-meta-toolchain-armv8a-imx95aom5521a2-toolchain-6.12-walnascar.sh
Enter new installed directory or just press Enter to use default directory. While Proceed[y/n]? shows up, please enter the correct one. Waiting for the SDK installed (while the following messages show up completely). Download SDK Link (Just Only reference): [downloads_SDK]
Setting up cross compiling environment
SDK has been set up (ref. Setting up SDK)
Perform the following command in terminal console:
$ source ${TOOLCHAIN}/environment-setup-aarch64-poky-linux
Build U-Boot in standalone environment
Config u-boot
make ${IMX9PROC}_${BOARD}${BOARD_REV}_${MEM_SIZE}_defconfig
Example:
make imx95_aom5521a2_8G_defconfig
Build u-boot
make -j4
Build imx-boot image by using imx-mkimage for imx95
Get imx-boot tarball from our server. Here we take aom5521 as an example:
$ tar zxvf 5521A2Y052LIVH0001_iMX95_8G_imx-boot.tgz
$ cd 5521A2Y052LIVH0001_iMX95_8G_imx-boot/
In this folder, copy necessary files to imx-mkimage folder:
$ cp ${u-boot.bin、spl/u-boot-spl.bin、arch/arm/dts/imx95-aom5521-a2.dtb、tools/mkimage} imx-boot/iMX9/.
Make imx-boot image:
$ cd ~/imx-mkimage
$ make SOC=iMX95 OEI=YES flash_all
Replace uuu imx-boot
Perform the following uuu command to transfer to on-board flash:
$ cp flash.bin ~/mfgtools/uuu/.
$ sudo ./uuu -b emmc flash.bin
Replace imx-boot
Perform the following command to transfer to on-board flash:
$ sudo dd if=flash.bin of=/dev/sdd bs=1K seek=32 conv=fsync
Building & updating kernel/modules/dtb manually
The cross compiling environment has been set up. (ref. Setting up cross compiling environment)
Copy BSP tarball to Container
You can get Downloads Linux-imx from following URL: [adv_6.12.20_2.0.0]
Config kernel
Configure linux kernel:
$ cd linux-imx
$ make distclean
$ make imx_v8_adv_defconfig
$ make menuconfig
Start building linux kernel:
$ make -j4 Image
When you get error like below:

Run command then rebuild:
$ unset LDFLAGS
The kernel image file, Image, is located in the directory "./arch/arm64/boot/".
Start building kernel modules:
$ make -j4 modules
Copy all modules to a temporary rootfs directory, "~/temp/rootfs":
$ make modules_install INSTALL_MOD_PATH=~/temp/rootfs
Building device tree blob:
$ make -j4 freescale/${IMX9PROC}-${BOARD}-${BOARD_REV}.dtb
Example:
$ make -j4 freescale/imx95-aom5521-a2.dtb
The device tree blob, ${IMX9PROC}-${BOARD}-${BOARD_REV}.dtb, is located in the directory "./arch/arm64/boot/dts/freescale/".
Replace kernel & dts
Replace kernel
- Copy Image to SDcard or emmc
Replace dtb file
- Copy dtb file to SDcard or emmc
Improve boot speed
Bootloader
- bootdelay time We can cancel the bootdelay time by setting bootloader environment value:
setenv bootdelay 0
env save
reset
- Disable console Disable debug message output can also improve boot speed
Disable kernel message:
setenv mmcargs setenv bootargs ${jh_clk} console=${console} modprobe.blacklist=${modprobe.blacklist} root=${mmcroot} video=HDMI-A-1:${videores} quiet
env save
reset
Or disable debug port:
setenv console
env save
reset
Rootfs
TBD
Services
- Using systemctl disable remove, we can remove unnecessary services:
systemctl disable <services>
Example:
systemctl disable boottimes
System Recovery
This section provides detail procedures of restoring the eMMC image.
For more usage: https://github.com/NXPmicro/mfgtools/wiki
Reflash EMMC from Boot SD CARD
-
Download mksd-linux.sh from https://github.com/ADVANTECH-Corp/RISC_tools_scripts/blob/mickledore/imx8/mksd-linux.sh
-
Download "Product_AIM_Release_version"_flash_tool.tgz
-
Unzip the "Product_AIM_Release_version"_flash_tool.tgz
-
Copy the mksd-linux.sh to mk_inand folder
-
Run mksd-linux.sh
glmark2 Test

# glmark2-es2-wayland --fullscreen

# glmark2-es2-wayland -s 1920x1080
