Part1 : Environment setup and initial build
Part2 : Build u-boot using Yocto     <-- You are here
Part3 : Build Kernel using Yocto
Part4 : Package Development using Yocto
Part5 : Application Development using ADT

In the previous blog we have build & flashed a basic sdcard image and booted with Riotboard.


In this blog we shall manually fetch, configure, compile and build uboot using yocto bitbake tool .


Setting up yocto for Riotboard:

~$ cd fsl-arm-yocto-bsp

~/fsl-arm-yocto-bsp$  MACHINE=riotboard source -b build -e fb



Checking for the available uboot recipes:

~/fsl-arm-yocto-bsp/build$ bitbake -s | grep  u-boot


we will be using the last one u-boot-riotboard  (2013.04)




Bootloader source directory:


Locating source directory through bitbake, this command can be used to locate source directory for other recipes also.

It will open the recipe source directory in a new terminal window with yocto variables defined.

~/fsl-arm-yocto-bsp/build$ bitbake -c devshell u-boot-riotboard




Bootloader recipe location:




Lets build...


Clean up the previous build (if any)

~/fsl-arm-yocto-bsp/build$ bitbake u-boot-riotboard -c clean -f

This will remove everything (except log directory - temp) from the uboot build directory.

It is necessary as we want to have a fresh build from source.


Fetch uboot from source:

~/fsl-arm-yocto-bsp/build$ bitbake u-boot-riotboard -c fetch

The Riotboard has mainline uboot support.
So we can customise the recipe (check SRC_URI & bbappend in yocto) and get the latest support from mainline uboot.

If you are planning to modify uboot, Yocto has details steps for patching new recipes, check here.



Compiling uboot:

~/fsl-arm-yocto-bsp/build$ bitbake u-boot-riotboard -c compile

This will generate u-boot.imx file here :



Deploy u-boot image files:

~/fsl-arm-yocto-bsp/build$ bitbake u-boot-riotboard -c deploy

This will make u-boot.imx available in deploy directories to be bundled with sdcard image.


If you get something like below but still want to rebuild it, force a rebuild by adding -f  to above commands.



You can directly build the uboot directly and may not need above manual steps.

~/fsl-arm-yocto-bsp/build$ bitbake u-boot-riotboard -c deploy


After build procedure completed you will get uboot image in deploy/images folder.



I hope the above gives fair idea into the yocto recipe & directories and shows how a package (like uboot) is manually build.

Next time we shall see how the kernel is setup, build , configure and patched using yocto.