Chapter 14. Booting Our Custom Embedded Linux
It's time! We are now ready to boot our custom-made embedded Linux as we have learned the required concepts and gained enough knowledge about the Yocto Project and Poky. In this chapter, we practice what we have learned so far about using Poky with an external BSP, the Freescale ARM BSP, use it to generate an image for use with the Wandboard machine, and boot it using the SD card.
The same concepts can be applied to every other board, as long as a vendor provides a BSP layer to use with the Yocto Project.
We can see a list of the most commonly used BSP layers in this chapter. This should not be taken as a complete list, or as a definitive one, but we want to facilitate your search for the needed layer in case you have one board of a specific vendor next to you. This list is as follows, in alphabetic order:
Allwinner: This has the meta-allwinner
layer
BeagleBoard: This has the meta-beagleboard
layer
CuBox-i: This has the meta-fsl-arm-extra
layer...
The Wandboard is a not-for-profit low-cost
Cortex-A9 processor, based on the Freescale i.MX6 SoC board with high-performance multimedia capabilities. The board is available in three versions, as shown in the following table:
The Wandboard is supported by the Wandboard community. More information is available at http://www.wandboard.org/. The following is an image of a Wandboard:
Discovering Freescale ARM BSP
The Wandboard board uses the Freescale i.MX6 SoC. To use it with the Yocto Project, we need to use BSP layers.
The needed BSP layers to enable Wandboard support in Yocto Project are the following:
meta-fsl-arm
: This BSP layer adds support to Freescale's reference machines and provides the basic BSP support
meta-fsl-arm-extra
: This BSP layer adds support to third-party boards based on Freescale's SoC, such as Wandboard, and requires meta-fsl-arm
as it provides the base BSP support
Freescale BSP is supported by a community, and more information on it can be found at http://freescale.github.io/.
Using Wandboard with the Yocto Project
The modular structure of the Yocto Project gives us the freedom to include external BSP layers to extend a set of supported machines.
The first step to enable support for Wandboard is to download the metadata of the BSP layers.
From the directory where the Poky source code is cloned, please run the following command lines:
The final directory structure you should have is shown in the following figure:
After completing this, we must create the build directory we use for our builds. We can do this using the following command line:
Tip
The same procedure was first introduced in Chapter 2, Baking Our Poky-based System.
Some packages included in Freescale ARM BSP have proprietary property and are followed by a
End-user License Agreement (EULA) that shows the legal...
Building an image for Wandboard
After we have the build directory and the BSP layers are properly set up, we can start the build. Inside the build-wandboard
directory, we must call the following command:
The MACHINE
variable can be changed depending on the Wandboard we want to use or set in build/conf/local.conf
. The machine names for the Wandboard variants are wandboard-solo
, wandboard-dual
, and wandboard-quad
.
If we want to use the Wandboard Solo and build core-image-sato
, which provides an embedded graphical environment, we should run the following command:
The build process will take a while. It takes about 2 hours and about 10 Gigabytes in a workstation machine.
If you didn't accept the EULA or want a smaller image to build faster, you can build core-image-minimal
instead. For this, use the following command:
Booting Wandboard from the SD card
After the build process is over, the image will be available inside the build-wandboard/tmp/deploy/images/wandboard-solo/
directory. There are many files, but Freescale ARM BSP generates a ready-to-use SD card image.
The file we want to use is core-image-sato-wandboard-solo.sdcard
or core-image-minimal.sdcard
, depending on the image we built.
Note
Make sure your point to the right device and double check to not write in your hard disk.
In order to copy the generated image to the SD card, we should use the dd
utility, as follows:
We can also use the following command:
After copying the content in the SD card, insert it into the SD card slot, connect the HDMI cable, and power on the machine. It should boot nicely.
Tip
There are two SD card slots in Wandboard. The primary slot is located in the CPU board, used for booting...
In this final chapter, we introduced two community projects, Wandboard and Freescale ARM BSP layers. We consolidated our Yocto Project knowledge by adding external BSP layers and using these in a real board with a generated image.
Throughout the book, we learned the needed background information for you to learn on your own any other aspect of the Yocto Project that you may need. You have the general understanding to know what is happening behind the scenes when you ask BitBake to build a recipe or an image. From now on, you are ready to free your mind and try new things. There are plenty of boards available, waiting for you to give them life. The ball is in your court now; here's where the fun begins!