VAR-SOM-MX6 Yocto GS R6 B1

From Variscite Wiki
VAR-SOM-MX6 - Yocto fsl-L3.10.31-1.1.0 Daisy R6


  • This Yocto Daisy release is based on Freescale fsl-L3.10.31- release.
  • Beta 2 version.

Main features:

    • Yocto Daisy.
    • Linux kernel: linux-imx_3.10.31_1.0.0_beta.
    • Uboot: imx_v2013.10_beta_var4.
    • QT5 X, QT5 Embedded
    • Yocto Daisy: Based on fsl-L3.10.31-1.1.0_iMX6qdls Freescale release. Yocto Daisy support code is located in meta-variscite folder.

Supported hardware and features

Board support

i.MX6 Quad
i.MX6 Dual
i.MX6 Dual lite
i.MX6 Solo

Software platform

Yocto Daisy release.
Freescale release version 4.1
Meta freescale community release for Daisy

Nand Recovery
NAND Flash size support
128MB up to 1GB
up to 64GB
DDR size support configuration
Solo:up to 1GB. DualLite, Dual, Quad: up to 4GB
10/100/1000 Mbps Ethernet
Support for Wilink8, Dual band 5.0ghz + MIMO b/g/n
CAN bus
USB host
Device / Host
x3, up to 3.6 Mbps. Minicom avilable to use with the port
Display HDMI 720P,1080P LVDS0 (On board LVDS to RGB bridge, EVK supports 800x480 resolution) LVDS1 external display
Audio Line IN/ Line out
Camera ov5640 camera sensor. CB402 board can be purchased separately

Variscite Yocto Daisy release 2 Beta for Freescale i.MX6.

Installing required packages

Follow the link below and install all required packages on your machine.

For example, if your building machine is an Ubuntu machine:

sudo apt-get install gawk wget git-core diffstat unzip texinfo build-essential chrpath libsdl1.2-dev xterm lzop

Variscite Yocto build was tested with Ubuntu 12.04 LTS only!

Download Yocto Daisy for i.MX6 with Variscite VAR-SOM-MX6 support

Use  "repo" to fetch Yocto and apply Variscite's patches for the BSP support:

  • Install the `repo` utility:
$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ curl > ~/bin/repo
$ chmod a+x ~/bin/repo
Add the following line to the .bashrc file to ensure that the ~/bin folder is in your PATH variable
$ export PATH=~/bin:$PATH
Reference repo is available on FTP.
  • Clone Yocto Daisy from Freescale's git:
$ cd ~
$ mkdir var-som-mx6-daisy-v6
$ cd var-som-mx6-daisy-v6
$ git config --global "Your Name"
$ git config --global "Your Email"
$ repo init -u git:// -b imx-3.10.31-1.1.0_beta
$ repo sync
  • Download
  • Extract tarball:
$ cd ~/var-som-mx6-daisy-v6
$ tar xvf ~/Downloads/var_yocto_v6b2.tar.bz2
$ variscite/install
This method will preserve the git repositories. It will enable you to track Variscite's changes, and your own.

Setup and build Yocto QT5/X

Setup the environment and use build_var folder

$ cd ~/var-som-mx6-daisy-v6
$ source -b build_x11 -e x11
If you close your terminal and wish to build Yocto again, you should do:

$ cd ~/var-som-mx6-daisy-v6

$ . ./setup-environment build_x11

Setup and build Yocto QT5/Embedded

Setup the environment and use build_var folder

$ cd ~/var-som-mx6-daisy-v6
$ source -b build_fb -e fb
If you close your terminal and wish to build Yocto again, you should do:

$ cd ~/var-som-mx6-daisy-v6

$ . ./setup-environment build_fb

local.conf customizations

Edit you local.conf file:

$ gedit conf/local.conf 

Change parallel build and download directory: Set the build parameters to fully utilize your host machine's resources
BB_NUMBER_THREADS should be your host machine's number of threads minus 2 or same. PARALLEL_MAKE should be the number of threads your host machine has plus two.

