Yocto Build Release

From Variscite Wiki


DART-6UL - Yocto Scarthgap 5.0 based on NXP BSP 6.6.23_2.0.0 with 6.6.23_2.0.0 Linux release


Installing required packages

Please make sure your host PC is running Ubuntu 18.04/20.04/22.04/24.04 64-bit and is up to date:

 $ sudo apt-get update && sudo apt-get dist-upgrade

Then, install the following packages:

 $ sudo apt-get install python3 python3-pip python3-pexpect \
 python3-git python3-jinja2 python3-subunit python3-git liblz4-tool \
 python3-jinja2 python3-subunit curl zstd
 

For Ubuntu 20.04 and earlier, install python2:

$ sudo apt-get install python python-pysqlite2

Starting in Ubuntu 22.04, python2 is no longer available. Install the following to create a symbolic link from python to python3:

$ sudo apt-get install python-is-python3

Ubuntu 24.04 introduced additional unprivileged user namespace restrictions. They must be disabled to avoid permission errors during Yocto fetch tasks when using Variscite's docker container.

Disable this restriction on the entire system for one boot:

$ echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns

Alternatively, disable this restriction using a persistent setting by adding a new file (/etc/sysctl.d/60-apparmor-namespace.conf) with the following contents:

$ echo 'kernel.apparmor_restrict_unprivileged_userns=0' | sudo tee /etc/sysctl.d/60-apparmor-namespace.conf
$ sudo sysctl -p /etc/sysctl.d/60-apparmor-namespace.conf


Install Docker:

$ sudo apt update && sudo apt install docker.io qemu-user-static

Give permissions to run Docker without sudo:

$ sudo usermod -aG docker ${USER}
# Logout and login again for the permissions to take effect.

Reference documentation

Download Yocto Scarthgap based on NXP BSP 6.6.23_2.0.0

Configure git user and email:

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

Fetch and install the Google git-repo tool:

$ mkdir -p ~/bin

# For Ubuntu 20.04 and older, install repo 2.32 according to https://gerrit.googlesource.com/git-repo/+/HEAD/docs/python-support.md:
$ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo-2.32 > ~/bin/repo

# For Ubuntu 22.04 and newer, install the latest repo tool:
$ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

# Give repo execute permissions and add it to the path:
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH

Create a build directory:

$ mkdir ~/var-fsl-yocto
$ cd ~/var-fsl-yocto

Now, choose between downloading a release tag, and downloading the latest revision (recommended) and follow only one of the next two bullet sections, accordingly:

  • Download the latest revision (recommended)
$ repo init -u https://github.com/varigit/variscite-bsp-platform.git -b scarthgap -m imx-6.6.23-2.0.0.xml
$ repo sync -j$(nproc)


or

  • Download a release tag

Each release in https://github.com/varigit/variscite-bsp-platform/releases corresponds to a tag.
The tags are also listed in https://github.com/varigit/variscite-bsp-platform/tags
To specify a specific release/tag, run the following:

$ repo init -u https://github.com/varigit/variscite-bsp-platform.git -b refs/tags/TAG_NAME

For example:
$ repo init -u https://github.com/varigit/variscite-bsp-platform.git -b refs/tags/mx6ul-yocto-scarthgap-6.6.23_2.0.0-v1.0 -m imx-6.6.23-2.0.0.xml
$ repo sync -j$(nproc)

Start a Ubuntu Docker container:

$ ./var-start-container.sh 
Note: After Ubuntu Docker container is started you can see the shell prompt similar to: vari@yocto-22-04-fc27a5d:/workdir$

All references to commands without this prompt should be executed in a native terminal (outside Docker).
If you need to run a command using 'sudo' inside the container, the default password is ubuntu.

Setup and build Yocto

Supported images

The following images are provided by Variscite for evaluation purpose

  • fsl-image-gui: Default Variscite demo image with GUI and without any Qt6 content. This image recipe works on all backends for Frame Buffer, Wayland and XWayland and the content is optimized to fit 512MB NAND flash.
  • fsl-image-qt6: Extends fsl-image-gui image with Qt6 support and various Qt samples for Frame Buffer, Wayland and XWayland backends.
Will result in image size greater than 512 MB, which will not fit into NAND flash. Use SD card or eMMC to test.

The following images are provided by FSL Community BSP:

  • fsl-image-machine-test: A console-only image that includes gstreamer packages, Freescale’s multimedia packages (VPU and GPU), and test and benchmark applications.
  • fsl-image-mfgtool-initramfs: Small image to be used with Manufacturing Tool (mfg-tool) in a production environment.
  • fsl-image-multimedia/fsl-image-multimedia-full: A console-only image that includes gstreamer packages and Freescale’s multimedia packages (VPU and GPU).

