VAR-SOM-MX7 Yocto Jethro R1 build: Difference between revisions

From Variscite Wiki
 
(33 intermediate revisions by the same user not shown)
Line 29: Line 29:
$ mkdir ~/var-mx6ul-mx7-yocto-jethro
$ mkdir ~/var-mx6ul-mx7-yocto-jethro
$ cd ~/var-mx6ul-mx7-yocto-jethro
$ cd ~/var-mx6ul-mx7-yocto-jethro
$ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga
$ repo init -u https://source.codeaurora.org/external/imx/fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga
$ repo sync
$ repo sync -j4
</pre>
</pre>


Line 36: Line 36:
<pre>
<pre>
$ cd ~/var-mx6ul-mx7-yocto-jethro/sources
$ cd ~/var-mx6ul-mx7-yocto-jethro/sources
$ git clone https://github.com/varigit/meta-variscite-mx6ul-mx7/ -b imx_4.1.15_ga-var01
$ git clone https://github.com/varigit/meta-variscite-mx6ul-mx7.git -b imx_4.1.15_ga-var01
$ cp meta-variscite-mx6ul-mx7/scripts/var-setup-release.sh ../
$ cp meta-variscite-mx6ul-mx7/scripts/var-setup-release.sh ../
$ patch -p1 < meta-variscite-mx6ul-mx7/patch/Fix-FSL-multi-patch-append-bugs.patch
$ patch -p1 < meta-variscite-mx6ul-mx7/patch/Fix-FSL-multi-patch-append-bugs.patch
Line 42: Line 42:


= Setup and build Yocto =
= Setup and build Yocto =
The following images can be built:
The following distros can be used:
* fsl-imx-x11 - Only X11 graphics
* fsl-imx-x11 - Only X11 graphics
* fsl-imx-wayland - Wayland weston graphics
* fsl-imx-wayland - Wayland weston graphics
Line 52: Line 52:


