Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section is a guideline how to build a Linux image for the i.MX 8M Mini based congatec modules, using the Yocto Project 2.5 (Sumo). The first section contains Linux Host Machine preparation, Yocto obtaining, and Linux image build. The second section describes how to include the software development tools in the target Linux image, and the third section describes how to build a cross-SDK for the Linux Host Machine.
For more information see the i.MX Yocto Project User's Guide.

1. Linux image build

1.1 Linux Host Machine preparation

  • Ubuntu 16.04 or newer is recommended

  • Linux Mint 19 was used as the reference system for this section

  • The following tools have to be installed

Code Block
languagebash
	$ sudo apt-get update
	$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath  socat  libsdl1.2-dev xterm  sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc repo python3-pip 

1.2 Obtaining Yocto

The Google's repo tool is used to obtain Yocto sources; the tool downloads all necessary files as defined in the provided manifest file. The manifest file therefore determines, among other things, specific version of boot loader and kernel that will be included in the target image.
The congatec Yocto sources and subsequently the manifest file are derived from a NXP GA release version; the mapping is in the table below, together with information about included boot loader and kernel version. In addition to the the base manifest file are available manifest files adding specific functionality above the base NXP GA release. They are also documented in the table.

Kernel Version

U-boot Version

NXP Release Suffix

Repo Manifest File

Derived congatec Releases

Notes

4.14.98-2.0.0

2018.3

2.0.0_ga

cgtimx8mm__imx-4.14.98-2.0.0_ga.xml

rel_cgtsx8m_20-06-16-0

The base manifest file

| 4.14.98-2.0.

| 2.0.0_g

|cgtimx8mm__imx-4.14.98-2.0.0_ga_basler.xml

| N

| *Adds Basler camera support

The repo tool dowloads all files into the working directory, so it is a good idea to create a dedicated directory for the purpose, e.g.

Code Block
languagebash
	$ mkdir ~/yocto
	$ cd ~/yocto

All manifest files reside on the cgtimx8mm__imx-linux-sumo branch of the manifest-imx8-family repository; the repo init command can be instructed to use either the latest version of the provided manifest file (subsection 1.2a) or a specific version, usually tight to a congatec software release (subsection 1.2b).

1.2a Using the latest available version
Code Block
languagebash
	$ repo init -u <https://git.congatec.com/arm-nxp/imx8-family/yocto/manifest-imx8-family> \
-b cgtimx8mm__imx-linux-sumo \
-m <Repo Manifest File>
	$ repo sync
1.2b Using a specific version

Identification of versions of SW components pertinent to a particular software release is done using Git tag placement inside congatec Git repositories. The Git tag is of the same name as the software release.
The repo tool is not able to use the tag directly, so the commit SHA corresponding to the release tag needs to be used; for convenience we provide a table listing commit SHAs from the manifest-imx8-family repository for the official SW releases.

Code Block
languagebash
	$ repo init -u <https://git.congatec.com/arm-nxp/imx8-family/yocto/manifest-imx8-family> \
-b <Git Commit SHA String> \
-m <Repo Manifest File>
	$ repo sync

SW Release

Git Commit SHA String

rel_cgtsx8m_20-06-16-0

0c25c4a26150ea730a48412db0d24239c0cdf22d

1.3 Configuration of the build directory and environment

The downloaded Yocto sources contain fsl-setup-release.sh script that is used in this step to configure the build directory and build environment. The script takes three inputs in this example - machine the build is being made for (variable MACHINE), distribution to use (variable DISTRO) and name of the build directory (the -b parameter).
The Machine Identification is module dependent and is to be determined as per the table below; regarding distribution the only option is fsl-imx-xwayland - the one currently supported by NXP.

Code Block
languagebash
	$ MACHINE='<Machine Identification>' DISTRO=fsl-imx-xwayland source fsl-setup-release.sh -b build-dir
	[ ! ] EULA accept needed for next step.

Module

Machine Identification

conga-SMX8-Mini

imx8mm-cgt-sx8m

conga-SMX8-Mini

imx8mm-cgt-basler*

\) Has to be selected if Basler camera support is requested; Available only when the Basler manifest file is used*

Note: The configured environment is not persistent; it can be re-configured using command source setup-environment build-dir

1.4. The fsl-image-validation-imx image building

The last step is the image build itself; the bitbake tool does that, taking at least one parameter - the name of the image to build (i.e. the bitbake image name).

Code Block
languagebash
	$ bitbake fsl-image-validation-imx

The available i.MX images are: core-image-minimal, core-image-base, fsl-image-machine-test, fsl-image-validation-imx, and fsl-image-qt5-validation-imx.
Note: The Basler manifest file adds cgt-image-validation-imx-basler, which is the image supporting Basler cameras

After the bitbake finishes, the following files can be found in the tmp/deploy/images/<Machine Identification> subdirectory of the build folder.

File Name

Description

<bitbake image name>-<Machine Identification>.sdcard.bz2

the complete Linux SD card image

<bitbake image name>-<Machine Identification>.ext4

root file system image

Image

Linux kernel image

<Kernel Default DTB>

the default device tree file

imx-boot-<Machine Identification>-sd.bin

boot container for a SD card

Note that this table does not contain all files in the subdirectory

2. Include SDK in the target image (optional)

Development tools and libraries can be included in the target Linux image, which makes software development on the module itself possible. Yocto's features tools-sdk and dev-pkgs are available for the purpose - after the build directory and environment are configured (i.e. after the step 1.3), the features need to be added to the EXTRA_IMAGE_FEATURES variable in theconf/local.conf file. An example that shows the default variable after the update follows

Code Block
languagebash
EXTRA_IMAGE_FEATURES ?= "debug-tweaks tools-sdk dev-pkgs"

The development tools and libraries will be included during the subsequent bitbake run.

3. Build, install, and use the cross-SDK on the Linux Host Machine

The Yocto system is able to build a cross-SDK that can be used for software development on the Linux Host Machine. The command that builds an installation package for the SDK can be invoked after the 1.3 or 1.4 steps.

3.1 Build the cross-SDK installation package

Code Block
languagebash
bitbake core-image-minimal -c populate_sdk

Note: The installation package is located in the tmp/deploy/sdk subdirectory after the build

3.2 Install the SDK

Code Block
languagebash
$ ./tmp/deploy/sdk/fsl-imx-xwayland-glibc-x86_64-core-image-minimal-aarch64-toolchain-4.14-sumo.sh

3.2 Source the SDK toolchain

To use the cross-SDK on the Linux Host Machine, the SDK setup file needs to be sourced as follows

Code Block
languagebash
$ source /opt/fsl-imx-xwayland/4.14-sumo/environment-setup-aarch64-poky-linux
$ unset LDFLAGS

Note: The /opt/fsl-imx-xwayland is the default destination directory as proposed by the SDK installer