See the list of Yocto Project’s reference images in Yocto Project Reference Manual

Supported distros

The following distros can be used:

  • fsl-imx-x11: Distro for X11 without wayland. This distro include x11 feature and doesn’ has wayland support.
  • fsl-imx-fb: Distro for Framebuffer graphical backend. This distro doesn’t include X11 and wayland features.
  • fsl-imx-wayland: Distro for Wayland without X11. This distro includes wayland feature but doesn’t have x11 support.
  • fsl-imx-xwayland: Distro for Wayland with X11. This distro includes both wayland and X11 emulation features.

Note: Also standard Poky distros can be used

GStreamer support

FSL community BSP comes with gstreamer-imx, a set of GStreamer1.0 plugins for i.MX platform, which make use of the i.MX multimedia capabilities.
Some of the multimedia plugins do not work well with X11 and Wayland backends.
To get the most from gstreamer-imx, it is recommended to use fslc-framebufer distro with one of the demo images

Build X11 GUI demo image

vari@yocto-22-04-fc27a5d:/workdir$ MACHINE=imx6ul-var-dart DISTRO=fsl-imx-x11 . var-setup-release.sh build_x11

The above command is only mandatory for the very first build setup: whenever restarting a newer build session (from a different terminal or in a different time), you can skip the full setup and just run

vari@yocto-22-04-fc27a5d:/workdir$ source setup-environment build_x11



Optional steps: local.conf customization

launch bitbake:

Without Qt content:
vari@yocto-22-04-fc27a5d:/workdir/build_x11$ bitbake fsl-image-gui

Or with Qt content:
vari@yocto-22-04-fc27a5d:/workdir/build_x11$ bitbake fsl-image-qt6


local.conf customization

Change the downloads directory

Create a /opt/yocto_downloads directory and set its permissions:

vari@yocto-22-04-fc27a5d:/workdir/build_x11$ sudo mkdir /opt/yocto_downloads
vari@yocto-22-04-fc27a5d:/workdir/build_x11$ sudo chmod 777 /opt/yocto_downloads/

Direct downloads to it, by replacing 'DL_DIR ?= "${BSPDIR}/downloads/"' with 'DL_DIR = "/opt/yocto_downloads/"' in conf/local.conf under your build directory:

vari@yocto-22-04-fc27a5d:/workdir/build_x11$ sed -i 's/DL_DIR ?= "${BSPDIR}\/downloads/DL_DIR = "\/opt\/yocto_downloads/g' conf/local.conf

Add Qt creator and Eclipse debug support to your images

Append the following to the conf/local.conf file in your Yocto build directory, to add Eclipse debug support to your images:

EXTRA_IMAGE_FEATURES = " \
    eclipse-debug \
    ssh-server-openssh \
    "

Append the following to the conf/local.conf file in your Yocto build directory, to add Qt creator debug support to your images:

EXTRA_IMAGE_FEATURES = " \
    qtcreator-debug \
    ssh-server-openssh \
    "

Use systemd instead of SysV init

Append the following to the conf/local.conf file in your Yocto build directory, to use systemd instead of SysV init in your images:

DISTRO_FEATURES_append = " systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = ""
IMX_DEFAULT_DISTRO_FEATURES_append = " systemd"

Create a read-only root file system

Append the following to the conf/local.conf file in your Yocto build directory, to create a read-only rootfs:

EXTRA_IMAGE_FEATURES += "read-only-rootfs"

Build Results

The resulting images are located in tmp/deploy/images/imx6ul-var-dart.


