Method and system for quickly playing boot animation of embedded system, and storage medium
By employing H264 compressed data and multi-core parallel startup in the embedded system, the problems of insufficient storage space and unsmooth animation effects were solved, enabling fast screen lighting and high frame rate animation display, thus improving the user experience.
Patent Information
- Application Number
- CN202410551927.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2025-11-07
AI Technical Summary
Existing embedded system boot animation technology has high storage requirements, the animation effect is not smooth, and the use of uncompressed image data leads to insufficient storage space.
H264 compressed data is used as the data source for the boot animation. In the uboot stage, the second CPU core is used to light up the screen and render the animation, and the H264 hardware decoder is used to achieve real-time decoding.
Without affecting the main core boot speed, it significantly reduces storage space requirements, improves animation smoothness, shortens boot time, and enhances user experience.
Smart Images

Figure CN120909657A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of embedded systems, and particularly relates to a method for fast playing a startup animation of an embedded system, a storage medium and a system. BACKGROUND
[0002] The startup of an embedded system is generally composed of power-on of a chip, execution of startup code fixed in the chip, execution of a u-boot boot program, loading of an operating system, and startup of an application program. Most hardware drivers are initialized in the operating system stage, such as initialization and drawing of a screen. The time from power-on of the chip to loading and running of the operating system may be several seconds to tens of seconds. If the screen is initialized in the operating system, the user may mistakenly think that there is a problem with the product startup, and may be somewhat anxious. Therefore, the timing of screen initialization is advanced to the first-stage boot program u-boot in some products. The screen is initialized and pictures are displayed in the u-boot, and the embedded system plays pictures during the power-on startup process. In this way, the fast startup capability of the embedded product can be exhibited, and the anxiety of the user during waiting can be alleviated, and the user experience is improved.
[0003] The development history of the prior art background of the startup animation of an embedded product covers the development from the early simple static startup logo to the current rich and varied dynamic animation display as follows:
[0004] Static startup logo: In the early days of embedded systems, a static startup logo was often displayed during startup, usually a logo or iconic graphic of the manufacturer or operating system, such as the TUX penguin of the Linux kernel. This logo is usually compiled as part of the kernel and displayed on the display after hardware initialization is complete when the system starts up, until the operating system is fully loaded and takes over the display output.
[0005] Dynamic startup animation: With the enhancement of the functions of embedded devices and the improvement of user experience needs, the static logo gradually evolved into a more attractive dynamic startup animation. These animations can include a sequence of consecutive frames, transition effects, animated elements, text information, etc., aiming to provide a more lively and professional startup experience for users. The introduction of dynamic startup animations not only enhances the brand image, but also to some extent alleviates the anxiety of users when waiting for the system to start up.
[0006] In addition, the characteristics of embedded products are usually to use a smaller capacity Nor Flash storage, usually 16MB, 32MB, 64MB. Due to the process of Nor Flash, its price is relatively high. In common embedded products, 16MB is used as the main storage.
[0007] Boot loaders such as U-Boot typically provide support for displaying boot animations. For example, U-Boot can draw animations directly on the framebuffer using its built-in graphics library (such as Fbdev), or it can present animations by loading additional animation display programs (such as PSplash), which primarily feature the need to store complete uncompressed frame data.
[0008] Some products load animations during the operating system startup phase.
[0009] However, the prior art also has the following defects:
[0010] Although the prior art can achieve the display of boot animations, it has certain requirements for the design of embedded products and the memory capacity, and the number of frames of the animation is also relatively simple, usually using a few frames of images in combination with software rendering to achieve the animation effect.
[0011] 1. Taking a 1080P image as an example, each frame of uncompressed data requires 8294400 Bytes of space, about 8M space, and for the 16MB memory space commonly used in embedded products, it can only store less than 2 pictures of data.
[0012] 2. Even if low-resolution images are used, only a few pictures are switched, and the animation effect is not as smooth as video display.
[0013] In addition, common technical terms include:
[0014] U-Boot: U-Boot (Universal Boot Loader) is a widely used boot loader for embedded systems. It plays a key role in the startup process of computer systems, similar to the BIOS (Basic Input Output System) on personal computers. The main responsibilities of U-Boot are as follows:
[0015] H.264: H.264, officially known as MPEG-4 Part 10 Advanced Video Coding (AVC), is a high-efficiency video coding standard developed by the International Telecommunication Union (ITU) and the International Organization for Standardization (ISO). H.264 aims to provide high-quality video compression while maintaining low bandwidth requirements and storage space occupation, suitable for various applications such as digital television broadcasting, streaming services, video conferencing, mobile device video, etc.
[0016] Multi-core CPU: in a SOC system, there are multiple CPUs of the same architecture or different architectures, and each CPU core can independently run a program. The CPU number generally starts from 0. For a dual-core CPU, the main core is numbered as CPU0, and the second core is numbered as CPU1. SUMMARY
[0017] To solve the above problems, the purpose of the present application is to:
[0018] A method for quickly lighting the screen is provided, and the screen lighting time is advanced to the uboot stage.
[0019] A multi-core parallel starting method is provided, which can perform screen lighting actions by the second CPU core without affecting the starting speed of the main core.
[0020] The main problem solved by the present application is that the existing boot animation uses uncompressed picture data for rendering, which causes insufficient storage space of the embedded product.
[0021] The problem of unsmooth animation effect introduced by using a limited number of static pictures for animation rendering in the prior art is solved.
[0022] Specifically, the present application provides a method for quickly playing a boot animation of an embedded system, the method comprising:
[0023] S1, power on the chip and run the bootrom program;
[0024] S2, the bootrom program reads the uboot image in the uboot of the Nor Flash partition from the flash to the memory to run the uboot program;
[0025] S3, the uboot program reads the kernel image in the kernel of the Nor Flash partition from the flash to the memory; further, steps S4 and S5 are performed respectively;
[0026] S4, the first CPU, which is the main CPU that is powered on and runs, is numbered from CPU0, and the execution process of power on in the figure is performed by the main CPU, that is, CPU0, and the second CPU core, that is, CPU1, is started. The main CPU core sets the reset entry address of the second CPU core, that is, the CPU1 core, to a suitable position through the chip internal CCU (CPU Control Unit) controller, and controls the reset of the second CPU core through the controller. After the second CPU core is reset, the second CPU core starts the animation rendering step; further comprising:
[0027] S4.1, initialize the LCD driver;
[0028] S4.2, loading start animation data to RAM, wherein the data is from picture data in a Nor Flash partition; comprising:
[0029] 1. reading animation data, that is, H264 code stream data, needed to be displayed from Flash to memory; 2. CPU1 calling H264 hardware decoder to decode H264 code stream data in memory; 3. the decoder outputting uncompressed data, which can be used to display on LCD;
[0030] S4.3, rendering data to screen for display; proceeding to step S6;
[0031] S5, the main CPU core continuing to run kernel; and then proceeding to step S6 and step S7 respectively;
[0032] S6, the main CPU core informing the second CPU core to end LCD rendering through an IPI (Inner Porcessor Interface) interface, and the subsequent LCD rendering work being taken over by the kernel;
[0033] S7, mounting a root file system and running a user program.
[0034] The Nor Flash partition comprises: uboot, picture data, kernel, and rootfs.
[0035] In step S4, in an early stage of power-on start of the embedded product, usually within 1 second after power-on, the H264 code stream data is read from a fixed position in Flash to memory by the main CPU in a u-boot boot program, and the second CPU is started by the main CPU, the second CPU runs the H264 decoder, obtains the H264 code stream from the memory, and calls the H246 decoding program to realize real-time decoding of the h264 code stream by using the h264 hardware decoder of the chip, and the highest speed can reach 1080p@30fps, and the decoded data is sent to the LCD for display.
[0036] The main CPU starts the second CPU core in the uboot stage, and the work of screen lighting and rendering is given to the second CPU core for running, without affecting the start of the main CPU.
[0037] The flow of the animation rendering comprises:
[0038] Step S4.2 further comprises the following steps, which are all run on the second CPU core, that is, on CPU1:
[0039] S4.2.1, reading H264 code stream, that is, compressed picture data, from Flash;
[0040] S4.2.2, calling the decoder to decode, that is, calling the h264_decode_frame function interface, for decoding, which uses the h264 hardware decoder implementation at the bottom;
[0041] S4.3, displaying the decoded data;
[0042] In step S6, it is judged whether the system startup is completed, if yes, the rendering is ended; if not, it returns to step S4.1.
[0043] The Flash storage includes H264 / JPEG code stream.
[0044] The application also relates to a storage medium, which stores a computer program, and the computer program is read and executed by a processor to execute the method for quickly playing an opening animation of an embedded system according to any one of the preceding methods.
[0045] The application also relates to a system, which is an embedded system and comprises a processor, a memory and a communication bus, the processor is connected with the memory through the communication bus to communicate, so as to execute the method for quickly playing an opening animation of an embedded system according to any one of the preceding methods.
[0046] Therefore, the application has the following advantages:
[0047] 1. The application uses H264 compressed data as the data source of the opening animation, so that the required storage space can be greatly reduced.
[0048] 2. The application uses the multi-core parallel startup mode, so that the screen can be lighted and the animation can be displayed in a short time without affecting the startup speed of the main core, and the user experience is improved. DETAILED DESCRIPTION
[0049] The accompanying drawings, which are included to provide a further understanding of the application and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application.
[0050] Figure 1 is a flowchart of a conventional opening startup animation loading process in the prior art.
[0051] Figure 2 is a flowchart of a conventional picture data storage and rendering mode.
[0052] Figure 3 is a flowchart of the opening startup provided by the method.
[0053] Figure 4 is a flowchart of the data storage and rendering mode provided by the method. DETAILED DESCRIPTION
[0054] In order to make the technical contents and advantages of the present application more clearly understood, the present application will be further described in detail in conjunction with the accompanying drawings.
[0055] As shown in the figure, the process of the conventional boot-up startup animation loading in the prior art includes: Figure 1
[0056] reading uboot, i.e. the uboot image in the Nor Flash partition, from the flash to the memory to run the bootrom; reading kernel, i.e. the kernel image in the Nor Flash partition, from the flash to the memory to run the uboot; and then running the kernel.
[0057] Further, initializing the LCD drive;
[0058] Further, loading the startup animation data to the RAM, wherein the data is from the picture data in the Nor Flash partition;
[0059] Further, rendering the data to the screen for display;
[0060] mounting the root file system and running the user program.
[0061] As shown in the figure, the conventional picture data storage and rendering method in the prior art includes: Figure 2
[0062] looping to read the Frame data from the flash;
[0063] calling the LCD display interface to display;
[0064] judging whether the system is completed, if yes, ending the rendering, if not, returning to the step of looping to read the Frame data.
[0065] The Flash storage includes Frame0 data, Frame1 data and Frame2 data.
[0066] The present application provides a method for fast playing the boot-up animation of the embedded system, and the startup process thereof is shown in the figure, which includes: Figure 3
[0067] S1, powering on the chip to run the bootrom program;
[0068] S2, the bootrom program reads uboot, i.e. the uboot image in the Nor Flash partition, from the flash to the memory to run the uboot program;
[0069] S3, the uboot program reads the kernel, i.e. the kernel image in the Nor Flash partition, into the memory; further, steps S4 and S5 are performed respectively;
[0070] S4, the first CPU, i.e. the CPU0, which is powered on and runs, executes the processes of power-on in the figure, and the main CPU, i.e. the CPU0, executes the processes of power-on, starts the second CPU core, i.e. the CPU1, the main CPU core sets the reset entry address of the second CPU core, i.e. the CPU1 core, to a suitable position through the chip internal CCU (CPU Control Unit) controller, and controls the reset of the second CPU core through the controller, after the reset of the second CPU core, the second CPU core starts the step of animation rendering; further comprising:
[0071] S4.1, initializing the LCD driver;
[0072] S4.2, loading the start-up animation data into the RAM, wherein the data is from the picture data in the Nor Flash partition; comprising:
[0073] 1. reading the animation data, i.e. the H264 code stream data, to be displayed from the Flash into the memory; 2. the CPU1 calls the H264 hardware decoder to decode the H264 code stream data in the memory; 3. the decoder outputs uncompressed data, which can be used for display on the LCD;
[0074] S4.3, rendering the data to the screen for display; performing step S6;
[0075] S5, the main CPU core continues to run the kernel; further, steps S6 and S7 are performed respectively;
[0076] S6, the main CPU core notifies the second CPU core to end the LCD rendering through the IPI (Inner Porcessor Interface) interface, and the subsequent LCD rendering work is taken over by the kernel;
[0077] S7, mounting the root file system and running the user program.
[0078] The Nor Flash partition comprises: uboot, picture data, kernel, and rootfs.
[0079] In the early stage of power-on start-up of the embedded product, usually within 1 second of power-on, the H264 code stream data is read from the fixed position of the Flash into the memory by the main CPU in the u-boot boot program,
[0080] And the second CPU is started by the main CPU, the second CPU runs the H264 decoder, obtains the H264 code stream from the memory, and calls the H246 decoding program, uses the h264 hardware decoder of the chip to realize real-time decoding of the h264 code stream, and the highest can reach 1080p@30fps, and sends the decoded data to the LCD display.
[0081] Meanwhile, the main CPU continues to load the kernel image and runs the kernel, and at the appropriate time, the LCD rendering work is taken over by the kernel after the main CPU kernel operating system initialization is completed, which has basically no effect on the startup speed.
[0082] The main startup process is as shown in Figure 2 The characteristic is that the second CPU core is started by the main CPU in the uboot stage, and the screen lighting and rendering work is given to the second CPU to run, which does not affect the startup speed of the main CPU.
[0083] The flow of the animation rendering is as shown in Figure 4 It includes:
[0084] The step S4.2 further includes the following procedures, which are all run on the second CPU core, that is, CPU1:
[0085] S4.2.1, read the H264 code stream from the Flash, and the H264 code stream is compressed picture data;
[0086] S4.2.2, call the decoder to decode, that is, call the h264_decode_frame function interface to decode, and the interface uses the h264 hardware decoder in the bottom layer to realize it;
[0087] S4.3, display the decoded data;
[0088] In the step S6, it is judged whether the system startup is completed, if yes, the rendering is ended; if not, it returns to the step S4.1.
[0089] Among them, the Flash storage includes: H264 / JPEG code stream.
[0090] Its main characteristics are:
[0091] 1. The data is stored in the form of H264 or JPEG compression, which greatly saves the storage space, and at the same time can bring the experience of multi-frame animation. For embedded products, 16MB of storage space has a greater advantage.
[0092] 2. The support for H264 decoding is realized in the uboot stage.
[0093] Using the method, the time of power-on to screen lighting on the chip can be reduced, video data in H264 compression format can be played, storage cost caused by storage of uncompressed original frame data is reduced, animation effect can be seen in a very short time, specifically within 1s, after product startup, and product use experience is improved.
[0094] In summary, the method is characterized in that:
[0095] 1. The key point is to implement multi-core simultaneous startup in the uboot stage.
[0096] 2. Decoding core rendering of h264 / jpeg can be implemented in the uboot stage.
[0097] 3. Animation data is stored in Flash in H264 / JPEG compression format, which can reduce the cost of memory.
[0098] The application also relates to a storage medium, which stores a computer program, the computer program is read and executed by a processor, and the computer program executes the method for quickly playing startup animation of an embedded system according to any one of the above.
[0099] The application further relates to a system, which is an embedded system and comprises a processor, a memory and a communication bus, the processor is connected with the memory through the communication bus to communicate, and the processor executes the method for quickly playing startup animation of the embedded system according to any one of the above.
[0100] The above is only the preferred embodiment of the application and is not used to limit the application, and the application embodiments can be variously changed and varied for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. A method for fast playing a boot-up animation in an embedded system, characterized in that, The method comprises: S1, the chip is powered on, and a bootrom program is run; S2, the bootrom program reads uboot in a Nor Flash partition from a flash to a memory to run the uboot program; S3, the uboot program reads kernel in the Nor Flash partition from the flash to the memory; further, steps S4 and S5 are performed respectively; S4, a first CPU kernel started by a main CPU, that is, a CPU kernel powered on, starts a second CPU core; the main CPU core sets a reset entry address of the second CPU core, that is, a CPU1 core, to a suitable position through a chip internal CCU controller, and controls the reset of the second CPU core through the controller; after the reset of the second CPU core, the second CPU core starts the step of animation rendering; further comprising: S4.1, initializing an LCD driver; S4.2, loading start animation data to a RAM, wherein the data is from picture data in a Nor Flash partition; comprising: 1) reading animation data, that is, H264 code stream data, to be displayed from the flash to the memory; 2) CPU1 calling an H264 hardware decoder to decode the H264 code stream data in the memory; 3) the decoder outputting uncompressed data, which can be used for display on the LCD; S4.3, rendering the data to the screen for display; step S6 is performed; S5, the main CPU core continuing to run the kernel; further, steps S6 and S7 are performed respectively; S6, the main CPU core notifying the second CPU core to end the LCD rendering through an IPI interface, and subsequent LCD rendering work is taken over by the kernel; S7, mounting a root file system, and running a user program.
2. The method for fast playing boot-up animation of an embedded system according to claim 1, wherein, The NorFlash partition comprises: uboot, picture data, kernel, and rootfs.
3. The method for fast playing boot-up animation of an embedded system according to claim 1, wherein, In the step S4, in an early stage of power-on start of an embedded product, usually within 1 second after power-on, H264 code stream data is read from a fixed position in a flash to a memory by the main CPU in a u-boot boot program, and the second CPU is started by the main CPU, the second CPU runs an H264 decoder, obtains the H264 code stream from the memory, and calls an H246 decoding program, to realize real-time decoding of the h264 code stream by using a h264 hardware decoder of the chip, and the highest speed can reach 1080p@30fps, and the decoded data is sent to the LCD for display.
4. The method for fast playing boot-up animation of an embedded system according to claim 1, wherein, The main CPU starts the second CPU core in the uboot stage, and the work of screen lighting and rendering is given to the second CPU core for running, without affecting the start of the main CPU.
5. The method for fast playing boot-up animation of an embedded system according to claim 1, wherein, The flow of the animation rendering comprises: The step S4.2 further comprises: S4.2.1, reading the H264 code stream from the flash; S4.2.2, calling the decoder for decoding, that is, calling an h264_decode_frame function interface for decoding, and the interface uses a h264 hardware decoder in the bottom layer for implementation. S4.3, the decoded data is displayed; In step S6, it is judged whether the system starting is completed. If yes, the rendering is ended. If not, it returns to step S4.
1.
6. The method for fast play boot animation of embedded system according to claim 1, wherein, The Flash storage comprises H264 / JPEG code flow.
7. A storage medium, characterized by A computer program is stored on the computer readable medium, and the computer program is read and executed by the processor to perform the method for playing the booting animation of the embedded system quickly according to any one of claims 1-6.
8. A system, characterized by The system is an embedded system, comprising a processor, a memory and a communication bus, the processor is connected with the memory through the communication bus to communicate, so as to perform the method for playing the booting animation of the embedded system quickly according to any one of claims 1-6.