Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: herter on April 11, 2014, 12:29:58 PM

Title: Booting splash screen
Post by: herter on April 11, 2014, 12:29:58 PM
Hello,

I'm developping a system driven by the A20-OLinuXino with a 4GB Sd Card and a Debian-LXDE Linux.
The system take approximately 30 seconds to boot, and keep the screen black all this time.

To make this system more user-friendly, I want to display a splash screen during the boot.

I tried the following procedure :
- Download the u-boot sources, and modify the file corresponding with my board to add #define CONFIG_SPLASH_SCREEN. Then, recompile the u-boot and re-write it on the SD card.
   -> For this step, I followed the instructions about compiling and writing U-boot here http://olimex.wordpress.com/2013/09/18/7795/ (http://olimex.wordpress.com/2013/09/18/7795/)

- In the u-boot terminal :
     - fatload mmc 0 10000000 splashimg.bmp
     - cp.b 10000000 41F80000 ${filesize}
     - setenv splashimage 41F80000
     - saveenv
     - boot

But that doesn't works. The system boots, so I suppose I properly compiled and written the u-boot. But there is no boot splash, the screen stay black until the desktop is displayed.

How can I display a splash sreen during boot ?

Thanks.
Title: Re: Booting splash screen
Post by: isidoro on April 11, 2014, 03:24:50 PM
Hi,
you must be logged via uart at the  very start and just use the commands below:> help bmp
bmp info <imageAddr>            - display image info
bmp display <imageAddr> [x y]   - display image at x,y


http://www.denx.de/wiki/DULG/UBootBitmapSupport

Title: Re: Booting splash screen
Post by: herter on April 14, 2014, 12:31:53 PM
Hello,

I already tried this, because I already tried this tutorial, and others, but I can't because in my bootloader, the bmp commands disabled and return 'unknown command'.

I tried to enable them when I compiled u-boot, adding the  line
     #define CONFIG_CMD_BMP
in the file corresponding to my board, but that can't compile.
Title: Re: Booting splash screen
Post by: herter on April 22, 2014, 12:36:50 PM
Sorry for double-post, I give you an update :

Well, I compile U-boot for an a20-OLinuXino, form the u-boot directory, I edit the file include/configs/sunxi-commins.h

In this file, I add the lines :

    define CONFIG_SPLASH_SCREEN
    define CONFIG_SPLASH_SCREEN_ALIGN


To compile, I use commands :

$ make distclean
$ make A20_OLiunXino_MICRO_config
$ make CROSS_COMPILE=arm-cortexa7_neonvfpv4-linux-gnueabihf-


And that works, but is not enouth to display a boot splash, becouase the BMP command is not available in that bootloader.

So, in the same file, I add the line :

    define CONFIG_CMD_BMP

and recompile.

But that no compile, and I have and error message : "Requires CONFIG_LCD or CONFIG_VIDEO"

So, beofre this line, I add the line :

    define CONFIG_LCD


And that not compile, I have some error messages of type : "in function ... : lcd.c: undefined reference to ..."

I have the same if I replace CONFIG_LCD by CONFIG_VIDEO

(NB : each define is a sharp-define, but the sharps are not displayed here).

Someone can help me ?
Title: Re: Booting splash screen
Post by: Alex293 on August 01, 2014, 11:36:22 AM
Hi