Image Name
How to use
fsl-image-gui-imx6ul-var-dart.rootfs.wic.zst This image is for SD card boot.
It can be flashed as-is on an SD card that can then be used to boot your system,
according to the relevant startup-guide of your product
(usually requires to press the boot select button, or toggle a DIP switch).
For detailed information refer to the Create a bootable SD card section below.
fsl-image-gui-imx6ul-var-dart.tar.gz Tarball with rootfs files.
Can be used to create an NFS root file system on the host.
See the Yocto Setup TFTP/NFS section for more info.
Also used to create our extended SD card.
See the Create a bootable SD card section below.
fsl-image-gui-imx6ul-var-dart_128kbpeb.ubi A complete UBI image containing a UBIFS volume, for writing to NAND flash with 128KiB PEB
fsl-image-gui-imx6ul-var-dart_256kbpeb.ubi A complete UBI image containing a UBIFS volume, for writing to NAND flash with 256KiB PEB
zImage Linux kernel image, same binary for SD card/eMMC or NAND flash.
SPL-sd SPL built for SD card boot or eMMC boot.
SPL-nand SPL built for NAND flash.
u-boot.img-sd U-Boot built for SD card boot or eMMC boot.
u-boot.img-nand U-Boot built for NAND flash.
File Name Description
imx6ull-var-dart-6ulcustomboard-emmc-sd-card.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ull-var-dart-6ulcustomboard-emmc-sd-card-wm8731.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ull-var-dart-6ulcustomboard-emmc-wifi-iw61x.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, eMMC & WiFi iw61x enabled. (NAND flash & SD card disabled)
imx6ull-var-dart-6ulcustomboard-emmc-wifi-brcm.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, eMMC & WiFi BRCM enabled. (NAND flash & SD card disabled)
imx6ull-var-dart-6ulcustomboard-emmc-wifi-brcm-wm8731.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, eMMC, WM8731 & WiFi BRCM enabled. (NAND flash & SD card disabled)
imx6ull-var-dart-6ulcustomboard-nand-sd-card.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ull-var-dart-6ulcustomboard-nand-sd-card-wm8731.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ull-var-dart-6ulcustomboard-nand-wifi-iw61x.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, NAND flash & WiFi iw61x enabled. (eMMC & SD card disabled)
imx6ull-var-dart-6ulcustomboard-nand-wifi-brcm.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, NAND flash & WiFi BRCM enabled. (eMMC & SD card disabled)
imx6ull-var-dart-6ulcustomboard-nand-wifi-brcm-wm8731.dtb Device tree blob for DART-6UL with i.MX6ULL SOC, NAND flash, WM8731 & WiFi BRCM enabled. (eMMC & SD card disabled)
imx6ul-var-dart-6ulcustomboard-emmc-sd-card.dtb Device tree blob for DART-6UL with i.MX6UL SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ul-var-dart-6ulcustomboard-emmc-sd-card-wm8731.dtb Device tree blob for DART-6UL with i.MX6UL SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ul-var-dart-6ulcustomboard-emmc-wifi-iw61x.dtb Device tree blob for DART-6UL with i.MX6UL SOC, eMMC & WiFi iw61x enabled. (NAND flash & SD card disabled)
imx6ul-var-dart-6ulcustomboard-emmc-wifi-brcm.dtb Device tree blob for DART-6UL with i.MX6UL SOC, eMMC & WiFi BRCM enabled. (NAND flash & SD card disabled)
imx6ul-var-dart-6ulcustomboard-emmc-wifi-brcm-wm8731.dtb Device tree blob for DART-6UL with i.MX6UL SOC, eMMC, WM8731 & WiFi BRCM enabled. (NAND flash & SD card disabled)
imx6ul-var-dart-6ulcustomboard-nand-sd-card.dtb Device tree blob for DART-6UL with i.MX6UL SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ul-var-dart-6ulcustomboard-nand-sd-card-wm8731.dtb Device tree blob for DART-6UL with i.MX6UL SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ul-var-dart-6ulcustomboard-nand-wifi-iw61x.dtb Device tree blob for DART-6UL with i.MX6UL SOC, NAND flash & WiFi iw61x enabled. (eMMC & SD card disabled)
imx6ul-var-dart-6ulcustomboard-nand-wifi-brcm.dtb Device tree blob for DART-6UL with i.MX6UL SOC, NAND flash & WiFi BRCM enabled. (eMMC & SD card disabled)
imx6ul-var-dart-6ulcustomboard-nand-wifi-brcm-wm8731.dtb Device tree blob for DART-6UL with i.MX6UL SOC, NAND flash, WM8731 & WiFi BRCM enabled. (eMMC & SD card disabled)
imx6ulz-var-dart-6ulcustomboard-emmc-sd-card.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ulz-var-dart-6ulcustomboard-emmc-sd-card-wm8731.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ulz-var-dart-6ulcustomboard-emmc-wifi-iw61x.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, eMMC & WiFi iw61x enabled. (NAND flash & SD card disabled)
imx6ulz-var-dart-6ulcustomboard-emmc-wifi-brcm.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, eMMC & WiFi BRCM enabled. (NAND flash & SD card disabled)
imx6ulz-var-dart-6ulcustomboard-emmc-wifi-brcm-wm8731.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, eMMC, WM8731 & WiFi BRCM enabled. (NAND flash & SD card disabled)
imx6ulz-var-dart-6ulcustomboard-nand-sd-card.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ulz-var-dart-6ulcustomboard-nand-sd-card-wm8731.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ulz-var-dart-6ulcustomboard-nand-wifi-iw61x.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, NAND flash & WiFi iw61x enabled. (eMMC & SD card disabled)
imx6ulz-var-dart-6ulcustomboard-nand-wifi-brcm.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, NAND flash & WiFi BRCM enabled. (eMMC & SD card disabled)
imx6ulz-var-dart-6ulcustomboard-nand-wifi-brcm-wm8731.dtb Device tree blob for DART-6UL with i.MX6ULZ SOC, NAND flash, WM8731 & WiFi BRCM enabled. (eMMC & SD card disabled)
imx6ull-var-som-concerto-board-emmc-sd-card.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULL SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ull-var-som-concerto-board-emmc-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULL SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ull-var-som-concerto-board-emmc-wifi.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULL SOC, eMMC & WiFi enabled. (NAND flash & SD card disabled)
imx6ull-var-som-concerto-board-emmc-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULL SOC, eMMC, WM8731 & WiFi enabled. (NAND flash & SD card disabled)
imx6ull-var-som-concerto-board-nand-sd-card.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULL SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ull-var-som-concerto-board-nand-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULL SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ull-var-som-concerto-board-nand-wifi.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULL SOC, NAND flash & WiFi enabled. (eMMC & SD card disabled)
imx6ull-var-som-concerto-board-nand-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULL SOC, NAND flash, WM8731 & WiFi enabled. (eMMC & SD card disabled)
imx6ul-var-som-concerto-board-emmc-sd-card.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6UL SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ul-var-som-concerto-board-emmc-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6UL SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ul-var-som-concerto-board-emmc-wifi.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6UL SOC, eMMC & WiFi enabled. (NAND flash & SD card disabled)
imx6ul-var-som-concerto-board-emmc-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6UL SOC, eMMC, WM8731 & WiFi enabled. (NAND flash & SD card disabled)
imx6ul-var-som-concerto-board-nand-sd-card.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6UL SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ul-var-som-concerto-board-nand-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6UL SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ul-var-som-concerto-board-nand-wifi.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6UL SOC, NAND flash & WiFi enabled. (eMMC & SD card disabled)
imx6ul-var-som-concerto-board-nand-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6UL SOC, NAND flash, WM8731 & WiFi enabled. (eMMC & SD card disabled)
imx6ulz-var-som-concerto-board-emmc-sd-card.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULZ SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ulz-var-som-concerto-board-emmc-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULZ SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ulz-var-som-concerto-board-emmc-wifi.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULZ SOC, eMMC & WiFi enabled. (NAND flash & SD card disabled)
imx6ulz-var-som-concerto-board-emmc-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULZ SOC, eMMC, WM8731 & WiFi enabled. (NAND flash & SD card disabled)
imx6ulz-var-som-concerto-board-nand-sd-card.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULZ SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ulz-var-som-concerto-board-nand-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULZ SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ulz-var-som-concerto-board-nand-wifi.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULZ SOC, NAND flash & WiFi enabled. (eMMC & SD card disabled)
imx6ulz-var-som-concerto-board-nand-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Concerto board with i.MX6ULZ SOC, NAND flash, WM8731 & WiFi enabled. (eMMC & SD card disabled)
imx6ull-var-som-symphony-board-emmc-sd-card.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULL SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ull-var-som-symphony-board-emmc-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULL SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ull-var-som-symphony-board-emmc-wifi.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULL SOC, eMMC & WiFi enabled. (NAND flash & SD card disabled)
imx6ull-var-som-symphony-board-emmc-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULL SOC, eMMC, WM8731 & WiFi enabled. (NAND flash & SD card disabled)
imx6ull-var-som-symphony-board-nand-sd-card.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULL SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ull-var-som-symphony-board-nand-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULL SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ull-var-som-symphony-board-nand-wifi.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULL SOC, NAND flash & WiFi enabled. (eMMC & SD card disabled)
imx6ull-var-som-symphony-board-nand-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULL SOC, NAND flash, WM8731 & WiFi enabled. (eMMC & SD card disabled)
imx6ul-var-som-symphony-board-emmc-sd-card.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6UL SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ul-var-som-symphony-board-emmc-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6UL SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ul-var-som-symphony-board-emmc-wifi.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6UL SOC, eMMC & WiFi enabled. (NAND flash & SD card disabled)
imx6ul-var-som-symphony-board-emmc-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6UL SOC, eMMC, WM8731 & WiFi enabled. (NAND flash & SD card disabled)
imx6ul-var-som-symphony-board-nand-sd-card.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6UL SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ul-var-som-symphony-board-nand-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6UL SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ul-var-som-symphony-board-nand-wifi.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6UL SOC, NAND flash & WiFi enabled. (eMMC & SD card disabled)
imx6ul-var-som-symphony-board-nand-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6UL SOC, NAND flash, WM8731 & WiFi enabled. (eMMC & SD card disabled)
imx6ulz-var-som-symphony-board-emmc-sd-card.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULZ SOC, eMMC & SD card enabled. (NAND flash & WiFi disabled)
imx6ulz-var-som-symphony-board-emmc-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULZ SOC, eMMC, WM8731 & SD card enabled. (NAND flash & WiFi disabled)
imx6ulz-var-som-symphony-board-emmc-wifi.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULZ SOC, eMMC & WiFi enabled. (NAND flash & SD card disabled)
imx6ulz-var-som-symphony-board-emmc-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULZ SOC, eMMC, WM8731 & WiFi enabled. (NAND flash & SD card disabled)
imx6ulz-var-som-symphony-board-nand-sd-card.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULZ SOC, NAND flash & SD card enabled. (eMMC & WiFi disabled)
imx6ulz-var-som-symphony-board-nand-sd-card-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULZ SOC, NAND flash, WM8731 & SD card enabled. (eMMC & WiFi disabled)
imx6ulz-var-som-symphony-board-nand-wifi.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULZ SOC, NAND flash & WiFi enabled. (eMMC & SD card disabled)
imx6ulz-var-som-symphony-board-nand-wifi-wm8731.dtb Device tree blob for VAR-SOM-6UL on Symphony board with i.MX6ULZ SOC, NAND flash, WM8731 & WiFi enabled. (eMMC & SD card disabled)


