Building Yocto for SP2‐IMX8MP - ADLINK/meta-adlink-nxp GitHub Wiki

1. Set up a build host environment

1.1 Recommended Hardware for the host

  • Intel Core-i7 Processor (>= 4 cores)
  • at least 8GB of Memory
  • at least 500GB Disk sapce
  • Ubuntu 20.04 LTS 64-bit version for Yocto Project Build
  • High-speed network connectivity

1.2 Essential host Packages are required to be installed on your host

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib 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 zstd liblz4-tool curl git python-is-python3

Note: Don't use the root account to build Yocto. it might cause unpredictable errors.

1.3 "Google repo" packages is required to be installed on your host

$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=${PATH}:~/bin

1.4 Before star to build the source, please make sure that git is set up properly with the commands below

$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
$ git config --list

2. Fetch the source from the git location as below

2.1 Create a working directory. we're creating "imx8mp-yocto-bsp".

$ mkdir imx8mp-yocto-bsp 
$ cd imx8mp-yocto-bsp

2.2 Download the required meta-layers.

It's recommended to use the latest branch and manifest file to build the Yocto image. Here you can find the available branches and manifest files.

For instance kirkstone branch

$ repo init -u https://github.com/ADLINK/adlink-manifest.git -b sp2-imx-yocto-kirkstone -m adlink-sp2-imx8mp-yocto-kirkstone_5.15.71-2.2.0_desktop.xml
$ repo sync

For instance scarthgap branch

$ repo init -u https://github.com/ADLINK/adlink-manifest.git -b sp2-imx-yocto-scarthgap -m adlink-sp2-imx8mp-yocto-scarthgap_6.6.23-2.0.0.xml
$ repo sync

2.2.1 cherry-pick some recipes in the meta-openembedded meta-layer (For kirkstone only)

$ cd sources/meta-openembedded/
$ git cherry-pick 821e2e0cdf582c5079170a90dff4358fa2cac103
$ git cherry-pick b1a1d376bf7b5435dfb831c6bc384df29c434439
$ git cherry-pick 290d4729e028a98f18d247f4cfb1fa371df43d1b
$ cd -

2.3 Setup the yocto build environment for sp2-imx8mp

for kirkstone build:

$ EULA=1 MACHINE=sp2-imx8mp DISTRO=imx-desktop-xwayland BUILD=<build_dir> source adlink-imx-setup-release.sh

for scarthgap build:

$ EULA=1 MACHINE=sp2-imx8mp DISTRO=fsl-imx-xwayland BUILD=<build_dir> source adlink-imx-setup-release.sh

2.3.1 Required setting in conf/bblayer.conf (scarthgap only)

$ vi <build_dir>/conf/bblayer.conf
# add the meta-adlink-demo layer
BBLAYER += "${BSPDIR}/sources/meta-adlink-demo"

2.3.2 Required Setting in conf/local.conf

for kirkstone build:

$ vi <build_dir>/conf/local.conf

# set the default background image to adlink
IMAGE_INSTALL:append = " custom-dconf"
# accept commercial license for ffmpeg
LICENSE_FLAGS_ACCEPTED:append = " commercial"

for scarthgap build:

$ vi <build_dir>/conf/local.conf
# support all LPDDR4 sizes
UBOOT_EXTRA_CONFIGS = "LPDDR4_ALL"
# additional packages
IMAGE_INSTALL:append = " adlink-startup chromium-ozone-wayland python3-pip python3-pyeiq python3-pyqt6 python3-cvui python3-dbr dtc packagegroup-imx-ml usb-mux pwm-beeper usb-hset msgpacker python3-urllib3 uart-mode"
# mask out bbappend from meta-adlink-demo that are designed for other platforms
BBMASK += "fdesktop_%.bbappend burn-in-test_5.0.bb wpa-supplicant_%.bbappend bmap-tools_%.bbappend docker-ce_%.bbappend"

2.4 Build the image

for kirkstone build: To build nxp-desktop image without Time Sensitive Network Support, use imx-image-desktop

$ bitbake imx-image-desktop

for scarthgap build: To build imx-image-full image

$ bitbake imx-image-full

Note: Sometimes the build may fail due to the traffic/server try again after sometime

2.5 Image is generated

for kirkstone build: as imx-image-desktop-sp2-imx8mp.rootfs.wic in <build_dir>/tmp/deploy/image/sp2-imx8mp/.

for scarthgap build: as imx-image-full-sp2-imx8mp.rootfs.wic in <build_dir>/tmp/deploy/image/sp2-imx8mp/.

3. Flashing the Yocto image

Please refer to here

⚠️ **GitHub.com Fallback** ⚠️