2021-12-27 05:15 AM
Hi all,
How can i add support for animated splash screen on stm32mp1 ?
I have understanding of the psplash recipe used for custom bootscreen which works completely fine. I would like to have animation while system is booting up.
Any inputs are highly appreciated.
Solved! Go to Solution.
2022-01-03 10:40 AM
Hi,
The psplash recipe is used to configure a Linux kernel animated splash screen !!!
Do you want animation during U-Boot = load of kernel ?
or during Linux boot (up to user space is ready / applications are running) ?
see https://git.yoctoproject.org/poky/plain/meta/recipes-core/psplash/psplash_git.bb
PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information.
So "psplash" recipe is linked to the boot screen in Linux kernel / not linked to U-Boot
For U-Boot side, I don't think a generic feature "animated splash screen"exists in U-Boot for
any platform but U-Boot load of the kernel should be faster enough to avoid the animation need....
For Linux part, If you’re using our Yocto Project Reference Images, these use the splash screen feature of the Linux kernel, which only support still images.
If think for animation you need to change pslash support to plymouth
http://layers.openembedded.org/layerindex/recipe/39966/
https://www.freedesktop.org/wiki/Software/Plymouth/?_sm_au_=iQWjnqPpp7N78SQ8cLpsvK618Vf61
"psplash" and "plymouth" are generic Linux / Yocto featrures.
They are not liked to OpenSTLInux or to STM32MP15, you should be found ressource of them.
Regards
Patrick
----- deeper information on U-Boot --------------------------------------------------------------------------------------
=> today only fixed LOGO is supported (CONFIG_LCD_LOGO / CONFIG_VIDEO_LOGO)
or display of background BMP file present in extlinux.conf (./cmd/pxe_utils.c:1442 = bmp_display)
This last option is used in OpenSTLinux / on ST boards because it is more easier for developper
and for demo (the same file is used in U-Boot splash screeen / Linux psplash = boots)
meta-st/meta-st-stm32mp/classes/extlinuxconf-stm32mp.bbclass
splashscreen_name = localdata.getVar('UBOOT_EXTLINUX_SPLASH')
But as U-Boot for stm32mp15 provides a video driver, you can implement any board specific feature to update the attached screen on your board.
The animation can be handle inside the weak function show_boot_progress(), used when CONFIG_SHOW_BOOT_PROGRESS=y as it is defined in common/Kconfig.boot
=> you need to handle the frame buffer directly to create the animation (for progress bar fro example,
you can use prepare a buffer in your code and use video_sync_copy() & video_sync() as it is
done in video_bmp_display)
Today, some board use this weak function show_boot_progress() to handle boot LEDs or to print
this boot information on console... but I don't see any dynamic display update !
The simplest graphical solution is to activate the video console and to display the advancement
on the screen with enviroment "stdout=serial,vidconsole" (same ouput on the uart)
=> you can display the boot progress in U-Boot console,
for example in board/st/stv0991/stv0991.c:
#if CONFIG_IS_ENABLED(BOOTSTAGE)
void show_boot_progress(int progress)
{
printf("%i\n", progress);
}
#endif
but it is not a animated splash screen, just console information.
You can also use directly the video console API (as it is done in splash_display_banner)
to avoid to duplciate the uart console information on vidconsole
=> use a cheap "progress bar", for example display only '#' character for each expected progress
by using API : vidconsole_position_cursor() / vidconsole_put_string() / vidconsole_put_char()
warning:the progress value is not lineaire, the last step is BOOTSTAGE_ID_RUN_OS = 15 and it is not the greatest enum bootstage_id
or to display the progress value on the video console:
void show_boot_progress(int progress)
{
char buf[3];
struct udevice *dev;
int col, row, ret;
ret = uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &dev);
if (ret)
return;
sprintf(buf, "%03i\n", progress);
vidconsole_position_cursor(dev, 10, 10);
vidconsole_put_string(con, buf);
}
warning : vidconsole functions should be called only after realocation / when video console is ready to
avoid issue, some protection should be added in this example.
2022-01-03 10:40 AM
Hi,
The psplash recipe is used to configure a Linux kernel animated splash screen !!!
Do you want animation during U-Boot = load of kernel ?
or during Linux boot (up to user space is ready / applications are running) ?
see https://git.yoctoproject.org/poky/plain/meta/recipes-core/psplash/psplash_git.bb
PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information.
So "psplash" recipe is linked to the boot screen in Linux kernel / not linked to U-Boot
For U-Boot side, I don't think a generic feature "animated splash screen"exists in U-Boot for
any platform but U-Boot load of the kernel should be faster enough to avoid the animation need....
For Linux part, If you’re using our Yocto Project Reference Images, these use the splash screen feature of the Linux kernel, which only support still images.
If think for animation you need to change pslash support to plymouth
http://layers.openembedded.org/layerindex/recipe/39966/
https://www.freedesktop.org/wiki/Software/Plymouth/?_sm_au_=iQWjnqPpp7N78SQ8cLpsvK618Vf61
"psplash" and "plymouth" are generic Linux / Yocto featrures.
They are not liked to OpenSTLInux or to STM32MP15, you should be found ressource of them.
Regards
Patrick
----- deeper information on U-Boot --------------------------------------------------------------------------------------
=> today only fixed LOGO is supported (CONFIG_LCD_LOGO / CONFIG_VIDEO_LOGO)
or display of background BMP file present in extlinux.conf (./cmd/pxe_utils.c:1442 = bmp_display)
This last option is used in OpenSTLinux / on ST boards because it is more easier for developper
and for demo (the same file is used in U-Boot splash screeen / Linux psplash = boots)
meta-st/meta-st-stm32mp/classes/extlinuxconf-stm32mp.bbclass
splashscreen_name = localdata.getVar('UBOOT_EXTLINUX_SPLASH')
But as U-Boot for stm32mp15 provides a video driver, you can implement any board specific feature to update the attached screen on your board.
The animation can be handle inside the weak function show_boot_progress(), used when CONFIG_SHOW_BOOT_PROGRESS=y as it is defined in common/Kconfig.boot
=> you need to handle the frame buffer directly to create the animation (for progress bar fro example,
you can use prepare a buffer in your code and use video_sync_copy() & video_sync() as it is
done in video_bmp_display)
Today, some board use this weak function show_boot_progress() to handle boot LEDs or to print
this boot information on console... but I don't see any dynamic display update !
The simplest graphical solution is to activate the video console and to display the advancement
on the screen with enviroment "stdout=serial,vidconsole" (same ouput on the uart)
=> you can display the boot progress in U-Boot console,
for example in board/st/stv0991/stv0991.c:
#if CONFIG_IS_ENABLED(BOOTSTAGE)
void show_boot_progress(int progress)
{
printf("%i\n", progress);
}
#endif
but it is not a animated splash screen, just console information.
You can also use directly the video console API (as it is done in splash_display_banner)
to avoid to duplciate the uart console information on vidconsole
=> use a cheap "progress bar", for example display only '#' character for each expected progress
by using API : vidconsole_position_cursor() / vidconsole_put_string() / vidconsole_put_char()
warning:the progress value is not lineaire, the last step is BOOTSTAGE_ID_RUN_OS = 15 and it is not the greatest enum bootstage_id
or to display the progress value on the video console:
void show_boot_progress(int progress)
{
char buf[3];
struct udevice *dev;
int col, row, ret;
ret = uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &dev);
if (ret)
return;
sprintf(buf, "%03i\n", progress);
vidconsole_position_cursor(dev, 10, 10);
vidconsole_put_string(con, buf);
}
warning : vidconsole functions should be called only after realocation / when video console is ready to
avoid issue, some protection should be added in this example.
2022-01-10 02:49 AM
@Community member : Thank you so much for detailed response. This helps a lot.