Create a bootable SD card

SD Card Structure

This is the structure of our Recovery/Extended SD card:
SD card partitions


The SD card is divided into 3 sections as shown in the picture above:

  • The first unallocated 4MiB are saved space for U-Boot. It can be replaced using the dd command as described in the Yocto Build U-Boot section.
  • The first partition is a fat16 partition used for the device tree files and the kernel image file. You can copy them as described in the Yocto Build Linux section.
  • The second partition is an ext4 partition that contains the complete root filesystem (including the kernel modules).


Note: This partition includes an unallocated area to ensure compatibility with all 8 GB SD cards, as their actual sizes may vary. For instructions on optimizing the usage of your SD card's capacity, refer to the section Extending the SD Card Size.

Yocto pre-built bootable SD card

The Yocto build products contains many files as explained in the Build Results section. For example, fsl-image-gui-imx6ul-var-dart.rootfs.wic.zst, depending on your build. This is a complete and bootable image ready to be flashed directly to an SD card.

Example usage:

$ sudo umount /dev/sdX*
# For GUI-X11 & Qt6-X11
$ cd ~/var-fsl-yocto/build_x11
Or
# For Qt6-FB
$ cd ~/var-fsl-yocto/build_fb

# For fsl-image-gui image (GUI-X11)
$ sudo dd if=tmp/deploy/images/imx6ul-var-dart/fsl-image-gui-imx6ul-var-dart.rootfs.wic.zst of=/dev/sdX bs=1M && sync
Or
# For fsl-image-qt6 image (Qt6-X11 & Qt6-FB)
$ sudo dd if=tmp/deploy/images/imx6ul-var-dart/fsl-image-qt6-imx6ul-var-dart.rootfs.wic.zst of=/dev/sdX bs=1M && sync

