A method, apparatus, electronic device and storage medium of a bootloader

By logically segmenting and parallelizing the application firmware, multiple main controllers are used to improve the ECU startup speed, solving the problem of ECU power-on, restart, and hibernation wake-up speed, and achieving fast system startup.

CN119759433BActive Publication Date: 2026-03-24Z-ONE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, the transfer speed of application firmware is slow when the ECU is powered on, restarted, or wakes up from hibernation, which affects the system startup speed.

Method used

By logically segmenting the application firmware and utilizing multiple main controllers to move these logical segments in parallel and complete other functional logic, rapid loading of the application firmware is achieved.

Benefits of technology

Without affecting other vehicle functions, the speed of transferring application firmware has been improved, enabling the ECU to start the system faster and ensuring the vehicle's hibernation and rapid wake-up.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759433B_ABST
    Figure CN119759433B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a boot loader method, device, electronic equipment and storage medium, the method comprising: logically segmenting the application firmware according to the size of the application firmware and the number of master controllers participating in segment carrying, obtaining a plurality of logical segments; configuring and enabling the plurality of master controllers participating in segment carrying, and carrying the corresponding logical segments in parallel; configuring and enabling the plurality of master controllers not participating in the segment carrying, and completing other function logic in parallel; if the master controllers participating in the segment carrying and the master controllers not participating in the segment carrying both complete the corresponding tasks, the application firmware is loaded into a static random access memory. Embodiments of the present application improve the carrying speed of the application firmware, and realize faster startup of the system by the ECU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive electronics technology, and more particularly to a method, apparatus, electronic device, and storage medium for booting a program. Background Technology

[0002] The power-on, restart, and wake-up processes of an ECU (Electronic Control Unit) all involve the bootloader loading application firmware from non-volatile flash memory into faster static RAM (Static Random Access Memory). Since fetching instructions from static RAM is much faster than fetching directly from flash memory, the bootloader improves application runtime performance. However, the slow speed of transferring application firmware using a single main controller (e.g., a single CPU or a single DMA) impacts the speed of ECU power-on, restart, and wake-up.

[0003] Therefore, improving the speed of application firmware transfer and enabling the ECU to start the system faster has become an urgent technical problem to be solved.

[0004] Application content

[0005] In view of this, embodiments of this application provide a method, apparatus, electronic device, and storage medium for booting a program, so as to improve the transfer speed of application firmware and enable the ECU to start the system faster.

[0006] According to a first aspect of the embodiments of this application, a method for bootstrapping a program is provided. The method includes: logically segmenting the application firmware according to the size of the application firmware and the number of master controllers participating in segment transport to obtain multiple logical segments; configuring and enabling the multiple master controllers participating in segment transport to transport the corresponding logical segments in parallel; configuring and enabling the multiple master controllers not participating in segment transport to complete other functional logic in parallel; and if both the master controllers participating in segment transport and the master controllers not participating in segment transport complete their corresponding tasks, the application firmware is loaded into static random access memory.

[0007] In some embodiments of this application, the step of logically segmenting the application firmware to obtain multiple logical segments based on the size of the application firmware and the number of main controllers participating in segment transport includes: if the main controllers are of the same type, the size of the logical segment is: Logical Segment Size = max_fw_size / num_master; where Logical Segment Size is the size of the logical segment, max_fw_size is the size of the application firmware, and num_master is the number of main controllers; if the main controllers are of different types, the size of the logical segment is determined based on experimental data.

[0008] In some embodiments of this application, the configuration information of the master controller participating in segment transport includes: logical segment source address, logical segment destination address, master controller clock frequency, and transport enable.

[0009] In some embodiments of this application, the configuration information of the main controller that does not participate in the segment transport includes at least one of: peripheral initialization, hardware version number detection, serial port printing, and dog feeding.

[0010] In some embodiments of this application, if both the main controller participating in segment transport and the main controller not participating in segment transport complete their corresponding tasks, the application firmware is loaded into the static random access memory, including: setting a status flag bit for both the main controller participating in segment transport and the main controller not participating in segment transport, the status flag bit being used to indicate whether their corresponding tasks have been completed; if the status flag bits of both the main controller participating in segment transport and the main controller not participating in segment transport indicate that their corresponding tasks have been completed, then the application firmware is loaded into the static random access memory.

