Getting started with Yocto on Wandboard

From eLinux.org
Jump to: navigation, search

Here are the steps on how to get started with the Yocto Project based on the Freescale Community BSP for Wandboard.

Requirements hardware and software

  • Linux-based host system to use for building Linux
  • Wandboard Solo, Dual, and Quad support
  • Null-modem serial (RS-232) cable use for the serial console
  • 5V power supply to power the Wandboard
  • microSD card to store the bootloader, kernel, and filesystem as Wandboard has no on-board flash

Steps for a first-time build

Here are the steps to building an image for Wandboard with Yocto for the first time:

  1. Download and install Google's repo utility
  2. Create the main BSP install directory and, using repo, download all of the metadata for the BSP layers.
  3. Build an image using bitbake
  4. Locate the built image and write it to SD card


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 https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$: chmod a+x ~/bin/repo

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

$: PATH=${PATH}:~/bin
$: mkdir fsl-community-bsp
$: cd fsl-community-bsp
$: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b dylan
$: repo sync

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

Getting the latest code

Use the 'master' branch in order to make use of the latest updates from Yocto and the meta-freescale community. In the 'repo init' step, use the '-b master' option:
$: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b master
$: repo sync

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.
Additionally, Wandboard Quad support is not in the Poky 1.4 'dylan' branch, as Wandboard Quad was not available at the time Dylan was released. If you are using Wandboard Quad, you will need to use the master branch until the next stable release (Poky 1.5).

Setup environment and build an image

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

Board Type MACHINE=
Wandboard Solo wandboard-solo
Wandboard Dual wandboard-dual
Wandboard Quad wandboard-quad

For example, if you have a Wandboard Dual, then set MACHINE to "wandboard-dual".

$: MACHINE=wandboard-dual

Run the setup-environment script. This is a helper script which sets up the environment and creates a build directory for you.

$: . ./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 DIRECTORY>/tmp/deploy/images/core-image-minimal-wandboard-<solo/dual/quad>.sdcard

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

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

NOTE: "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 Wandboard

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 Wandboard module [MDS1] and either apply power, or reset using the pushbutton switch [RESET1] on the baseboard. You should immediately see log messages in the serial terminal. When complete, you should get a login prompt:

Poky 8.0 (Yocto Project 1.3 Reference Distro) 1.3+snapshot-20130412 wandboard-s0

wandboard-solo login:

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