Search by Tags

Splash Screen on U-Boot

 

Article updated at 16 Mar 2020
Compare with Revision




Subscribe for this article updates

Introduction

If U-Boot supports the framebuffer, U-Boot can be used to display a splash screen or a custom company logo.

TorizonCore

The customization of the bootloader splash screen on Torizon is currently not covered as a use case. Although the instructions provided in this article might work, Toradex does not encourage you to re-build the components of TorizonCore from source. We do support custom splash screen on TorizonCore as early as the initramfs is loaded, see the article Splash Screen Customization on TorizonCore for more details.

Yocto Project Reference Images

This article has been written with the customization of the Toradex Yocto Project Reference Images in mind.

Creating a Custom Logo with GIMP

Create a new file in GIMP and choose a dimension multiple of 8. As an example, a 324 x 64 pixels image was created, configured as seen in the picture bellow:


Write some text or your company's name.


Converting from PNG to BMP

U-Boot can read a specific image format. Use the following command to convert the PNG image to BPM.

convert testlogo.png -type Palette -colors 224 -depth 8 -compress none -verbose BMP3:testlogo.bmp

Warning: 8-bit depth is a requirement. It has been reported that the parameter -depth 8 from the command above does not always work. Make sure that your image bit depth is correct manually. A possible workaround is to change one or more pixel colors, in a way that is is not perceptible but does change the image bit depth to 8 bits.

Adding our Image and Compiling U-Boot Source

To get the source code, toolchain and the instructions how to build a custom U-boot, follow the U-Boot source article.

Toradex has its own logo set in the U-boot source. The logo can be found at "u-boot-toradex/tools/logos/toradex.bmp". A simple option to have a custom logo is replacing toradex.bmp file. It is necessary to keep the same “toradex.bmp” file name for the build system finds the logo.

cp ~/testlogo.bmp ~/u-boot-toradex/tools/logos/toradex.bmp

Compile the U-boot according to the article quoted above.

Prepare an SD card and update your module as described in the articles below (according to the module of interest):

Flashing Embedded Linux to iMX6 Modules

Flashing Embedded Linux to iMX7 Modules

Flashing Embedded Linux to Vybrid Modules

Flashing Embedded Linux to Tegra Modules

After U-Boot is compiled and updated on the module, the result is the following:


Note: When using RGB interfaces with Apalis iMX6 based modules the RESET_MOCI# signal must be released with the following command in the U-Boot console:

gpio clear 28

Manipulating Splash Screen in U-Boot at Runtime

It is also possible to load custom images at runtime. The image can be read into memory from a variety of sources.

Network TFTP:

tftp ${loadaddr} <bmp file name>

MMC/SD Card:

mmc dev 0
mmc rescan
load mmc 0 ${loadaddr} <bmp file name>

USB Storage:

usb start
load usb <device number> ${loadaddr} <bmp file name>

After loading the image into memory address, display it with the bmp command:

bmp display ${loadaddr}

Practical Example

To show how U-Boot can be easily customized, we created a simple practical example where U-Boot changes the U-Boot splash screen when the module starts to update.

Create a PNG image in GIMP and convert to BMP as explained above.


Store the image into a USB flash drive, SD Card or TFTP server, in our case, the BMP file was stored on a TFTP server.

Create a environment variable that loads the image, display it and starts to update.

run setupdate
setenv update_logo 'tftp ${loadaddr} updating.bmp && bmp display ${loadaddr} && run update'
run update_logo

As soon as ‘run update_logo’ is given, the image is first displayed and then the update process goes on.

The result is shown in the following video.