Replace sdX with the right device name. This can be obtained by "dmesg" command on your host Linux PC, after the SD card reader is inserted.


Note: Booting your system from an SD card requires pressing the boot-select button, or switching the relevant DIP switch to "Boot from SD card", according to the relevant start-up guide of your system


Note: If using any of the native .rootfs.wic.zst images output from Yocto, these will only have a default partition size of slightly less than 8 GB in order to fit on most SD cards. In order to maximize all usable space on the SD card, please see the section on Extending the SD Card Size.

Yocto Recovery Image

Beginning in Yocto Langdale, Variscite has released a new recovery Yocto image recipe called "var-recovery-image." This image is used to create a bootable SD card that contains another target image to be programmed to the eMMC. See the yocto Recovery SD card or the more manual Installing Yocto to the SOM's internal storage articles for specifics of installing a recovery image.

Usage:

By default, the recovery image boots fsl-image-gui and contains a fsl-image-gui target image to be programmed to eMMC. You can also specify a different target eMMC image to be embedded in the recovery image by setting this variable in local.conf:

VAR_RECOVERY_TARGET_ROOTFS = "<desired-emmc-image-recipe>"

Additionally, the recovery image output file name can be modified by setting something like the following in local.conf:

VAR_RECOVERY_SD_NAME = "mx6ul__yocto-scarthgap-6.6.23_2.0.0-v1.0"

