Setup Yocto for Dizzy/Krogoth

From Wiki-DB
Jump to navigationJump to search

Setup Yocto Build System

Install Required Host Packages

Install the required packages for your host development system. The Yocto Project documentation has a listing of install commands for many different linux host systems (Debian, Ubuntu, etc.).

Required Packages for the Host Development System

Download and Install Google's repo utility

The BSP is based on the Yocto Project, which consists of a number of applicable metadata 'layers'. These are managed by the repo utility.

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

Create the BSP directory to download all of the metadata for the BSP layers

Note: You can use your own BSP directory. In the following we use ~/fsl-community-bsp

$: PATH=${PATH}:~/bin
$: cd
$: mkdir fsl-community-bsp
$: cd fsl-community-bsp

Initialize the repositories

The next step is to initialize the repositories. This establishes which branch of the repository will be used for your development. The master branch is the current development branch.

Note: The master branch is a development branch, not a stable branch. It is constantly changing with code updates, the adding of new features, and so forth.

For Dizzy use:
$: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b dizzy

For Krogoth use:
$: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b krogoth

Download all of the metadata for the BSP layers

$: repo sync

Once this has completed, you should have all of the metadata source of the Freescale Community BSP in fsl-community-bsp.

Add DHCOM i.MX6 BSP layer

To clone the OpenEmbedded / Yocto BSP layer for DHCOM i.MX6 execute the following steps:

$: cd fsl-community-bsp/sources

For Dizzy use:
$: git clone -b dizzy https://github.com/dh-electronics/meta-dhcom_imx6.git

For Krogoth use:
$: git clone -b krogoth https://github.com/dh-electronics/meta-dhcom_imx6.git

Edit ~/fsl-community-bsp/build/conf/bblayers.conf (run bitbake once to create build directory, see 'Setup environment and build an image') to add the meta-dhcom_imx6 layer at the end:

${BSPDIR}/sources/meta-dhcom_imx6 \

Setup environment and build an image

To start a build, first set the MACHINE shell environment variable to set the machine. These are:

DHCOM i.MX6 Machines in Yocto
Board Type HW MACHINE
DHCOM i.MX6 Solo 200 dhcom2bimx6s (former dhcomimx6s)
DHCOM i.MX6 DualLite 200 dhcom2bimx6dl (former dhcomimx6dl)
DHCOM i.MX6 Dual 200 dhcom2bimx6d
DHCOM i.MX6 Quad 200 dhcom2bimx6q (former dhcomimx6q)
DHCOM i.MX6 Solo 300 dhcom3bimx6s
DHCOM i.MX6 DualLite 300 dhcom3bimx6dl
DHCOM i.MX6 Dual 300 dhcom3bimx6d
DHCOM i.MX6 Quad 300 dhcom3bimx6q
DHCOM i.MX6 Solo 400 dhcom4bimx6s (new)
DHCOM i.MX6 DualLite 400 dhcom4bimx6dl (new)
DHCOM i.MX6 Dual 400 dhcom4bimx6d (new)
DHCOM i.MX6 Quad 400 dhcom4bimx6q (new)

For example, if you have a DHCOM i.MX6 Duallite HW300, then use MACHINE "dhcom3bimx6dl".

Run the setup-environment script. This is a helper script which sets up the environment and creates a build directory for you. The first time you run this, you will be asked to accept the Freescale end user license agreement (EULA).

$: MACHINE=dhcom3bimx6dl source ./setup-environment build

Run bitbake with core-image-minimal as its argument. This will create a small image and should have the shortest possible build time. Note: all of the sources are downloaded from the internet and built from scratch. This includes the toolchain (gcc) and all of the native utilities, so building an image for the first time could take a few hours, depending on the performance of your host machine.

$: bitbake core-image-minimal

Locating the images and installing to a microSD card

Once the image is built successfully, there are several target images that are built by default. One of these is an image suitable for loading directly into an SD card. It contains all of the required binaries (bootloader, kernel, filesystem) in a preformatted binary image.

You can find the image at:

 build/tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.sdcard

The .sdcard image can be directly copied to an SD card with the dd command:

$ sudo dd if=tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.sdcard of=/dev/sd<N> bs=1M

Note: <MACHINE> in the above corresponds to the MACHINE name provided to bitbake. "N" in the above command is the letter assigned to the SD card. This will vary depending on your host machine configuration.

Running the image on DHCOM i.MX6

As this is just a console image, you will need a serial terminal program such as minicom in order to interact with the board and run commands. Simply plug the microSD card into the slot on the DHCOM i.MX6 module and apply power. You should immediately see log messages in the serial terminal. When complete, you should get a login prompt:

Poky (Yocto Project Reference Distro) 2.1.2 dhcom3bimx6dl /dev/ttymxc0
dhcom3bimx6dl login:

The default login username is 'root' and there is no password.

Other interesting images

The image core-image-minimal builds relatively quickly due to its small size. It is a good image to test to see if your board works. There are other images that you can also try, but can take a good deal longer to build.

Image Description
core-image-base Basic image with kernel modules and other features
core-image-x11 Basic image with X11 support
core-image-sato Image with Sato, a mobile environment and visual style for mobile devices.
The image supports X11 with a Sato theme, Pimlico applications, and contains terminal, editor, and file manager.