[0011] In some embodiments of this application, if the status flag bits of both the main controller participating in segment transport and the main controller not participating in segment transport are both indicating that their corresponding tasks have been completed, then loading the application firmware into the static random access memory further includes: performing verification processing on the application firmware in the static random access memory; if the verification processing passes, then starting the application firmware.

[0012] According to a second aspect of the embodiments of this application, a bootloader apparatus is provided, the apparatus comprising: a segmentation module, configured to logically segment the application firmware according to the size of the application firmware and the number of master controllers participating in segment transport, to obtain multiple logical segments; a first configuration module, configured to configure and enable the multiple master controllers participating in segment transport to transport the corresponding logical segments in parallel; a second configuration module, configured to configure and enable the multiple master controllers not participating in segment transport to complete other functional logic in parallel; and a management module, configured to load the application firmware into static random access memory if both the master controllers participating in segment transport and the master controllers not participating in segment transport complete their corresponding tasks.

[0013] According to a third aspect of the present application, an electronic device is provided, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, which causes the processor to perform an operation corresponding to the bootloader method described in the first aspect.

[0014] According to a fourth aspect of the embodiments of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the bootloader method as described in the first aspect.

[0015] According to a fifth aspect of the embodiments of this application, a computer program product is provided, including computer instructions that instruct a computing device to perform operations corresponding to the service-oriented architecture-based diagnostic method described in the first aspect of the embodiments.

[0016] Based on the above technical solution, the bootloader scheme of this application embodiment logically segments the application firmware according to the size of the application firmware and the number of main controllers participating in segment transfer, obtaining multiple logical segments. Multiple main controllers participating in segment transfer are configured and enabled to transfer the corresponding logical segments in parallel; multiple main controllers not participating in segment transfer are configured and enabled to complete other functional logic in parallel. When both the main controllers participating in and not participating in segment transfer have completed their corresponding tasks, the application firmware is loaded into the static random access memory. This application embodiment improves the transfer speed of the application firmware without affecting other vehicle functions, enabling the ECU to start the system faster and providing a guarantee for vehicle hibernation and rapid wake-up. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A schematic diagram illustrating the implementation of a bootloader for a single main controller;

[0019] Figure 2 A flowchart illustrating a method for a bootloader applicable to embodiments of this application;

[0020] Figure 3 A schematic diagram illustrating the implementation of a bootloader method applicable to embodiments of this application;

[0021] Figure 4 A flowchart of step S4 of a bootloader method applicable to embodiments of this application;

[0022] Figure 5 This is a structural diagram of a bootloader apparatus applicable to embodiments of this application. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0024] See Figure 1 ECU power-on, restart, and sleep wake-up all involve the Bootloader using a single main controller to load the application firmware from non-volatile Flash Memory to faster Static RAM for operation. This transfer speed is slow and affects the speed of ECU power-on, restart, and sleep wake-up.

[0025] To address the aforementioned technical problems, this application provides a method for bootloader implementation, see [link to relevant documentation]. Figure 2 The methods include:

[0026] Step S1: Based on the size of the application firmware and the number of main controllers involved in segment transfer, logically segment the application firmware to obtain multiple logical segments.

[0027] Step S2: Configure and enable multiple master controllers participating in segment transfer to transfer the corresponding logic segments in parallel.

[0028] Step S3: Configure and enable multiple master controllers that are not involved in segment transport to complete other functional logic in parallel.

[0029] Step S4: If both the main controllers involved in segment transfer and those not involved in segment transfer complete their corresponding tasks, the application firmware is loaded into static random access memory.

[0030] See Figure 3 In this embodiment, multiple master controllers (Master 1, Master 2) participating in segment transfer are configured and enabled to transfer the corresponding logic segments (Logic Segment 1, Logic Segment 2) in parallel. Multiple master controllers not participating in segment transfer (Master x1, Master x 2) are also configured and enabled to complete other functional logic in parallel. This improves the speed of application firmware transfer without affecting other vehicle functions, enabling the ECU to start the system faster and ensuring vehicle hibernation and rapid wake-up.

[0031] In some specific implementations of the embodiments of this application, step S1 includes:

[0032] If the main controllers are of the same type, the size of the logic segment is:

[0033] Logical Segment Size=max_fw_size / num_master, (Formula 1).