This is an example of configurations added to local.conf:

VAR_RECOVERY_SD_NAME = "mx6ul__yocto-scarthgap-6.6.23_2.0.0-v1.0"
VAR_RECOVERY_SD_IMAGE = "recipes-fsl/images/fsl-image-gui-chromium.bb"
VAR_RECOVERY_TARGET_ROOTFS = "fsl-image-gui-chromium"

To create a recovery image, run the following from your Yocto environment:

vari@yocto-22-04-fc27a5d:/workdir/build_x11$ bitbake var-recovery-image

Using the default configuration, this will produce an output relative to the build folder of "./tmp/deploy/images/imx6ul-var-dart/var-recovery-image-imx6ul-var-dart.rootfs.wic.zst" that can be flashed to the SD card.
If you set the variables mentioned above, this will produce a recovery image relative to the build folder of "./tmp/deploy/images/imx6ul-var-dart/mx6ul__yocto-scarthgap-6.6.23_2.0.0-v1.0.wic.zst"

Note: Please see the var-recovery-image recipe source for advanced usages of the recovery image.

Extending the SD Card Size

Flashing the default .rootfs.wic.zst images from Yocto results in a rootfs that does not utilize the entire SD card. This section explains how the SD card can be extended on the build host after flashing.

Procedure:

Begin with an SD card on which you have previously flashed a Yocto .rootfs.wic.zst image. Ensure the SD card is inserted and the device present (i.e. /dev/sda, /dev/mmcblk0, etc.)

Note: Below replace /dev/sdX with your actual device (i.e. /dev/sda)

Start by running fdisk as below and typing "p" and enter to print current partitions. You should see a layout similar to below but numbers may differ depending on card sizes. Note that the partition starts at 16,384 (bytes offset 16384*512) which is to account for the boot content explained above.

$ sudo fdisk /dev/sdX

Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdX: 59.48 GiB, 63864569856 bytes, 124735488 sectors                                                                                              
Disk model: MassStorageClass                                                                                                                                
Units: sectors of 1 * 512 = 512 bytes                                                                                                                       
Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                       
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                                                           
Disklabel type: dos                                                                                                                                         
Disk identifier: 0x5ebf1617                                                                                                                                 
                                                                                                                                                           
Device     Boot Start      End  Sectors  Size Id Type                                                                                                       
/dev/sdX1       16384 15165439 15149056  7.2G 83 Linux

Next, run the following sequence of commands followed by enter with each step explained with a "-" to the right. Each command/input should be followed by enter:

  • d - Delete current partition (1).
  • n - Create a new parition.
  • - Empty, hit enter only which will leave default response p for primary partition.
  • - Empty, hit enter only which will leave default response 1 for first partition.
  • 16384 - Enter 16384 to begin partition past bootloader section.
  • - Empty, hit enter only which will leave last sector as default which should choose ending size of the SD card.
  • N - Answers no to not remove the ext4 signature on the disk
  • p - Print output and verify before we write. We should see the starting offset the same and the end expanded to fill the SD card.
  • w - Write output to disk


See the full log of the above sequence below:

Command (m for help): d                                                                                                                                     
Selected partition 1                                                                                                                                        
Partition 1 has been deleted.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-124735487, default 2048): 16384
Last sector, +/-sectors or +/-size{K,M,G,T,P} (16384-124735487, default 124735487): 

Created a new partition 1 of type 'Linux' and of size 59.5 GiB.
Partition #1 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: N

Command (m for help): p

Disk /dev/sdX: 59.48 GiB, 63864569856 bytes, 124735488 sectors
Disk model: MassStorageClass
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
identifier: 0x5ebf1617

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdX1       16384 124735487 124719104 59.5G 83 Linux

Command (m for help): w

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.


Finally, the file system needs to be resized on the disk to fill the now larger partition. Do that as follows:

