Search by Tags

Build Apalis iMX8/Colibri iMX8X OpenEmbedded/Yocto Project Bring-up Image

 
Applicable for

Compare with Revision


Subscribe for this article updates

This article describes how to build the Yocto/OpenEmbedded validation image for the Apalis iMX8/Colibri iMX8X modules.

Module SoC NXP BSP on which the Image is based
Apalis iMX8QM NXP® i.MX 8QuadMax morty-4.9.51-8qm_beta2
Colibri iMX8QXP NXP® i.MX 8QuadXPlus rocko-4.9.123-2.3.0_8mm_ga

Introduction

The Yocto/OpenEmbedded layers for the image are stored on Github:

The U-Boot and Linux kernel source code with the Toradex hardware specific modifications is stored on git.toradex.com. When building an image using the OpenEmbedded/Yocto Project build system the U-Boot boot loader and Linux kernel will automatically be downloaded from those repositories during build.

Prerequisites

Module Yocto Project Codename / Version manifest-branch manifest-file
Apalis iMX8QM morty / 2.2 toradex-linux-morty toradex-4.9.51-8qm_beta2_bring_up.xml
Colibri iMX8QXP rocko / 2.4 toradex-linux-rocko toradex-4.9.123-2.3.0-8mm_ga.xml

Please make sure you use a supported Linux distribution and install required prerequisites as documented by the Yocto Project Reference Manual System Requirements chapter.

For easier git repository management the utility repo is used. The repo bootstrap binary can be installed using the following commands:

mkdir ~/bin
export PATH=~/bin:$PATH
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

Build Environment Setup

Use the manifest-branch and manifest-file values from the table above.

mkdir imx-yocto-bsp
cd imx-yocto-bsp
repo init -u git://github.com/toradex/imx-manifest.git -b <manifest-branch> -m <manifest-file>
repo sync

When this process is completed, the source code is checked out into the directory imx-yocto-bsp/sources.

Image Build

Module machine distro build directory
Apalis iMX8QM apalis-imx8 fsl-imx-x11 build
Colibri iMX8QXP colibri-imx8qxp fsl-imx-xwayland build

Note: With the rocko-4.9.123-2.3.0_8mm_ga NXP dropped support for X11 on i.MX8, so we use XWayland instead.

MACHINE=<machine> DISTRO=<distro> source fsl-setup-release.sh -b <build directory>

And build an image using

bitbake -k fsl-image-validation-imx

Depending on the performance of your machine this can take several hours. Once the build is completed you can find the build output in the folder tmp/deploy/images/<machine>/.
The file <image-recipe>-<machine>-<timestamp>.rootfs.sdcard.bz2 contains the compressed SD card image which was built. E.g. fsl-image-validation-imx-apalis-imx8-20181112152953.rootfs.sdcard.bz2.
The SD card image contains a completely bootable system, including the SCU firmware, boot loader, a FAT boot partition with the Linux kernel and device tree and an ext4 rootfs partition.

Image Deployment

Since Apalis iMX8/Colibri iMX8X currently boot from an SD card, the image can be directly written to an SD card. Use lsblk or a similar utility to find the SD card on your Linux host machine. All data on it will be destroyed! Make sure to unmount any mounted partition first (e.g. using umount).

Write the resulting image to an SD card (depending on your Linux host replace <sdcard> with /dev/sdX or /dev/mmcblkX)

sudo umount /dev/<sdcard>?
bzcat fsl-image-validation-imx-apalis-imx8-20181112152953.rootfs.sdcard.bz2 | sudo dd of=/dev/<sdcard> bs=4M
sync

More Resources