Displaying Static Splash Image Immediately After Reboot in i.MX RT10xx uClinux BSP
1. Overview
This application note explains how to show a static splash image on the display immediately after power-on / reboot. This feature can be used to indicate to the user that the device is alive and running, while the system still continues to boot up.
2. Understanding Static Splash Image Implementation
2.1. U-Boot Display Driver
Graphics facility in U-Boot for the IMXRT10xx BSP is provided by the framebuffer drivers drivers/video/mxsfb.c
with using eLCDIF controller of the i.MXRT10xx SoC. LCD screen resolution is 480x272, 16-bit RGB565 color mode is used by the framebuffer driver.
In addition to the video driver itself, it is required to turn on the backlight to visualize the image on the screen. On NXP i.MX RT10xx-EVK boards the backlight is controlled via the GPIO, so the drivers/video/backlight_gpio.c
U-Boot driver is used to turn it on.
If the LCD is not physically connected, we recommend keeping the GPIO controlling the LCD backlight off to avoid possible damage to the board components. Since this software for NXP i.MX RT10xx-EVK boards can be used in both variants: with and without the LCD connected, the backlight is off in the default configuration. In IMXRT10xx U-Boot the backlight control is tied to the splashimage
environment variable. This is standard U-Boot variable to enable the splash screen facility. If the splashimage
variable is set (and so that mean that the splash image must be displayed), then the board code will automatically enable the LCD backlight, otherwise the LCD backlight will remain off.
To enable the LCD backlight the user must define the splashimage
environment variable, store it to persistent storage and then reset the board. Typically the loadaddr
value can be used for the splashimage
variable:
=> setenv splashimage ${loadaddr}
=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
=> reset
User can issue the bmp
command to draw an image from a bmp file. 8-, 16- and 24-bits bmp images are supported. Here is the example on how to draw image from the splash-rt1050-series_24.bmp
file from the FAT FS partition on the SD card:
=> fatload mmc 0 $loadaddr splash-rt1050-series_24.bmp
391736 bytes read in 88 ms (4.2 MiB/s)
=> bmp info $loadaddr
Image size : 480 x 272
Bits per pixel: 24
Compression : 0
=> bmp display $loadaddr
=>
2.2. U-Boot Splash Image
Displaying static splash image on boot is the standard U-Boot feature. This is enabled by the CONFIG_SPLASH_SCREEN
and CONFIG_SPLASH_SOURCE
options.
By default the file with the splash image is looked up by U-Boot in the first partition of SD card with the FAT File System. This is configured by the spashsource
environment variable which is set to mmc_fs
. Refer to u-boot/doc/README.splashprepare
and the splash_screen_prepare()
function in u-boot/common/splash.c
for details for other possible locations for the splash image file. The default filename for the splash image is splash.bmp
, this can be changed by defining the splashfile
environment variable. The splashimage
environment variable is used to specify the address in RAM where the splash screen will be prepared prior to passing to the framebuffer. Note that the splashimage
environment variable is also used to enable LCD backlight in IMXRT10XX BSP and is not defined by default. User must set the splashimage
variable to enable displaying the splash screen on boot. Typically the loadaddr
value can be used for the splashimage
address.
3. Installing Splash Image
The following instruction can be used to install the splash-rt1050-series_24.bmp
file (refer to u-boot/tools/logos/splash-rt1050-series_24.bmp
in the top of the installation tree) as a static splash screen:
Prepare bootable SD Card as described in Installing U-Boot to the NXP i.MX RT10XX EVK Board
On the development host mount the first partition of the SD Card, and save the
splash-rt1050-series_24.bmp
file assplash.bmp
:$ sudo mount /dev/sdX1 /mnt $ cp ${INSTALL_ROOT}/u-boot/tools/logos/splash-rt1050-series_24.bmp /mnt/splash.bmp
Umount, and safely remove the SD Card:
$ sudo umount /mnt $ sync
Insert the bootable SD Card to the SD Card holder on the NXP i.MX RT10xx EVK board. Power on the target board. Stop booting in the U-Boot command monitor and set the
splashimage
variable to enable the splash screen:=> setenv splashimage ${loadaddr} => saveenv Saving Environment to MMC... Writing to MMC(0)... OK =>
Reset the board. Validate that the splash screen image is displayed automatically when U-Boot started again.
For correct splash displaying it is assumed that the U-Boot environment variables are set as follows:
spashsource
is set set asmmc_fs
splashimage
is set as0x80007fc0
splashfile
is not defined=> print splashsource splashsource=mmc_fs => print splashimage splashimage=0x80007fc0 => print splashfile ## Error: "splashfile" not defined =>