Change packages download directory. By default it is set to: DL_DIR ?= "${BSPDIR}/downloads/" change it to a global folder like DL_DIR ?= "/opt/yocto_dl/". Don't forget to create the folder and make it available without a sudo permeation.

Build your image

$ bitbake fsl-image-qt5 

The resulted images are locaated in tmp/deploy/images/varsomimx6.
Looking at tmp/deploy/images/varsomimx6 you will find 6 main files that are linked to the actual file

Image Name
How to use
Not in Use

This image is for SD-Card boot. Default u-boot is built for SDCARD. Booting from SD-Card is explained in details below.

$ sudo dd if=tmp/deploy/images/varsomimx6/fsl-image-qt5-varsomimx6.sdcard of=/dev/sdX bs=1024k

devxxx = mmcblk0 or sdX. Do dmesg after you insert an SD-Card into your build system to figure out the device name

Use "$ sudo gparted /dev/devxxx"
  • Lable the second partition and call it "rootfs".
  • Increase the second partition to include all avilable sd-card space.

Used to create an NFS root file system on the host.

$ sudo mkdir ../rootfs
$ sudo rm -rf ../rootfs/*
$ sudo tar xvf tmp/deploy/images/varsomimx6/fsl-image-qt5-varsomimx6.tar.bz2 -C ../rootfs

See apendix for setting an NFS server


Use the sdcard created above. Copy the file into it and use the following commands to flash them into nand.
Coping files (mount the sd-card created above first):

$ sudo mkdir /media/rootfs/opt/images
$ sudo cp tmp/deploy/images/varsomimx6/uImage     /media/rootfs/opt/images
$ sudo cp tmp/deploy/images/varsomimx6/uImage-imx6q-var-som.dtb /media/rootfs/opt/images/imx6q-var-som.dtb
$ sudo cp tmp/deploy/images/varsomimx6/uImage-imx6dl-var-som.dtb /media/rootfs/opt/images/imx6dl-var-som.dtb
$ sudo cp tmp/deploy/images/varsomimx6/uImage-imx6dl-var-som-solo.dtb /media/rootfs/opt/images/imx6dl-var-som.dtb
$ sudo cp tmp/deploy/images/varsomimx6/fsl-image-qt5-varsomimx6.ubi /media/rootfs/opt/images

By default Yocto build the u-boot for sdcard. Use the method of building u-boot out of tree for nand and copy the result into the sdcard.

$ sudo cp u-boot.img /media/rootfs/opt/images
$ sudo cp SPL /media/rootfs/opt/images

Unmount the sdcard

$ sudo umount /media/rootfs
$ sudo umount /media/BOT_varsomi

Flashing on target:

$ flash_eraseall /dev/mtd0
$ kobs-ng init -x /opt/images/SPL  --search_exponent=1 -v
$ flash_eraseall /dev/mtd1
$ nandwrite -p /dev/mtd1 /opt/images/u-boot.img 
Select one of:
i.MX6Q / i.MX6D
$ nandwrite -p /dev/mtd1 -s 0x1e0000 /opt/images/imx6q-var-som.dtb 
i.MX6DualLite / i.MX6 Solo
$ nandwrite -p /dev/mtd1 -s 0x1e0000 /opt/images/imx6dl-var-som.dtb 
$ nandwrite -p /dev/mtd1 -s 0x1e0000 /opt/images/imx6dl-var-som-solo.dtb 

Linux kernel:
$ flash_eraseall /dev/mtd2
$ nandwrite -p /dev/mtd2 /opt/images/uImage
$ flash_eraseall /dev/mtd3
$ ubiformat /dev/mtd3 -f /opt/images/fsl-image-qt5-varsomimx6.ubi -s 2048 -O 2048

Not available in this release.

u-boot SPL

QT5/Embedded environment variables

The QT5/Embedded require environment variables to run correctly. You need to have them avilable on the target. For example /etc/profile.d/ can be edited.

export TSLIB_TSDEVICE=/dev/input/touchscreen0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event0
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:size=800x480:mmSize=800x480


By default we create ubifs image for 0.5GB nand size. You can change the size by editing ~/var-som-mx6-daisy-v6/sources/meta-variscite/conf/machine/varsomimx6.conf
and change "include conf/machine/include/" into one of:

  • "include conf/machine/include/"
  • "include conf/machine/include/"
  • "include conf/machine/include/"
  • "include conf/machine/include/"

Anther option is to create the ubifs image manualy. 4GB nand example:

$ cd ~/var-som-mx6-daisy-v6
$ sudo mkdir rootfs
$ sudo tar xvf build_var/tmp/deploy/images/varsomimx6/fsl-image-qt5-varsomimx6.tar.bz2 -C rootfs/
$ sudo mkfs.ubifs -r rootfs/ -o fsl-image-qt5-varsomimx6q4.ubifs -m 4096 -e 504KiB -c 7835
$ ubinize -o fsl-image-qt5-varsomimx6q4.ubi -m 4096 -p 512KiB -s 4096 -O 4096 ubinize.cfg
$ cat ubinize.cfg 

Next steps

In sections 1-6 we explained how to build Yocto for VAR-SOM-MX6. We explained the results for nand (UBI) and for sd-card. At this point you should have a bootable sd-card with UBI images on it. You should be able to boot from the sd-card using the boot select button and flash the nand. Next steps:

  • Build and deploy the compiler and tools.
  • Fetch u-boot and compile it out of Yocto tools.
  • Fetch Linux kernel and compile it out of Yocto tools.

Toolchain installation for out of Yocto builds

Build the toolchain by:

$ bitbake meta-ide-support
$ bitbake meta-toolchain

The output will be located at tmp/deploy/sdk/. On a 64 bit Ubuntu you will get:


Install the tools by running:

$ tmp/deploy/sdk/

Reply to all defaults 'y'
The toolchain name depend on your build machine and may change.

Build U-Boot out of Yocto tree

This is a single u-boot image that supports all VAR-SOM-MX6 SOM's.

Obtain sources:

$ cd ~/var-som-mx6-daisy-v6
$ git clone
$ cd uboot-imx/
$ git checkout -b imx_v2013.10_beta_var4 remotes/origin/imx_v2013.10_beta_var4
  • follow above procedure for installing the toolchain

Build u-boot:

$ export PATH=/opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$PATH
clean tree:
$ make -j6 ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- mrproper
Choose build for SD-Card or NAND Flash:
$ make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi-  mx6var_som_sd_config
$ make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi-  mx6var_som_nand_config
Build U-BOOT:
$ make -j6 ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi-

Flash u-boot to the sd-card:

$ sudo dd if=SPL of=/dev/sdxxx bs=1K seek=1; sync
$ sudo dd if=u-boot.img of=/dev/sdxxx bs=1K seek=69; sync

In case of UBI copy it to the sd-card:

$ sudo cp SPL /media/rootfs/opt/images
$ sudo cp u-boot.img /media/rootfs/opt/images

Eject SD-Card gracefully from host machine

Build Linux out of Yocto tree

Get sources:

$ cd ~/var-som-mx6-daisy-v6/
$ git clone
$ cd linux-2.6-imx/
$ git checkout -b imx_3.10.31_1.1.0_beta2_var1 remotes/origin/imx_3.10.31_1.1.0_beta2_var1

Build the Linux kernel:

$ export PATH=/opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$PATH
$ make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- mrproper
$ make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- imx_v7_var_defconfig
$ make -j6 LOADADDR=0x10008000 ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- uImage
$ make -j6 LOADADDR=0x10008000 ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- modules
Build the device tree for Dualite/Solo
$ make -j6 ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- imx6dl-var-som.dtb
Build the device tree for Quad/Dual
$ make -j6 ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- imx6q-var-som.dtb

Copy the uImage and device tree to the sd-card boot partition or to the opt/image in order to be flashed to the nand. Copy modules to the sd-card

$ sudo make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- modules_install INSTALL_MOD_PATH=/media/rootfs/

Useful Bitbake commands

Bitbake Cheat Sheet

Useful bitbake commands

i.MX Yocto Project: ltib versus bitbake