I'm interested into adding a boot screen too. Did you make it work ?
Title: Re: Booting splash screen
Post by: AzHofi on August 08, 2014, 09:59:22 AM
+1, would be very nice a bootsplash tutorial
Title: Re: Booting splash screen
Post by: dudo on August 14, 2014, 04:29:43 PM
Here is a hint, currently I don't have time to write complete tutorial.
You can use initramfs image (or initrd) to load it with u-boot together with kernel. It is executed before main rootfs (or main distro). In that initrams image (which is, let's say, small filesystem) you can load some image/picture into framebuffer/display and then let main rootfs/distro booting.
I know this isn't howto or tutorial, but it's worth trying. It isn't so simple to implement. I think that some linux distros use this method.

Simpler method whould be to initiate image/picture loading into framebuffer before first script located in /etc/rcS.d/ is executed. That means, write your own script an put it in /etc/rcS.d/ to be alphabetically first.
Title: Re: Booting splash screen
Post by: geenna on August 18, 2014, 06:18:57 PM
Is possible add splash screen on the lcd? I think that the image will be shown after the loading of the module LCD near the end of the boot.
Is true?
Title: Re: Booting splash screen
Post by: dudo on August 21, 2014, 09:26:49 AM
It is possible, but depends on how do you implement splash image loading/showing. If your LCD depends on kernel module, then you can first load that module(s) and afterwards initiate splash image load. It all depends how deep can you configure your linux. In my case, LCD is compiled in kernel, so, after kernel loads, splash can be loaded.
Title: Re: Booting splash screen
Post by: MBR on August 21, 2014, 10:12:52 AM
Quote from: geenna on August 18, 2014, 06:18:57 PM
Is possible add splash screen on the lcd? I think that the image will be shown after the loading of the module LCD near the end of the boot.
Is true?

If your module is A20-LCD* (or A13-LCD*), the module for framebuffer is loades as soon as the udev is started, on the end of the boot, when /etc/rc.local is executed, is just enabled (and backlight turneed on). Look into this file how to do it, you also need the framebuffer, GPIO and PWM working and /sys mounted. If you switch vitrual TTY using openvt or chvt, you can display splash screen on another TTY while the messages are displaed on the first one.
Title: Re: Booting splash screen
Post by: geenna on August 22, 2014, 04:07:30 PM
Thank you.

I think to use a little workaround without recompile the u-boot.

I will redirect the serial output from u-boot to LCD (/dev/ttyS0 to /dev/tty7) and add programs like fbi in the init scripts to display the image on the fb.

If this solution will not work I will recompile (or search for download) u-boot with bmp support.

Title: Re: Booting splash screen
Post by: Alex293 on August 22, 2014, 07:07:28 PM
Maybe we can try using the fbi program with the u-boot pre boot used for the hello word.
Title: Re: Booting splash screen
Post by: MBR on August 25, 2014, 07:50:24 PM
To display a picture on framebuffer, you theoreticaly don't need any special program as long as you have a raw image in the same format (correct endianness, size and bits per pixel) as the framebuffer. You can simply write the raw image into framebufer by something like cat rawimage > /dev/fb0 (or zcat rawimage.gz > /dev/fb0, if you want to keep the file size small). The raw image can be made simply by writting the framebuffer with displayed image into file (like cat /dev/fb0 > rawimage).

And if you want to turn the LCD on as early as possible, enable the control GPIO pin in the FEX file by setting port to output (by setting MUX to 0) and setting output level to <1>, see FEX Guide on http://linux-sunxi.org/Fex_Guide (http://linux-sunxi.org/Fex_Guide) how to do it.
Title: Re: Booting splash screen
Post by: geenna on August 25, 2014, 07:58:35 PM
YES.

I wrote a little boot process that check if udev has been created /dev/fb0. After creation of the device I cat one raw Image.

THK
Title: Re: Booting splash screen
Post by: Alex293 on September 11, 2014, 04:45:17 PM
@geena : Hi can you share what you've done for this please ?
Title: Re: Booting splash screen
Post by: BMK on December 16, 2014, 09:02:56 PM
I note that newly purchased A20 Debian SD Cards have a splash screen at boot. Does anyone know how Olimex do it. I would like to change or remove this splash screen if possible.
Anyone Know how?
Title: Re: Booting splash screen
Post by: santox on June 08, 2017, 06:26:40 PM
the big problem here is wrong memory address. in my board the command

bdinfo

says the memory mapping starts at 0x4000000

...using this address i can load the bmp succesfully from emmc:
=>load mmc 0 0x4000000 splash.bmp

=> bmp info 0x40000000                                                                                                                                                                         
Image size    : 1280 x 800                                                                                                                                                                 
Bits per pixel: 8                                                                                                                                                                           
Compression   : 1   

anyway whe i try to display the image to the lvds connected lcd nothing is shown :(
=> bmp display 0x40000000                                                                                                                                                                         
Title: Re: Booting splash screen
Post by: SR-Digitronic on October 04, 2017, 06:07:00 PM
With self-built mainline U-Boot on SD card and 4.3" display it's going like:

git clone git://git.denx.de/u-boot.git u-boot-2017
cd u-boot-2017
git checkout v2017.07
scripts/kconfig/merge_config.sh configs/A20-OLinuXino_MICRO_defconfig


Modify the .config file (CONFIG_VIDEO_LCD_MODE from http://linux-sunxi.org/LCD#Script_for_automated_conversion)


--- .config     2017-10-04 16:47:01.604866748 +0200
+++ .config.lcdActive       2017-10-04 16:46:36.589380334 +0200
@@ -204,10 +204,10 @@
# CONFIG_I2C4_ENABLE is not set
# CONFIG_AXP_GPIO is not set
CONFIG_VIDEO=y
-CONFIG_VIDEO_HDMI=y
-CONFIG_VIDEO_VGA=y
+# CONFIG_VIDEO_HDMI is not set
+# CONFIG_VIDEO_VGA is not set
# CONFIG_VIDEO_COMPOSITE is not set
-CONFIG_VIDEO_LCD_MODE=""
+CONFIG_VIDEO_LCD_MODE="x:480,y:272,depth:18,pclk_khz:9000,le:10,ri:5,up:3,lo:8,hs:30,vs:5,sync:3,vmode:0"
CONFIG_VIDEO_LCD_DCLK_PHASE=1
CONFIG_VIDEO_LCD_POWER=""
CONFIG_VIDEO_LCD_RESET=""
@@ -523,7 +523,7 @@
#
# Misc commands
#
-# CONFIG_CMD_BMP is not set
+CONFIG_CMD_BMP=y
# CONFIG_CMD_BSP is not set
# CONFIG_CMD_BKOPS_ENABLE is not set
# CONFIG_CMD_CACHE is not set


Compile:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4

And put it on SD card:

sudo dd if=u-boot-sunxi-with-spl.bin of=${SD} bs=1024 seek=8;

Or test it via OTG/FEL injection:

sudo sunxi-fel uboot u-boot-sunxi-with-spl.bin

In U-Boot do:

$ load mmc 0:1 50000000 /bootlogo.bmp
reading /bootlogo.bmp
391802 bytes read in 51 ms (7.3 MiB/s)
$ bmp info 50000000
Image size    : 480 x 272
Bits per pixel: 24
Compression   : 0
$ bmp display 50000000


You can add this to boot.cmd, but haven't done that yet.

Edit: This does not work properly yet, linux kernel distorts the logo as soon as it boots
Title: Re: Booting splash screen
Post by: igorpec on October 06, 2017, 09:29:45 AM
Get Armbian and exchange /boot/boot.bmp and you are done. At least for the bootloader.
Title: Re: Booting splash screen
Post by: Fra on May 16, 2022, 03:52:32 PM
Hi, I know that this is an old post, but "groped does not harm".
Trying this command
sudo dd if=u-boot-sunxi-with-spl.bin of=${SD} bs=1024 seek=8;gives me back:
dd: failed to open '': No such file or directory
So I tried
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
But in U-Boot bmp command are unknow.
Do you knw a possible solution for this or other working sequence of commands to change the splash screen?
Title: Re: Booting splash screen
Post by: JohnS on May 19, 2022, 10:29:50 AM
You may need SKIP instead of SEEK

John
Title: Re: Booting splash screen
Post by: Fra on May 26, 2022, 12:20:07 PM
It doesn't work.
If I use
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 skip=8
reboot

The boards doesen't boot anymore (the green LED reamins off)  :(
Title: Re: Booting splash screen
Post by: JohnS on May 27, 2022, 10:51:22 AM
OK - sorry.

John
Title: Re: Booting splash screen
Post by: kiarasur on December 28, 2022, 12:01:35 PM
A bootsplash can be a simple visualization of the scrolling boot messages in the console, but it can also present graphics or some combinations of both.