[0034] Wherein, Logical Segment Size is the size of the logical segment, max_fw_size is the size of the application firmware, and num_master is the number of master controllers.

[0035] During the memory layout design phase, the maximum storage space for the application firmware is planned, which is the application firmware size max_fw_size.

[0036] During the bootloader phase, most main controllers are idle, and a large number of main controllers can participate in the migration of logic segments, such as each core of a multi-core processor, DMA instances, etc. The type and number of main controllers participating in the migration can be determined based on the startup time requirements.

[0037] If the main controllers are of the same type, the number of main controllers is recorded as num_master. The size of the logical segment of the application firmware can be calculated using Formula 1.

[0038] If the main controller is of different types, the size of the application's logical segments can vary because the transfer rate of segments also differs among different types of main controllers. The size of the logical segments is determined based on experimental data.

[0039] In some other specific implementations of the embodiments of this application, the configuration information of the main controller involved in segment transport includes:

[0040] Logical segment source address, logical segment destination address, main controller clock frequency, and transfer enable.

[0041] In some specific implementations of the embodiments of this application, the configuration information of the main controller that does not participate in segment transport includes:

[0042] At least one of the following: peripheral initialization, hardware version number detection, serial port printing, and dog feeding.

[0043] In addition to the main controllers that participate in segment transport and those that do not, there is also an unused main controller, which does not require configuration or enabling.

[0044] Specifically, the configuration information of the main controller is shown in Table 1 below.

[0045] Table 1

[0046]

[0047] In some specific implementations of the embodiments of this application, see [link to relevant documentation]. Figure 4 Step S4 includes:

[0048] Step S41: Set the status flag (Completion Flag) for both the main controllers participating in segment transport and those not participating in segment transport. The status flag is used to indicate whether the corresponding task has been completed.

[0049] Specifically, this application embodiment provides synchronization management of the master controllers (Master 1, Master 2) participating in segment transfer and the master controllers (Master x1, Master x 2) not participating in segment transfer on each timeline (Time line 1, Time line 2, Time line 3, Time line 4), as shown in Table 2 below. The initial value of the status flag is Uncompleted; if the corresponding task is completed, the status flag is modified to Completed.

[0050] Table 2

[0051]

[0052] Step S42: If the status flags of both the master controllers participating in segment transfer and those not participating in segment transfer are both indicating that their corresponding tasks have been completed, then the application firmware is loaded into the static random access memory.

[0053] As shown in Table 2 above, Time Line 4 means that both the master controllers (Master 1, Master 2) that participated in segment transfer and the master controllers (Master x1, Master x 2) that did not participate in segment transfer have completed their corresponding tasks.

[0054] Furthermore, unused master controllers do not require synchronization management.

[0055] In some specific implementations of the embodiments of this application, step S42 further includes:

[0056] Verification processing is performed on the application firmware in static random access memory;

[0057] If the verification process passes, the application firmware will be launched.

[0058] Specifically, a CRC32 check is performed on the application firmware in the target Static RAM. Finally, after the check passes, the bootloader starts the application firmware from the target Static RAM, enabling the ECU to boot the system.

[0059] Device

[0060] See Figure 5 This application also provides a bootloader apparatus, the apparatus comprising:

[0061] The segmentation module 501 is used to logically segment the application firmware according to the size of the application firmware and the number of main controllers involved in segment transfer, so as to obtain multiple logical segments.

[0062] The first configuration module 502 is used to configure and enable the multiple master controllers participating in segment transport to transport the corresponding logic segments in parallel.

[0063] The second configuration module 503 is used to configure and enable multiple main controllers that are not involved in the segment transport to complete other functional logic in parallel.

[0064] Management module 504 is used to load the application firmware into static random access memory if both the main controller participating in the segment transfer and the main controller not participating in the segment transfer complete their corresponding tasks.

[0065] This application embodiment improves the speed of application firmware transfer without affecting other vehicle functions, enabling the ECU to start the system faster and providing a guarantee for vehicle hibernation and rapid wake-up.

[0066] Computer storage media

[0067] In this embodiment, a computer-readable storage medium is provided, storing instructions for causing a machine to execute a service-oriented architecture-based diagnostic method as described herein. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer (or CPU or MPU) of the system or apparatus to read and execute the program code stored in the storage medium.

[0068] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of this application.

[0069] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0070] Computer program products