$ sudo e2fsck -f /dev/sdX1                                                    
e2fsck 1.46.5 (30-Dec-2021)                                                                                                                                 
root: recovering journal                                                                                                                                    
Pass 1: Checking inodes, blocks, and sizes                                                                                                                  
Pass 2: Checking directory structure                                                                                                                        
Pass 3: Checking directory connectivity                                                                                                                     
Pass 4: Checking reference counts                                                                                                                           
Pass 5: Checking group summary information                                                                                                                  
root: 43155/947488 files (0.1% non-contiguous), 674097/1893632 blocks

$ sudo resize2fs /dev/sdX1                                                    
resize2fs 1.46.5 (30-Dec-2021)                                                                                                                              
Resizing the filesystem on /dev/sdX1 to 15589888 (4k) blocks.                                                                                               
The filesystem on /dev/sdX1 is now 15589888 (4k) blocks long.

$ sync


Again, numbers and output should differ slightly depending on your card.

Your rootfs image should now fill the entire SD card and is ready to boot.

Boot the board with a bootable SD card

Note: The WiFi is not operational when booting from SD card, as the WiFi and SD card are using the same SDIO interface.
A typical use-case is to boot from an SD card, flash the eMMC/NAND flash, and re-boot from the eMMC/NAND flash to have the WiFi operational.

Setting the Boot Mode

Booting your system from an SD card requires switching the Boot DIP switches. See picture below.
On the VAR-6ULCustomBoard (with a DART-6UL):

Boot switch 6ul1.jpg
  • "00" The current position in the picture will set the system to boot from SD card
  • "01" Moving the right switch will set the system to boot from eMMC
  • "10" Moving the left switch will set the system to boot from NAND flash
  • "11" is illegal.
Be aware that your system has eMMC or NAND but never both.



On the Concerto-Board (with a VAR-SOM-6UL):

Boot switch concerto.jpg
  • ON-EXT: Boot from the external storage (SD card) - the current position in the picture
  • OFF-INT: Boot from the SOM's internal storage (eMMC/NAND flash)


Automatic device tree selection in U-Boot

As shown in the Build Results table above, we have different kernel device trees, corresponding to our different H/W configurations.
We implemented a script in U-Boot's environment, which sets the fdt_file environment variable based on the detected hardware.

Enable/Disable automatic device tree selection

To enable the automatic device tree selection in U-Boot (already enabled by default):

$ setenv fdt_file undefined
$ saveenv

To disable the automatic device tree selection in U-Boot, set the device tree file manually:

$ setenv fdt_file YOUR_DTB_FILE
$ saveenv

Useful example: To list all files in the boot partition (where the dtb files are by default) of an SD card:

$ ls mmc 0:1
Comment:
Make sure you don't set an inappropriate dtb file, like a dtb with nand on a SOM that has eMMC, or a dtb for mx6ull on a SOM with an mx6ul SOC.

Flash images to NAND/eMMC

Please refer to Yocto NAND Flash Burning guide.

Yocto Image Customization

Update Yocto Scarthgap to latest revision

From time to time we update the Yocto sources (especially meta-variscite) with new features and bug fixes.
Follow the Download the latest revision (recommended) bullet section of the Download Yocto Scarthgap based on Freescale Community BSP step again to update your tree to the latest revision, and rebuild your image.

Update Yocto Scarthgap to a release tag

Follow the Download a release tag bullet section of the Download Yocto Scarthgap based on Freescale Community BSP step to update your tree to a release tag, and rebuild your image.

Forcing Clean Build

In order to update the kernel, U-Boot and rootfs:
vari@yocto-22-04-fc27a5d:/workdir/build_x11$ bitbake -c cleanall u-boot-variscite linux-variscite kernel-module-imx-gpu-viv ti-compat-wireless-wl18xx wl18xx-firmware cryptodev-module

for GUI image
vari@yocto-22-04-fc27a5d:/workdir/build_x11$ bitbake -c clean fsl-image-gui
for Qt6 image
vari@yocto-22-04-fc27a5d:/workdir/build_x11$ bitbake -c clean fsl-image-qt6

Qt6 for Embedded Linux

To run Qt6 applications without X11 backend the platform specific plugins (e.g. EGLFS or LinuxFB) should be configured with QT_QPA_PLATFORM environment variable or with -platform command-line.

See more information on Qt6 customization for Embedded Linux here

Configure LinuxFB Plugin

DART-6UL supports only LinuxFB plugin

export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:size=800x480:mmSize=160x95

LinuxFB plugin is optimized for not accelerated platforms, but do not provide rotation capabilities.

If required you may be interested in reading this article, providing a dedicate patch and usage instructions.