'''Sample build scenarios:'''
'''Sample build scenarios:'''
* [[VAR-SOM-MX6 Yocto Jethro R4 Build Yocto release#Build X11 GUI image without Qt content | Build X11 GUI image without Qt content]]
* [[#Build X11 GUI image without Qt content|Build X11 GUI image without Qt content]]
* [[VAR-SOM-MX6 Yocto Jethro R4 Build Yocto release#Build opensource QT5 image | Build opensource QT5 image]]
* [[#Build Qt5 image without X11|Build Qt5 image without X11]]
== Build X11 GUI image without Qt content ==
== Build X11 GUI image without Qt content ==
<pre>
<pre>
Line 71: Line 71:
</pre>
</pre>


== Build opensource QT5 image ==
== Build Qt5 image without X11 ==
<pre>
<pre>
$ cd ~/var-mx6ul-mx7-yocto-jethro
$ cd ~/var-mx6ul-mx7-yocto-jethro
Line 87: Line 87:


== Build Results ==
== Build Results ==
The resulted images are located in tmp/deploy/images/imx6ul-var-dart/.<br/>Looking at tmp/deploy/images/imx6ul-var-dart/ you will find 6 main files that are linked to the actual file<br/>
The resulted images are located at tmp/deploy/images/imx7-var-som:


{| class="wikitable"
{| class="wikitable"
|-
|-
! scope="col" | Image Name<br/>
! scope="col" | File Name
! scope="col" | How to use<br/>
! scope="col" | Description
|-
|-
| fsl-image-gui-imx6ul-var-dart.ext4<br/>
| style="padding: 5px;"| fsl-image-gui-imx7-var-som.sdcard
| Not in Use<br/>
| style="padding: 5px;"| This image is for SD card boot.<br> It can be flashed as-is on an SD card that can then be used to boot your system.<br>For detailed information refer to the [[#Create_a_bootable_SD_card|Create a bootable SD card]] section below.
|-
|-
| fsl-image-gui-imx6ul-var-dart.sdcard
| style="padding: 5px;"| fsl-image-gui-imx7-var-som.tar.bz2
| This image is for SD card boot.<br> It can be flashed as-is on an SD card and you can boot your system <br> form SD card, according to the relevant startup-guide of your product (usually requires to press the boot select button, or toggle a dip-switch).
| style="padding: 5px;"| Tarball with rootfs files.<br>Can be used to create an NFS root file system on the host.<br> See the [[VAR-SOM-MX6_Yocto_Utilizing | Setup TFTP/NFS Yocto system]] section for more info.<br>Also used to create our extended SD card.<br>See the [[#Create_a_bootable_SD_card|Create a bootable SD card]] section below.
For detailed information refer to Create a sample SD card section below [[#Create_a_bootable_SD_card |Create a bootable SD card]].
|-
|-
| fsl-image-gui-imx6ul-var-dart.tar.bz2
| style="padding: 5px;"| fsl-image-gui-imx7-var-som.ubi
| Used to create an NFS root file system on the host. See apendix for setting an NFS server
| style="padding: 5px;"| A complete UBI image containing a UBIFS volume, for writing to NAND flash.
|-
|-
| fsl-image-gui-imx6ul-var-dart.ubi
| style="padding: 5px;"| zImage
| Use the SD card created above. Copy the file into it and use the following commands to flash them into NAND.<br/>Coping files (mount the SD card created above first):
| style="padding: 5px;"| Linux kernel image, same binary for SD card/eMMC/NAND flash.
|-
|-
| zImage
| style="padding: 5px;"| SPL-sd
| Linux kernel image
| style="padding: 5px;"| SPL built for SD card/eMMC.
|-
|-
| u-boot.img-sd
| style="padding: 5px;"| SPL-nand
| U-Boot built for SD card boot, or eMMC boot
| style="padding: 5px;"| SPL built for NAND flash.
|-
|-
| u-boot.img-nand
| style="padding: 5px;"| u-boot.img-sd
| U-Boot built for NAND flash boot
| style="padding: 5px;"| U-Boot built for SD card/eMMC.
|-
|-
! scope="col" | Device Tree Name<br/>
| style="padding: 5px;"| u-boot.img-nand
! scope="col" | Boot Device<br/>
| style="padding: 5px;"| U-Boot built for NAND flash.
|-
|-
| zImage-imx6ul-var-dart-emmc_wifi.dtb
| style="padding: 5px;"| zImage-imx7d-var-som-emmc.dtb
| Boot from internal eMMC with WI-FI enabled. (SD card & NAND disabled)
| style="padding: 5px;"| Device tree blob for SOMs with eMMC.
|-
|-
| zImage-imx6ul-var-dart-nand_wifi.dtb
| style="padding: 5px;"| zImage-imx7d-var-som-nand.dtb
| Boot from internal NAND with WI-FI enabled. (SD card & eMMC disabled)
| style="padding: 5px;"| Device tree blob for SOMs with NAND flash.
|-
| zImage-imx6ul-var-dart-sd_emmc.dtb
| SD card and eMMC enabled (WIFI & NAND disabled). You can boot from eMMC or SD card
|-
| zImage-imx6ul-var-dart-sd_nand.dtb
| SD card and NAND enabled (WIFI & eMMC disabled). You can boot from NAND or SD card
|-
|-
|}
|}
Line 135: Line 128:
= Create a bootable SD card =
= Create a bootable SD card =
== SD card structure ==
== SD card structure ==
The first unallocated 4MB are saved space for U-Boot. it can be replaced with a dd command described in "U-Boot out of tree" section below.<br>
The first unallocated 4MiB are saved for U-Boot. It can be replaced using the dd command as described in "U-Boot out of tree" section below.<br>
The first partition is a fat16 partition used for the Linux uImage and device tree files. You can copy them as described in the Linux out of tree section.<br>
The first partition is formatted with FAT16 and contains the Linux image and device tree blobs. You can copy them as described in the Linux out of tree section.<br>
The second partition is an ext4 partition that contains the complete file system and modules.
The second partition is formatted with ext4 and contains the file system (including the kernel modules).


== Yocto pre-built bootable SD card ==
== Yocto pre-built bootable SD card ==
The Yocto build products contains many files as explained in [[DART-6UL Yocto Jethro Build Yocto release#Build Results | Build Results section]] above including a ".sdcard" file. For example fsl-image-gui-imx6ul-var-dart.sdcard. This is a complete image to be flashed directly to an SD card.<br> Example usage:
The Yocto build products contains many files as explained in [[#Build Results|Build Results]] section above including a ".sdcard" file. For example, fsl-image-gui-imx7-var-som.sdcard, depending on your build.<br>
 
This is a complete image to be flashed directly to an SD card.<br>
<pre>$ cd ~/var-mx6ul-mx7-yocto-jethro/build_x11
Example usage:
$ sudo dd if=tmp/deploy/images/imx6ul-var-dart/fsl-image-gui-imx6ul-var-dart.sdcard of=/dev/sdX bs=1M
<pre>
$ cd ~/var-mx6ul-mx7-yocto-jethro/build_x11
$ sudo dd if=tmp/deploy/images/imx7-var-som/fsl-image-gui-imx7-var-som.sdcard of=/dev/sdX bs=1M
Replace sdX with the right device name.
Replace sdX with the right device name.
</pre>
</pre>
Line 152: Line 147:


== Create an extended SD card ==
== Create an extended SD card ==
Variscite provides var-create-yocto-sdcard.sh script that makes use of the .sdcard image mentioned above, extends the partitions of the SD card to the maximum available space, and copies the NAND flash burning scripts and relevant binaries for your convenience.<br> Later, you will be able to follow [http://variwiki.com/index.php?title=DART-6UL_NAND_Flash_Burning DART-6UL NAND Flash Burning] do burn your images to NAND flash or eMMC <br>
Variscite provides the var-create-yocto-sdcard.sh script which creates our NAND/eMMC recovery SD card - an SD card based on the fsl-image-gui filesystem, which copies the NAND flash burning scripts and relevant binaries for your convenience.<br>
See usage below:
Later, you will be able to follow either the more automatic [[VAR-SOM-MX7 Yocto Recovery SD card]] guide or the more manual [[VAR-SOM-MX7 NAND Flash Burning|Flashing the internal storage device]] guide to burn your images to NAND flash or eMMC.<br><br>
<pre>$ cd ~/var-mx6ul-mx7-yocto-jethro/build_x11
$ sudo ../sources/meta-variscite-mx6ul-mx7/scripts/var_mk_yocto_sdcard/var-create-yocto-sdcard.sh /dev/sdX
Replace sdX with the right device name.
</pre>The script assume fsl-image-qt5-minimal build was used. It is very easy to modify it and adopt it to your requirements.


= Boot board with a bootable SD card =
Note:<br>
== Setting board dip-switches ==
This is essentially the same as our pre-built Recovery SD image, with the following main difference:<br>
Booting your system requires switching the relevant dip-switch to "Boot from SD card". See picture below.<br>
The pre-built image's rootfs partition size is 3700MiB, which is also the default size when using the script, but the script also has an option to set the rootfs partition size to fill the whole free space of the used SD card. Anyway, you can always resize the partition later with an external tool such as gparted.<br>
Naturally, the pre-built image is more straight forward and easier to use, while the script method is easier to customize.<br><br>


[[File:Boot_switch_6ul1.jpg|thumb|none|upright=2.0]]
Usage:<br>
<br>
* Follow the [[#Setup and build Yocto|Setup and build Yocto]] guide, and bitbake fsl-image-gui.
* "00" - Boot from SD card - The picture mode
* Plug-in the SD card to your Linux HOST PC, run dmesg and see which device is added (i.e. /dev/sdX or /dev/mmcblkX)
* "01" - Boot from eMMC
<pre>
* "10" - Boot from NAND flash
$ sudo MACHINE=imx7-var-som ~/var-mx6ul-mx7-yocto-jethro/sources/meta-variscite-mx6ul-mx7/scripts/var_mk_yocto_sdcard/var-create-yocto-sdcard.sh <options> /dev/sdX
* "11" is illegal.
(Replace /dev/sdX with your actual device)
Be aware that your SOM has either eMMC or NAND, but never both!<br><br>
</pre>
<pre>
options:
  -h            Display help message
  -s            Only show partition sizes to be written, without actually write them
  -a            Automatically set the rootfs partition size to fill the SD card


To boot board with SD card, Follow the steps below:<br>
If you don't use the '-a' option, a default rootfs size of 3700MiB will be used
</pre>


*Power-off the board.
= Boot board with a bootable SD card =
*Insert the SD card into the SD/MMC slot of the carrier board (DVK)
== Setting the BOOT SELECT DIP switches ==
*Switch the relevant dip-switch to "Boot from SD card"
Make sure the BOOT SELECT DIP switches on the carrier board are set correctly before you power on the board.
*Power-up board
*The board will automatically boot into Linux from SD card
 
== Automatic device Tree selection in U-Boot ==
Upon reset you will see the U-Boot SPL printouts. It will print also the SOM configuration:
<br>On-SOM storage: SD only, eMMC, NAND.
<br>WIFI if chip exits.
<br>For example:
<pre>
<pre>
U-Boot SPL 2015.10-00532-g482dc88 (Jan 03 2016 - 10:05:42)
SW1-SW2
i.MX6UL SOC
0 - 0 : Boot from SD card
Part number: DART-6U-A01
1 - 0 : Boot from eMMC
Assembly: AS11
0 - 1 : Boot from NAND flash
Date of production: 2015 Dec 31
1 - 1 : Illegal
DART-6UL configuration: eMMC WIFI
Ram size: 512
Boot Device: SD
</pre>
</pre>
As explained in the above [[DART-6UL Yocto Fido R1 Build Yocto release#Build_Results | Build Results]] table we have 4 optional configurations.
Note: The VAR-SOM-MX7 SOM comes with either NAND or eMMC, but not both.
<br>We implemented in U-Boot and automatic device tree selection, so when kernel boots, the U-Boot will load the corresponding device tree according to On-SOM configuration.  


{| class="wikitable"
== Automatic Device Tree selection in U-Boot ==
|-
As shown in the [[#Build_Results| Build Results]] table above, we have different kernel device trees, corresponding to our different H/W configurations (sometimes they are renamed without the "zImage-" prefix).<br>
! scope="col" | Boot From<br/>
We implemented a script in U-Boot's environment, which sets the fdt_file environment variable based on the detected hardware.
! scope="col" | SOM Internal FLASH<br/>
! scope="col" | SOM has WIFI/BT<br/>
! scope="col" | Device Tree selected<br/>
|-
| SD
| eMMC
| Don't Care
| imx6ul-var-dart-sd_emmc.dtb
|-
| SD
| NAND
| Don't Care
| imx6ul-var-dart-sd_nand.dtb
|-
| eMMC
| eMMC
| Yes
| imx6ul-var-dart-emmc_wifi.dtb
|-
| eMMC
| eMMC
| NO
| imx6ul-var-dart-sd_emmc.dtb
|-
| NAND
| NAND
| YES
| imx6ul-var-dart-nand_wifi.dtb
|-
| NAND
| NAND
| NO
| imx6ul-var-dart-sd_nand.dtb
|}
 
<span style="color:red">Note: Boot from SD card eliminates Wifi</span> as the Wifi and SD card are using same SDIO interface.<br>
A typical use-case, is to boot from SD card, flash eMMC or NAND flash, and re-boot form eMMC/NAND to have Wi-Fi operational.


== Disable Automatic Device Tree selection ==
=== Enable/Disable Automatic Device Tree selection ===
To disable the automatic device tree selection in U-Boot:
To enable the automatic device tree selection in U-Boot (already enabled by default):
<pre>
$ setenv var_auto_fdt_file=N
$ saveenv
</pre>
Now you can set the device tree to meet your requirments. For example:
<pre>
<pre>
$ setenv fdt_file=imx6ul-var-dart-sd_emmc.dtb
$ setenv fdt_file=undefined
$ saveenv
$ saveenv
</pre>
</pre>
Will select device tree that has SD and eMMC regardless if the SOM has WIFI.
To disable the automatic device tree selection in U-Boot, set the device tree file manually:
<pre>
<pre>
$ setenv fdt_file=imx6ul-var-dart-sd_nand.dtb
$ setenv fdt_file=YOUR_DTB_FILE
$ saveenv
$ saveenv
</pre>
</pre>
Will select device tree that has SD and NAND regardless if the SOM has WIFI.
{{note|Comment:<br/>Make sure you don't set am illegal value like "imx6ul-var-dart-sd_nand.dtb" in a SOM that has eMMC flash.|info}}


= Flash images to NAND/eMMC =
= Flash images to NAND/eMMC =


Please refer to [http://variwiki.com/index.php?title=DART-6UL_NAND_Flash_Burning DART-6UL NAND Flash Burning]
Please refer to [[VAR-SOM-MX7_NAND_Flash_Burning|VAR-SOM-MX7 NAND flash burning]]


= QT5/Embedded runtime =
= QT5/Embedded runtime =
Line 289: Line 231:
</pre>
</pre>


= Next steps =
= UBIFS =
In sections 1-6 we explained how to build Yocto for DART-6UL. We explained the results for NAND (UBI) and for SD card.
The UBIFS image we create by default is for 512MiB NAND flash.<br>
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.
You can change the size by editing  ~/var-mx6ul-mx7-yocto-jethro/sources/meta-variscite-mx6ul-mx7/conf/machine/imx7-var-som.conf  and comment/uncomment the relevant section.
Next steps:<br>
* 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.


= Update Yocto Jethro i.MX6UL Meta Variscite DART-6UL support =
= Update Yocto Jethro Meta-Variscite =
From time to time we will post updates to meta-variscite-mx6ul-mx7. This will include improve features and bug fix.
From time to time we will post updates to meta-variscite that will include new features and bug fixes.<br>
You can track the history log in the previous page to see if such an update was posted. In such a case follow the instructions below to update your tree.
Follow the instructions below to update your tree:
<pre>$ cd ~/var-mx6ul-mx7-yocto-jethro/sources/meta-variscite-mx6ul-mx7/
<pre>
$ cd ~/var-mx6ul-mx7-yocto-jethro/sources/meta-variscite-mx6ul-mx7/
$ git fetch origin
$ git fetch origin
$ git checkout imx_4.1.15_ga-var01
$ git pull
$ git pull
Set your enviroment
 
Setup your enviroment:
$ cd ~/var-mx6ul-mx7-yocto-jethro
$ cd ~/var-mx6ul-mx7-yocto-jethro
$ MACHINE=imx6ul-var-dart DISTRO=fsl-imx-x11 source var-setup-release.sh -b build_x11
$ MACHINE=imx7-var-som DISTRO=fsl-imx-x11 source var-setup-release.sh -b build_x11
In order to update the kernel
In order to update the kernel and U-Boot:
$ bitbake -c cleanall linux-variscite
$ bitbake -c cleanall fsl-image-gui u-boot-variscite linux-variscite cryptodev-module
$ bitbake  -c cleanall u-boot-variscite
and build your image:
and build your image
$ bitbake fsl-image-gui
$ bitbake fsl-image-gui
</pre>
</pre>

Latest revision as of 18:23, 2 December 2020

VAR-SOM-MX7 - Yocto fsl-4.1.15 Yocto Jethro R1 Build

Installing required packages

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

www.yoctoproject.org/docs/latest/yocto-project-qs/yocto-project-qs.html

Please make sure you host PC is running Ubuntu 14.04 and install the following packages:

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev
sudo apt-get install python-git xterm sed cvs subversion coreutils texi2html
sudo apt-get install docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools mtd-utils

Documentation

Documentation are available for Download from FreescaleJethroDocuments

Download Yocto Jethro for i.MX7 Freescale source

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

$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH

$ mkdir ~/var-mx6ul-mx7-yocto-jethro
$ cd ~/var-mx6ul-mx7-yocto-jethro
$ repo init -u https://source.codeaurora.org/external/imx/fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga
$ repo sync -j4

Download Yocto Jethro with Meta Variscite VAR-SOM-MX7 support

$ cd ~/var-mx6ul-mx7-yocto-jethro/sources
$ git clone https://github.com/varigit/meta-variscite-mx6ul-mx7.git -b imx_4.1.15_ga-var01
$ cp meta-variscite-mx6ul-mx7/scripts/var-setup-release.sh ../
$ patch -p1 < meta-variscite-mx6ul-mx7/patch/Fix-FSL-multi-patch-append-bugs.patch

Setup and build Yocto

The following distros can be used:

  • fsl-imx-x11 - Only X11 graphics
  • fsl-imx-wayland - Wayland weston graphics
  • fsl-imx-xwayland - Wayland graphics and X11. X11 applications using EGL are not supported
  • fsl-imx-fb - Frame Buffer graphics - no X11 or Wayland


Note: refer to ftp://customerv:Variscite1@ftp.variscite.com/VAR-SOM-MX6/Software/Linux/Yocto/fsl-yocto-imx-4.1.15_1.0.0-docs/Freescale_Yocto_Project_User's_Guide.pdf
Page 7 for further information.

Sample build scenarios:

Build X11 GUI image without Qt content

$ cd ~/var-mx6ul-mx7-yocto-jethro
$ MACHINE=imx7-var-som DISTRO=fsl-imx-x11 source var-setup-release.sh -b build_x11

Optional: Direct downloads to /opt/yocto_downloads, make sure directory exists and all permissions are set

$ sudo mkdir /opt/yocto_downloads
$ sudo chmod 777 /opt/yocto_downloads/
$ sed -i 's/DL_DIR ?= "${BSPDIR}\/downloads/DL_DIR = "\/opt\/yocto_downloads/g' conf/local.conf

launch bitbake:

$ bitbake fsl-image-gui

Build Qt5 image without X11

$ cd ~/var-mx6ul-mx7-yocto-jethro
$ MACHINE=imx7-var-som DISTRO=fsl-imx-fb source var-setup-release.sh -b build-fb

Optional: Direct downloads to /opt/yocto_downloads, make sure directory exists and all permissions are set

sed -i 's/DL_DIR ?= "${BSPDIR}\/downloads/DL_DIR = "\/opt\/yocto_downloads/g' conf/local.conf

launch bitbake:

$ bitbake fsl-image-qt5

Build Results

The resulted images are located at tmp/deploy/images/imx7-var-som:

File Name Description
fsl-image-gui-imx7-var-som.sdcard 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.
For detailed information refer to the Create a bootable SD card section below.
fsl-image-gui-imx7-var-som.tar.bz2 Tarball with rootfs files.
Can be used to create an NFS root file system on the host.
See the Setup TFTP/NFS Yocto system section for more info.
Also used to create our extended SD card.
See the Create a bootable SD card section below.
fsl-image-gui-imx7-var-som.ubi A complete UBI image containing a UBIFS volume, for writing to NAND flash.
zImage Linux kernel image, same binary for SD card/eMMC/NAND flash.
SPL-sd SPL built for SD card/eMMC.
SPL-nand SPL built for NAND flash.
u-boot.img-sd U-Boot built for SD card/eMMC.
u-boot.img-nand U-Boot built for NAND flash.
zImage-imx7d-var-som-emmc.dtb Device tree blob for SOMs with eMMC.
zImage-imx7d-var-som-nand.dtb Device tree blob for SOMs with NAND flash.

Create a bootable SD card

SD card structure

The first unallocated 4MiB are saved for U-Boot. It can be replaced using the dd command as described in "U-Boot out of tree" section below.
The first partition is formatted with FAT16 and contains the Linux image and device tree blobs. You can copy them as described in the Linux out of tree section.
The second partition is formatted with ext4 and contains the file system (including the kernel modules).

Yocto pre-built bootable SD card

The Yocto build products contains many files as explained in Build Results section above including a ".sdcard" file. For example, fsl-image-gui-imx7-var-som.sdcard, depending on your build.
This is a complete image to be flashed directly to an SD card.
Example usage:

$ cd ~/var-mx6ul-mx7-yocto-jethro/build_x11
$ sudo dd if=tmp/deploy/images/imx7-var-som/fsl-image-gui-imx7-var-som.sdcard of=/dev/sdX bs=1M
Replace sdX with the right device name.

Drawbacks of the native .sdcard yocto-built image:

  • The second partition size doesn't use the entire SD card.
  • The second partition is not labeled as rootfs.
  • The NAND and eMMC flashing scripts are not included.

Create an extended SD card

Variscite provides the var-create-yocto-sdcard.sh script which creates our NAND/eMMC recovery SD card - an SD card based on the fsl-image-gui filesystem, which copies the NAND flash burning scripts and relevant binaries for your convenience.
Later, you will be able to follow either the more automatic VAR-SOM-MX7 Yocto Recovery SD card guide or the more manual Flashing the internal storage device guide to burn your images to NAND flash or eMMC.

Note:
This is essentially the same as our pre-built Recovery SD image, with the following main difference:
The pre-built image's rootfs partition size is 3700MiB, which is also the default size when using the script, but the script also has an option to set the rootfs partition size to fill the whole free space of the used SD card. Anyway, you can always resize the partition later with an external tool such as gparted.
Naturally, the pre-built image is more straight forward and easier to use, while the script method is easier to customize.

Usage:

  • Follow the Setup and build Yocto guide, and bitbake fsl-image-gui.
  • Plug-in the SD card to your Linux HOST PC, run dmesg and see which device is added (i.e. /dev/sdX or /dev/mmcblkX)
$ sudo MACHINE=imx7-var-som ~/var-mx6ul-mx7-yocto-jethro/sources/meta-variscite-mx6ul-mx7/scripts/var_mk_yocto_sdcard/var-create-yocto-sdcard.sh <options> /dev/sdX
(Replace /dev/sdX with your actual device)
options:
  -h            Display help message
  -s            Only show partition sizes to be written, without actually write them
  -a            Automatically set the rootfs partition size to fill the SD card

If you don't use the '-a' option, a default rootfs size of 3700MiB will be used

Boot board with a bootable SD card

Setting the BOOT SELECT DIP switches

Make sure the BOOT SELECT DIP switches on the carrier board are set correctly before you power on the board.

SW1-SW2
 0 - 0 : Boot from SD card
 1 - 0 : Boot from eMMC
 0 - 1 : Boot from NAND flash
 1 - 1 : Illegal

Note: The VAR-SOM-MX7 SOM comes with either NAND or eMMC, but not both.

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 (sometimes they are renamed without the "zImage-" prefix).
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

Flash images to NAND/eMMC

Please refer to VAR-SOM-MX7 NAND flash burning

QT5/Embedded runtime

Environment Variables

The QT5/Embedded require environment variables to run correctly. DART6Ul support QT Embedded over Linux Frame Buffer. For example /etc/profile.d/tslib.sh can be edited. The following example enable touch, mouse and keyboard:

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_PLATFORM=linuxfb:fb=/dev/fb0:size=800x480:mmSize=800x480
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS='/dev/input/touchscreen0'
export QT_QPA_GENERIC_PLUGINS='tslib:/dev/input/touchscreen0,evdevmouse:/dev/input/event5,evdevkeyboard:/dev/input/event3'

Running Application

$ cd /usr/share/qt5/examples/
$ touch/dials/dials --platform linuxfb
$ gui/rasterwindow/rasterwindow --platform linuxfb
$ touch/fingerpaint/fingerpaint  --platform linuxfb
$ widgets/mainwindows/mainwindow/mainwindow --platform linuxfb

UBIFS

The UBIFS image we create by default is for 512MiB NAND flash.
You can change the size by editing ~/var-mx6ul-mx7-yocto-jethro/sources/meta-variscite-mx6ul-mx7/conf/machine/imx7-var-som.conf and comment/uncomment the relevant section.

Update Yocto Jethro Meta-Variscite

From time to time we will post updates to meta-variscite that will include new features and bug fixes.
Follow the instructions below to update your tree:

$ cd ~/var-mx6ul-mx7-yocto-jethro/sources/meta-variscite-mx6ul-mx7/
$ git fetch origin
$ git checkout imx_4.1.15_ga-var01
$ git pull

Setup your enviroment:
$ cd ~/var-mx6ul-mx7-yocto-jethro
$ MACHINE=imx7-var-som DISTRO=fsl-imx-x11 source var-setup-release.sh -b build_x11
In order to update the kernel and U-Boot:
$ bitbake -c cleanall fsl-image-gui u-boot-variscite linux-variscite cryptodev-module
and build your image:
$ bitbake fsl-image-gui

Useful Bitbake commands

Bitbake Cheat Sheet

Useful bitbake commands

i.MX Yocto Project: ltib versus bitbake