[0071] In this embodiment, a computer program product is provided, including computer instructions that instruct a computing device to perform any corresponding operation in the above-described plurality of method embodiments.

[0072] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.

[0073] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.

[0074] It should be noted that in the description of this application, the terms "first" and "second" are used only for convenience in describing different components or names, and should not be construed as indicating or implying a sequential relationship, relative importance, or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features.

[0075] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0076] It should be noted that although specific embodiments of this application have been described in detail with reference to the accompanying drawings, this should not be construed as limiting the scope of protection of this application. Various modifications and variations that can be made by those skilled in the art without inventive effort within the scope described in the claims still fall within the scope of protection of this application.

[0077] The examples of the embodiments in this application are intended to concisely illustrate the technical features of the embodiments in this application, so that those skilled in the art can intuitively understand the technical features of the embodiments in this application, and are not intended to be improper limitations on the embodiments in this application.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for bootstrapping a loader, the method comprising: Based on the size of the application firmware and the number of main controllers involved in segment transfer, the application firmware is logically segmented to obtain multiple logical segments; Configure and enable the multiple master controllers involved in segment transport to transport the corresponding logical segments in parallel; Configure and enable multiple main controllers that are not involved in the segment transport to complete other functional logic in parallel; If both the main controller participating in the segment transfer and the main controller not participating in the segment transfer complete their respective tasks, the application firmware is loaded into the static random access memory.

2. The method according to claim 1, wherein, The application firmware is logically segmented based on its size and the number of main controllers involved in segment transfer, resulting in multiple logical segments, including: If the main controllers are of the same type, the size of the logic segment is: Logical Segment Size = max_fw_size / num_master; where Logical Segment Size is the size of the logical segment, max_fw_size is the size of the application firmware, and num_master is the number of master controllers; If the main controller is of a different type, the size of the logic segment is determined based on experimental data.

3. The method according to claim 1 or 2, wherein, The configuration information of the main controller participating in the segment transport includes: Logical segment source address, logical segment destination address, main controller clock frequency, and transfer enable.

4. The method according to claim 1 or 2, wherein, The configuration information of the main controller that is not involved in the segment transport includes: At least one of the following: peripheral initialization, hardware version number detection, serial port printing, and dog feeding.

5. The method according to claim 4, wherein, If both the main controller participating in the segment transfer and the main controller not participating in the segment transfer complete their corresponding tasks, the application firmware is loaded into the static random access memory, including: Both the main controllers that participate in the segment transport and the main controllers that do not participate in the segment transport are set with status flag bits, which are used to indicate whether their corresponding tasks have been completed. If the status flags of both the main controller participating in segment transport and the main controller not participating in segment transport are both indicating that their corresponding tasks have been completed, then the application firmware is loaded into static random access memory.

6. The method according to claim 5, wherein, If the status flags of both the main controller participating in segment transfer and the main controller not participating in segment transfer are both indicating that their corresponding tasks have been completed, then the application firmware is loaded into static random access memory, further comprising: The application firmware in the static random access memory is verified. If the verification process passes, the application firmware is then started.

7. An apparatus for bootscrambling a program, the apparatus comprising: The segmentation module is used to logically segment the application firmware according to the size of the application firmware and the number of main controllers involved in segment transfer, so as to obtain multiple logical segments. The first configuration module is used to configure and enable the multiple main controllers participating in segment transport to transport the corresponding logical segments in parallel. The second configuration module is used to configure and enable multiple main controllers that are not involved in the segment transport, so that they can complete other functional logic in parallel. The management module is used to load the application firmware into static random access memory if both the main controller participating in the segment transfer and the main controller not participating in the segment transfer have completed their respective tasks.

8. An electronic device, comprising: The processor, communication interface, memory, and communication bus communicate with each other through the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the method of the bootloader as described in any one of claims 1-6.

9. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements a bootloader method as described in any one of claims 1-6.

10. A computer program product comprising computer instructions that instruct a computing device to perform an operation corresponding to the method of a bootloader as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Driving loading method, device and equipment for PTC (Positive Temperature Coefficient) driver and medium

    CN116185512A

  • Fast and safe starting method, device and equipment based on heterogeneous multi-core system and medium

    CN118626155A

  • Firmware boot task distribution to enable low latency boot performance

    US20210089296A1