EBC Exercise 25 Configuring U-boot

From eLinux.org
Revision as of 15:27, 9 October 2012 by Yoder (Talk | contribs)

Jump to: navigation, search

thumb‎ Embedded Linux Class by Mark A. Yoder

This follows the approach taken in EBC Exercise 13 Configuring the Kernel. We'll use bitbake to get the source files for U-boot and then we'll edit them.


When you did EBC Exercise 22 Cross-Compiling and Finding the Right Kernel u-boot was downloaded and compiled. If you used the default configure, the source code was removed once it was done. Check and see:

host$ cd ~/BeagleBoard/oe/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/
host$ ls

You should see a directory starting with u-boot-. The rest of the name tells what version you have. Change to that directory and see what's there:

host$ cd u-boot-*
host$ ls

If you see a git directory, you are in luck. If you see just a temp directory you need to go back to EBC Exercise 22 Cross-Compiling and Finding the Right Kernel and get it installed.

Once you have the git directory, cd to it and look around.

Compiling U-boot

You can now compile U-boot.

host$ source ~/.oe/crossCompileEnv.sh
host$ make


  1. Modify u-boot to include your initials in the prompt. (Hint: Look for the omap3_beagle.h file.)
  2. Learn what is done when the boot command in entered in u-boot.
  3. Find where the code for boot is defined in the u-boot source.


u-boot# help boot
boot - boot default, i.e., run 'bootcmd'

u-boot# print bootcmd
bootcmd=if mmc rescan ${mmcdev}; then if userbutton; then setenv bootenv user.txt;fi;echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loaduimage; then run mmcboot;fi;fi;run nandboot;

Pretty print the output (by hand) and draw a flow chart of the logic. Print each variable that is reference by the code.

thumb‎ Embedded Linux Class by Mark A. Yoder