How to develop U-Boot bootloader

When moving Linux to a custom hardware, developers need to often make adjustments to a u-boot bootloader.. For example, supporting board-specific features or adding a few routines that give the end-user signs that the device has indeed powered on, and that something is happening while the boot process takes place. Many engineers prefer to do development with the assistance of an IDE. In TimeStorm, which is Timesys’ IDE, it’s easy to modify U-Boot and to build binaries with target system appropriate Software Development Kit (SDK).

This document will describe How to develop and build the U-Boot Project. Before you create and build a U-Boot project, first install a Timesys U-Boot plugin by following the How to Install Timesys external plugins document.

To develop and build the U-Boot Project in TimeStorm

  1. Creating a U-Boot project
    1. U-Boot Source Management
    2. Specify U-Boot Build Settings
    3. U-Boot Build Output
  2. Configuring the U-Boot
  3. Building U-Boot Project

1. Creating a U-Boot Project:

To create a U-Boot project, open the New Project wizard by clicking File --> New --> Other from the main menu. Select Boot Loader --> U-Boot Project and click ‘Next’ to continue, as shown below.

Project Page:

The page shown below allows you to enter a name for the project name field, You can create a U-Boot project using the U-Boot sources included in the SDK (Factory/Yocto/Other). Select the SDK, and point ‘U-Boot Source Path’, ‘U-Boot Config Path’ by clicking the browse buttons.

U-Boot Source Management:

You can create a U-Boot project by making a copy of your existing U-Boot sources or use your U-Boot sources. This page allows you to choose how you want to manage your U-Boot sources. You can create the project in your U-Boot source location or at a different location. You can also choose to create the project in TimeStorm workspace or at a different location as shown below.

U-Boot Build Settings:

U-Boot build settings page shown below allows you to enter the Architecture, Parallel Make. If the SDK selected on the previous page has this information then these values are filled in automatically. The cross-compile prefix for the U-Boot build is set based on the selected SDK.

U-Boot Build Output

Build Output page allows you to manage the U-Boot build output. You can save the U-Boot build output in a project or in a subdirectory in the U-Boot project or an external directory.

Click Finish to create the U-Boot project. Copying the U-Boot sources takes some time and you may notice a delay in creating the project.

Please note that to conserve memory and CPU resources, indexing is turned off for U-Boot projects. The side effect of this is you may see errors / warnings when you open U-Boot sources in an editor.

2. Configuring the U-Boot:

You can configure the U-Boot by right clicking on the U-Boot project --> Timestorm Configure Boot Loader, and then clicking MenuConfig or XConfig.

TimeStorm launches the menuconfig or xconfig editor outside TimeStorm. You can configure the U-Boot and save your changes. Please note that for running menuconfig, you should have libncurses5-dev and xterm package installed, and for running xconfig, you should have qt3-dev-tools or qt4-dev-tools package and xterm installed.

Menuconfig editor is shown below.

The XConfig editor is shown below.

3. Building and Deploying the U-Boot:

To build a u-boot project right click on the project and click on build project. The build progress is displayed in the console view.

While building the u-boot, sometimes you may see that you have to run mrproper. You can run mrproper by using the make targets included with TimeStorm u-boot project. To launch the Make Targets window, right-click on the u-boot project and click on Make Targets > Build …, and the make targets window will display as shown below.

To run a make target, select the target from the list and click Build.

Booting the board with the u-boot image that is built is specific to the board. Please refer to the getting started guide for your board for instructions on how to deploy the u-boot image and boot the board. TimeStorm does not include any features for deploying the u-boot and booting the board.