Transclusion: CL-SOM-iMX7: Yocto Linux: Building

From Compulab Mediawiki
Jump to: navigation, search

Overview

The Yocto Project is an open-source collaboration focused on embedded Linux development.
The purpose of this article is to show how to get Yocto Image with CL-SOM-iMX7 system-on-module (SoM) support, which includes following derived devices built around the CL-SOM-iMX7 SoM:

  • SBC-iMX7 Single Board Computer
  • SBC-IOT-iMX7 Internet of Things Single Board Computer
  • IOT-GATE-iMX7 Internet of Things Gateway

Learn more about Yocto

Yocto Environment Setup

Yocto host requirements are listed on the Yocto official site

In order to get NXP Yocto BSP building environment please follow the NXP readme file

Next step is getting Compulab BSP meta-layer.

git clone -b master https://github.com/compulab-yokneam/meta-compulab-bsp.git sources/meta-compulab-bsp

The Compulab meta-layer consists of meta-compulab-bsp directory, that provides support for CL-SOM-iMX7 and other Compulab i.MX based machines and contains recipes for U-boot and Linux kernel.

Image Build

This section provides the detailed information about building CL-SOM-iMX7 images.

Setting up build configuration

The NXP Yocto Project BSP Release directory includes a sources directory which contains the various build recipes and a set of scripts used to set up the environment. The recommended script fsl-setup-release.sh simplifies the setup for i.MX machines. To use the script, it is necessary to specify the name of the machine to be built and the required graphical backend. The script sets up a directory and the configuration files for the specified machine and backend.

  • Select the required backend:
Graphical backend is defined by the DISTRO parameter.
Available DISTRO values for CL-SOM-iMX7:
  • fsl-imx-x11 - building X11
  • fsl-imx-fb - building Frame Buffer
  • fsl-imx-xwayland - building XWayland
  • fsl-imx-wayland - building Wayland-Weston
  • imx-wayland-ivi - building Wayland with IVI extension
For example:
export DISTRO=fsl-imx-x11
  • Select the machine:
export MACHINE=cl-som-imx7
  • Select the build directory:
Select a different build directory for each distro. For example:
BUILD_DIR=build-x11
  • Issue the NXP Setup Script:
source fsl-setup-release.sh -b ${BUILD_DIR}
  • Issue Compulab Setup Script:
source ../sources/meta-compulab-bsp/tools/setup-compulab-env

Building images

The Yocto Project build uses the bitbake command.

  • Select one of the the following image recipes
  • fsl-image-validation-imx - provides a gui image without Qt.
  • fsl-image-qt5-validation-imx - provides a Qt5 image
IMAGE_RECIPES=fsl-image-qt5-validation-imx
Issue the bitbake build command:
bitbake ${IMAGE_RECIPES}