Versions Compared

Key

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

A x86 based Linux system with installed cross compile toolchain is required to develop Yocto based software for i.MX 8-based designs. It is possible to use a virtual machine that runs Linux but a dedicated system with Ubuntu is preferrable. Furthermore, the host should have a serial port to access the debug console and an SD card reader.

This guide shows the procedure for Yocto Project 2.5 (Sumo) as an example. Use the latest Yocto release whenever possible.

Setting up and building Yocto

1. Installation in Ubuntu 16.04 64 bit (Clean install)

Setup a clean Ubuntu 16.04 64bit system installation on your preferred devlopment workstation.

2. additional packages

Install some additional packages that are required for building Yocto successfully:

Code Block
	$ 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 
2.1 Repo

A previous version of repo tool is required to work in combination with the Ubuntu 16.04

Code Block
    $ curl <https://storage.googleapis.com/git-repo-downloads/repo-1> > repo
    $ chmod a+rx repo
    $ sudo cp repo /usr/bin

3. Configure the local git

Code Block
	$ git config --global user.email "youremail"
	$ git config --global user.name "Your name"

4. Fetch the yocto recipes

Code Block
    $ mkdir ~/yocto
    $ cd ~/yocto
    $ repo init -u <https://git.congatec.com/arm-nxp/imx8-family/yocto/manifest-imx8-family.git> -b cgtimx8__sumo-4.14.98-2.3.2
    $ repo sync

4.1 Solve git-lfs error

The following modification should be applied into the sourcers/poky/meta/conf/bitbake.conf file, to avoid a fatal error while bitbaking. Adding the following lines into the mentioned file, will solve the error.

Code Block
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index ac403b188b..323241fad4 100644
--- a/sourcers/poky/meta/conf/bitbake.conf
+++ b/sourcers/poky/meta/conf/bitbake.conf
@@ -501,6 +501,9 @@ HOSTTOOLS_NONFATAL += "bzr"
 # Used by ssh fetcher
 HOSTTOOLS_NONFATAL += "scp"
+# Link to git-lfs if present
+HOSTTOOLS_NONFATAL += "git-lfs"
+
 CCACHE ??= ""
 # ccache < 3.1.10 will create CCACHE_DIR on startup even if disabled, and
 # autogen sets HOME=/dev/null so in certain situations builds can fail.

5. Configure the build environment for the target module

Code Block
	$ MACHINE='imx8qm-cgtsmx8' DISTRO=fsl-imx-wayland source fsl-setup-release.sh -b build-smx8
	[ ! ] EULA accept needed for next step.
5.1 Memory selection

The Yocto variable MEMORY_PRESENT is included to select the different memory configurations for the different variants

Possible values of MEMORY_PRESENT are:

  • "2GB"

  • "4GB"

By default is set to 4GB. If the 2GB memory variant is the target, please add the following line into your conf/local.conf file with the correspoding memory size:

Code Block
    MEMORY_PRESENT = "2GB"

The variable is used in u-boot and imx-sc-firmware to select consistenly the memory present on the target hardware.

5.2 H&D Wireless SPB228

this section applies to the conga-SMX8 variants with onboard Wifi option only

In order to support the HD-Wireless SBP228 module that is assembled on the conga-SMX8 Wifi variants, the Yocto-BSP incorporates the layer meta-spb228-pcie-usb
in its sources directory. The layer ensures that all required kernel components are added to the image during the build process.

By default, the WLAN regulatory domain is set to US. In order to change the default country, modify the file sources/meta-spb228-pcie-usb/recipes-kernel/spb228-pci-usb/linux-pcie-usb-driver-228.bb and set the country code according to the ISO 3166-1 alpha-2, modifying the "US" to the alpha-2 code of the desired country, in the following line:

Code Block
module_conf_pcie8997 = "options pcie8997 fw_name=${FW_PATH}/${FW_FILE} cal_data_cfg=none drv_mode=3 mfg_mode=0 cfg80211_wext=0x0F reg_alpha2=US cntry_txpwr=1"

e.g. in order to set Germany (DE) as default country:

Code Block
languagediff
-module_conf_pcie8997 = "options pcie8997 fw_name=${FW_PATH}/${FW_FILE} cal_data_cfg=none drv_mode=3 mfg_mode=0 cfg80211_wext=0x0F reg_alpha2=US cntry_txpwr=1"
+module_conf_pcie8997 = "options pcie8997 fw_name=${FW_PATH}/${FW_FILE} cal_data_cfg=none drv_mode=3 mfg_mode=0 cfg80211_wext=0x0F reg_alpha2=DE cntry_txpwr=1"

Attention: The onboard Wifi module is connected via the 2nd PCIe interface (pcieb) of the i.MX 8 SOC. This interface is disabled by default and has to be activated by
the corresponding DTB file during kernel boot. To do this, either imx8qm-cgtsmx8-pcieb.dtb or imx8qm-cgtsmx8-hdmi-pcieb.dtb have to be specified for the
bootloader environment variable "fdt_file".

See also: i.MX 8QM HD Wireless SPB228 Wifi Module

6. Build the image, e.g. fsl-image-qt5

Code Block
	$ bitbake fsl-image-qt5

Depending on the performance of the development system, this process might take hours.

When it finishes the image will be located under the build folder: tmp/deploy/images/imx8qm-cgtsmx8

Transfering the root filesystem to uSD card

In order to transfer the image to a uSD card, follow the next steps changing sdX for your detected device:

Code Block
	$ cd ~/yocto/build-smx8/tmp/deploy/images/imx8qm-cgtsmx8/
	$ bzip2 -df fsl-image-qt5-imx8qm-cgtsmx8.sdcard.bz2
	$ sudo dd if=fsl-image-qt5-imx8qm-cgtsmx8.sdcard of=/dev/sdX
	$ sync

Device tree blob (*.dtb)

The default devicetree blob configured in the bootloader is "imx8qm-cgtsmx8.dtb" (defined in the environment variable "fdt_file" of the bootloader).
There are additional devicetree blobs provided for special use cases:

  • imx8qm-cgtsmx8.dtb: LVDS graphical output (default)

  • imx8qm-cgtsmx8-hdmi.dtb: HDMI graphical output

  • imx8qm-cgtsmx8-dsi.dtb: DSI ADV7533 suppport

  • imx8qm-cgtsmx8-mipi-ov5640.dtb: OV5640 camera support

  • imx8qm-cgtsmx8-pcieb.dtb: Enable 2nd PCIe interface (pcieb)

  • imx8qm-cgtsmx8-hdmi-pcieb.dtb: HDMI graphical output and 2nd PCIe interface enabled (pcieb)

  • imx8qm-cgtsmx8-lpuart2.dtb: LPuart2 enabled, disables GPIO5 and GPIO10

  • imx8qm-cgtsmx8-edp.dtb: eDP graphical output

  • imx8qm-cgtsmx8-hdmi-edp: eDP and HDMI graphical output

  • imx8qm-cgtsmx8-hdmi-lvds.dtb: HDMI and LVDS graphical output

  • imx8qm-cgtsmx8-hdmi-lvds-edp.dtb: HDMI, LVDS and eDP graphical output

Changing the device tree blob

In order to change the device tree configuration, power-on the board and stop the boot process on bootloader level.
Specify the desired .dtb file in the variable fdt_file, e.g.:

Code Block
	$ setenv fdt_file imx8qm-cgtsmx8-hdmi.dtb
	$ savee
	$ boot

Provided Boot Container

The boot container (that incorporates the bootloader) in this BSP release is prepared for programming on the SPI.
This is achieved by using the "cgtsmx8_fspi_defconfig" during the bootloader configuration process.