How to start with TinyRex YOCTO

This page content was created by Dale, Marek and Allan. Thank you very much for contribution.

Content

On this page, you will find step-by-step instructions to build iMX6 TinyRex from YOCTO project. YOCTO is just another way to build uBoot, Linux Kernel & Filesystem. The difference from the standard direct compilation is that Freescale now officially adds all their support through YOCTO. If you need to use special things from the iMX6 like GPU or cameras, you may really want to consider using YOCTO to prepare uBoot and Linux for your board.

iMX6 TinyRex has not been completely ported to YOCTO yet, but on these pages you can find the steps which can help you to do it by yourself in the case you need YOCTO urgently.

Setup a host computer

Install Ubuntu 14.04 LTS:
You can install it into a virtual machine, e.g. VMware Player. Go to http://releases.ubuntu.com/14.04/ and download for example this image (for 64bit PC): http://releases.ubuntu.com/14.04/ubuntu-14.04.3-desktop-amd64.iso
Note: I had a problem to run Ubuntu 14.04, but it’s easy to fix. When I logged in, I was getting a black screen. I had to disable 3D support in the virtual machine settings and then it worked OK. Also it is worth noting that you will need to make the hard drive on the Virtual Machine greater than 50 GB, and if you can make extra CPU cores available to the virtual machine as this will reduce the compilation time considerably.

Login into Ubuntu and install necessary packages. The essential and graphical support packages you need for a supported Ubuntu or Debian distribution are shown in the following command:

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

Note: Find more information at https://community.freescale.com/docs/DOC-1616

To get the nessassary Board Support Packages (BSP) the repo utility will be required.

To install the `repo` utility:

mkdir ~/bin
PATH=${PATH}:~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

Compile your first uBoot & Kernel from YOCTO

mkdir -pv ~/workdir/imx6/yocto/fsl-release-bsp
cd ~/workdir/imx6/yocto/fsl-release-bsp
repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-3.14.28-1.0.1_patch

Initialize the i.MX6 TinyRex Layer:

mkdir -pv .repo/local_manifests/
cat > .repo/local_manifests/imx6tinyrex.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <remote fetch="git://github.com/Voipac" name="voipac"/>

  <project remote="voipac" revision="master" name="meta-fsl-arm-voipac" path="sources/meta-fsl-arm-voipac">
    <copyfile src="voipac-setup.sh" dest="voipac-setup.sh"/>
  </project>
</manifest>
EOF

Sync the repositories:

repo sync

Add the meta layer into BSP

source voipac-setup.sh

Building the images

To configure bitbake to complile the images, first we need to change to the correct directory;

cd ~/workdir/imx6/yocto/fsl-release-bsp

Configure the build environment

There are 2 different versions of the iMX6 TinyRex, the single core and the quad core. In the next step you must choose which version you will be compiling for.
imx6s-tinyrex = single core
imx6q-tinyrex = quad core

In this example we will use the quad core version. In this step we will prepare the configuration of bitbake.

MACHINE=imx6q-tinyrex source setup-environment build-dir

Now we need to run the first compilation. It will take quite a while. For a quick test, you can run this minimal image (A small image just capable of allowing a device to boot):

MACHINE=imx6q-tinyrex bitbake core-image-minimal

Note: Normally, you may want to run ‘bitbake core-image-base’ (A console-only image that fully supports the target device hardware)

The final outputs and images are located at:

cd tmp/deploy/images

There are more options, than just ‘core-image-minimal’. You can list all the possible ‘images’ which you can build. Run this command:

bitbake-layers show-recipes '*-image-*'

Then just use ‘bitbake’ to build the image you like, e.g.:

bitbake fsl-image-multimedia-full

Optional GUI image

If you would like to compile a GUI image using the X11 server and the SATO desktop, you can do the following;

cd ~/workdir/imx6/yocto/fsl-release-bsp
MACHINE=imx6q-tinyrex source fsl-setup-release.sh -b build-x11 -e x11
MACHINE=imx6q-tinyrex bitbake fsl-image-gui

Create a SD card

Check if the files were compiled correctly. Check if the timestamp of the files is ok. Be aware, directories may be different between images. For example, here is the standard output directory:

cd ~/workdir/imx6/yocto/fsl-release-bsp/build-dir/
ls -la tmp/deploy/images/imx6q-tinyrex/

This is output for x11:

cd ~/workdir/imx6/yocto/fsl-release-bsp/build-x11/
ls -la tmp/deploy/images/imx6q-tinyrex/

Insert an SD card into your PC. To check how it’s mounted, run: ‘dmesg | tail’. Use the correct /dev/ and copy the images to the SD card (be sure you copy the file you have created … e.g. minimal vs base)
In this example we are using the fsl-image-gui for the quad core version. You will need to change this depending on what image you would like to flash.

cd ~/workdir/imx6/yocto/fsl-release-bsp/build-x11/tmp/deploy/images/imx6q-tinyrex/
sudo dd if=fsl-image-gui-imx6q-tinyrex.sdcard of=/dev/sdf bs=1M && sync

umount /dev/sdf?

To test it, remove the SD from PC and insert it into the iMX6 TinyRex SD slot placed on the edge. Connect power. You should now see the u-boot messages on the console, and if successful the kernel should boot automatically.