April 1, 2017

U-Boot - building U-boot

The first step of course is to fetch the sources, and perhaps apply patches appropriate to whatever machine or board you want to install U-boot on. Official releases come out several times a year and get named with the year and month (for example I am now working with v2016.11).

U-Boot has excellent documentation, and it is worth your time to study first the README file that should be found in the top level of the sources you are working with. There is also a "doc" directory which contains a big collection of README files on various special topics and specific board targets.

The U-Boot makefile is the heart of the build process. It is a monster, 1647 lines in the current release. However you don't need to study it intensely unless you want to.

I am currently working with the Orange Pi PC plus, so what I do to build U-Boot for this board is this:

export CROSS_COMPILE=arm-linux-gnu-
make distclearn
make orangepi_pc_plus_defconfig
make all
Note that the prefix for your compiler may be different.

If you are wondering what configuration files are available for the "defconfig" line, look in the config directory. You must choose a name that corresponds to a file in this directory.

Normally the build is quiet with an abbreviated console output. If you want to see more details, you can specify verbosity by placing "V=1" on the make invocation, like so:

make V=1 all
This will show the gcc commands issued with all their switches and options. In general this is not such a good idea as any errors tend to get lost in the flood of output, but it can be useful and informative.


Have any comments? Questions? Drop me a line!

Tom's electronics pages / tom@mmto.org