To integrate the patch in yocto BSP, you are supposed to:

  • copy the plane patch in the folder
  ~/var-fsl-yocto/sources/meta-variscite-sdk-imx/dynamic-layers/qt6-layer/recipes-qt/qt6/qtbase
  • add the reference patch in the SRC_URI_append section of file
  ~/var-fsl-yocto/sources/meta-variscite-sdk-imx/dynamic-layers/qt6-layer/recipes-qt/qt6/qtbase_%.bbappend

Configure Touch Input

When no windowing system is present, the mouse, keyboard, and touch input are read directly via evdev or tslib.

Evdev

By default, the Qt6 uses automatic device discovery based on libudev. In case you want to override the default touchscreen configuration the following parameters can be used:

  • /dev/input/... - Specifies the name of the input device. When not given, Qt looks for a suitable device either via libudev or by walking through the available nodes.
  • rotate - On some touch screens the coordinates must be rotated, which is done by setting rotate to 90, 180, or 270.
  • invertx and inverty - To invert the X or Y coordinates in the input events, pass invertx or inverty.
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS='/dev/input/touchscreen0'

Tslib

Tslib is used for resistive single-touch touchscreens and should be pre-configured with:

export TSLIB_TSEVENTTYPE='INPUT'
export TSLIB_TSDEVICE='/dev/input/touchscreen0'
export TSLIB_CALIBFILE='/etc/pointercal'
export TSLIB_CONFFILE='/etc/ts.conf'
export TSLIB_CONSOLEDEVICE='none'
export TSLIB_FBDEVICE='/dev/fb0'
export TSLIB_PLUGINDIR='/usr/lib/ts'
export QT_QPA_EGLFS_TSLIB=1 
export QT_QPA_FB_TSLIB=1 

It is recommended to put the above setup inside /etc/profile.d/tslib.sh.

Running Qt6 Applications

$ cd /usr/share/cinematicexperience-1.0; ./Qt5_CinematicExperience --platform linuxfb
$ cd /usr/share/qt5everywheredemo-1.0; ./QtDemo --platform linuxfb
$ cd /usr/share/qtsmarthome-1.0; ./smarthome --platform linuxfb

UBIFS

By default we create ubifs image for 512MB NAND flash size. You can change the size by editing ~/var-fsl-yocto/sources/meta-variscite-bsp-imx/conf/machine/include/variscite.inc
and comment / uncomment the relevant section based on size.

DDR size and Contiguous Memory Allocator

By default Freescale allocates 256MB of RAM to the Contiguous Memory allocator. This is for proper operation of the IPU VPU, X11 etc. On VAR-SOM-SOLO with 256MB DDR RAM size, it will cause a kernel freeze during boot. Adding cma=32MB to the bootargs parameters is required to fix.

Make changes to the rootfs

The following is usually not the recommended way to work with Yocto.
You should usually create new specific recipes (.bb files) and/or append to specific present recipes by using .bbappend files.
However, if you are not yet experienced enough with Yocto, and you just want to quickly add your files to the resultant file system (or make any other change to it), you can do it in a general way, by using the following variable:

ROOTFS_POSTPROCESS_COMMAND

    Specifies a list of functions to call once the OpenEmbedded build system has created the root filesystem.
    You can specify functions separated by semicolons:

         ROOTFS_POSTPROCESS_COMMAND += "function; ... "                  

    If you need to pass the root filesystem path to a command within a function, you can use ${IMAGE_ROOTFS},
    which points to the directory that becomes the root filesystem image. See the IMAGE_ROOTFS variable for more information. 

The functions will be called right after the root filesystem is created and right before it is packed to images (.rootfs.wic.zst, .ubi, .tar.gz, etc.).

Example

Let's say you have your files that you want to put in the filesystem arranged on your host under a directory called /my_rootfs_additions, like the following:

my_rootfs_additions/
├── data
│   ├── example.m4v
│   └── example.bin
├── etc
│   └── example.conf
└── home
    └── root
        └── .example

And let's say you want to build the fsl-image-gui image.

Create a file called ~/var-fsl-yocto/sources/meta-variscite-bsp-imx/recipes-images/images/fsl-image-gui.bbappend
with the following content:

add_my_files() {
    cp -r /my_rootfs_additions/*  ${IMAGE_ROOTFS}/
}

ROOTFS_POSTPROCESS_COMMAND += "add_my_files;"

Now, when you bitbake fsl-image-gui, the files in /my_rootfs_additions will be added to the rootfs (be careful when overwriting files).

Useful Bitbake commands

Bitbake Cheat Sheet

Useful bitbake commands

i.MX Yocto Project: ltib versus bitbake