CN109933348B - Method and device for updating Bootloader in electronic control unit - Google Patents

Method and device for updating Bootloader in electronic control unit Download PDF

Info

Publication number
CN109933348B
CN109933348B CN201910052372.1A CN201910052372A CN109933348B CN 109933348 B CN109933348 B CN 109933348B CN 201910052372 A CN201910052372 A CN 201910052372A CN 109933348 B CN109933348 B CN 109933348B
Authority
CN
China
Prior art keywords
bootloader
program
upgrading program
control unit
determined
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910052372.1A
Other languages
Chinese (zh)
Other versions
CN109933348A (en
Inventor
谢绍伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo Preh Joyson Automotive Electronics Co ltd
Original Assignee
Ningbo Preh Joyson Automotive Electronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ningbo Preh Joyson Automotive Electronics Co ltd filed Critical Ningbo Preh Joyson Automotive Electronics Co ltd
Priority to CN201910052372.1A priority Critical patent/CN109933348B/en
Publication of CN109933348A publication Critical patent/CN109933348A/en
Application granted granted Critical
Publication of CN109933348B publication Critical patent/CN109933348B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application provides a method and a device for updating Bootloader in an electronic control unit, wherein the method comprises the following steps: starting a jump management program to obtain a validity mark of a Bootloader upgrading program; under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, jumping to execute the Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program; under the condition that the validity flag of the Bootloader upgrading program is determined to be in an invalid state, jumping to execution function software; the boot jump management program, the Bootloader upgrading program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit. By the scheme, the technical problems of complex updating operation and long updating time in the existing Bootloader updating process are solved, and the Bootloader updating is simply and efficiently realized so as to achieve the purpose of improving the Bootloader updating efficiency.

Description

Method and device for updating Bootloader in electronic control unit
Technical Field
The application belongs to the technical field of software updating, and particularly relates to an updating method and device of Bootloader in an electronic control unit.
Background
The functions of each vehicle-mounted electronic control unit are developed and realized step by step along with different stages and time nodes of the development of the whole vehicle. In this process, hardware and software of an Electronic Control Unit (ECU) are continuously upgraded and improved along with the maturity of the whole vehicle integration, and the function and quality requirements of the whole vehicle factory are met before the whole vehicle starts to be produced in mass. Before the software of the vehicle-mounted electronic control unit is frozen, the vehicle-mounted electronic control unit can be installed on the whole vehicle so as to facilitate the integration and the test of the functions of the whole vehicle. However, the automobile ECU does not allow a naked or external debugger interface, and in the process, functional software may find defects or bugs, so that it is very inconvenient to update the vehicle-mounted electronic control unit through a writer. At this time, bootloader software is required to be built in the electronic control unit, and the functional software of the electronic control unit is updated through the vehicle-mounted communication bus.
For the vehicle-mounted electronic control unit, a Bootloader (bootstrap program) is a program that can be operated independently, and the Bootloader and the functional software of the electronic control unit are stored in different code storage areas and share a data storage area, but operate in different tenses. And a developer or a maintenance person updates the functional software of the electronic control unit by using an upper computer tool or a special diagnostic instrument. The upper computer tool or the special diagnostic apparatus cooperates with the Bootloader of the electronic control unit through a protocol of a certain format to ensure that the functional software is correctly downloaded and updated into a code storage area of the electronic control unit, and the method specifically includes the following steps: correct transmission of the functional software files and writing the received files into the code memory. For the data transmission process, the automobile industry adopts an international standard UDS protocol at present, so that the main functions of the Bootloader comprise: flash drives, supports some standard UDS services needed to update software.
Although the functions of the Bootloader are not as complicated as those of electronic control unit functional software, the Bootloader needs to be developed according to the specific requirements of different vehicle manufacturers, and is continuously improved along with different time nodes, so that defects or bugs may occur in the Bootloader. That is, the Bootloader software may also have requirements or possibilities to be updated at different stages. The automotive ECU requires that no bare or external debugger interface be allowed, and any opening or removal of components therein to update software after the electronic control unit has been installed in the vehicle interior is time consuming, labor intensive, and detracts from the look and feel of the customer.
At present, the upgrade of the Bootloader itself is generally realized by using special software called Bootloader upgrade program. The Bootloader upgrade program generally includes a new Bootloader to be updated to the electronic control unit and a program to operate on the memory. Bootloader upgrades and software functions are linked to the same memory space. One Bootloader upgrade needs to execute two erasing operations on the storage space corresponding to the functional software, and the operation is complex and needs long time.
In order to solve the above problems, no effective solution has been proposed.
Disclosure of Invention
The application aims to provide an updating method and device of Bootloader in an electronic control unit, which can realize the technical effect of updating Bootloader simply and efficiently so as to achieve the purpose of improving the updating efficiency of Bootloader.
The application provides a method and a device for updating Bootloader in an electronic control unit, which are realized as follows:
a method for updating Bootloader in an electronic control unit, the method comprising:
starting a jump management program to obtain a validity mark of a Bootloader upgrading program;
under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, jumping to execute the Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program;
under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state, skipping to the execution function software;
the boot jump management program, the Bootloader upgrading program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit.
In one embodiment, in the case that it is determined that the validity flag of the Bootloader upgrade program is in an invalid state, jumping to the execution function software includes:
under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state, obtaining the validity mark of the functional software;
under the condition that the validity flag of the functional software is determined to be in a valid state, skipping to the execution of the functional software;
and under the condition that the validity flag of the functional software is determined to be in an invalid state, jumping to the current Bootloader and waiting for an updating instruction.
In one embodiment, jumping to execute a Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program includes:
running a Bootloader upgrading program;
erasing the current Bootloader through a Bootloader upgrading program, and copying a new Bootloader to a corresponding address space;
after the completion of the copying is determined, setting an invalid state of a validity flag bit of a Bootloader upgrading program;
and controlling the electronic control unit to restart and reset, and starting the starting jump management program.
In one embodiment, after copying the new Bootloader to the corresponding address space, the method further includes:
a Bootloader upgrading program reads an address space corresponding to the Bootloader and calculates a first checksum of the whole address space corresponding to the Bootloader;
acquiring a second checksum calculated by the new Bootloader in the compiling process;
determining that the first checksum and the second checksum pass in the case that the first checksum and the second checksum are determined to be the same;
in the case where it is determined that the check passes, it is determined that the copy is completed.
In one embodiment, jumping to execute a Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program includes:
and the running Bootloader upgrading program is printed into the electronic control unit through the vehicle-mounted CAN bus, so that the Bootloader is updated through the Bootloader upgrading program.
In an embodiment, in a case that it is determined that the validity flag of the functional software is in an invalid state, jumping to a current Bootloader, and waiting for an update instruction, the method further includes:
receiving an updating instruction;
setting the validity flag of the Bootloader upgrading program to be in a valid state under the condition that the update instruction is determined to be that the Bootloader is updated, controlling the electronic control unit to restart and reset, and starting the starting skip management program;
and under the condition that the updating instruction is determined to be that the functional software is updated, setting the validity flag of the Bootloader upgrading program and the validity flag of the functional software to be in an invalid state, controlling an electronic control unit to restart and reset, and starting the starting jump management program.
An updating device of Bootloader in an electronic control unit is positioned in a vehicle-mounted system and comprises:
the obtaining module is used for obtaining the validity mark of the Bootloader upgrading program by starting the jump management program;
the first skip module is used for skipping to execute the Bootloader upgrading program under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, and updating the Bootloader through the Bootloader upgrading program;
the second skip module is used for skipping to the execution function software under the condition that the validity flag of the Bootloader upgrading program is determined to be in an invalid state;
the boot jump management program, the Bootloader upgrading program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit.
In one embodiment, the second skip module comprises:
the obtaining unit is used for obtaining the validity mark of the functional software under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state;
the first jumping unit is used for jumping to the execution functional software under the condition that the validity flag of the functional software is determined to be in a valid state;
and the second jumping unit is used for jumping to the current Bootloader and waiting for an updating instruction under the condition that the validity flag of the functional software is determined to be in an invalid state.
In one embodiment, the first skip module comprises:
the operation unit is used for operating a Bootloader upgrading program;
the updating unit is used for erasing the current Bootloader through the Bootloader upgrading program and copying the new Bootloader to the corresponding address space;
the setting unit is used for setting the invalid state of the validity flag bit of the Bootloader upgrading program after the completion of the copying is determined;
and the control unit is used for controlling the electronic control unit to restart and reset and starting the starting jump management program.
In one embodiment, the first skip module further comprises:
the computing unit is used for controlling a Bootloader upgrading program to read the address space corresponding to the Bootloader after copying the new Bootloader to the corresponding address space, and computing a first checksum of the whole address space corresponding to the Bootloader;
the obtaining unit is used for obtaining a second checksum calculated by the new Bootloader in the compiling process;
a first determination unit, configured to determine that the checksum passes when it is determined that the first checksum and the second checksum are the same;
and a second determination unit that determines that the copying is completed in a case where it is determined that the verification passes.
In one embodiment, the first skip module is specifically configured to brush an operating Bootloader upgrade program into the electronic control unit through a vehicle-mounted CAN bus, so as to update the Bootloader through the Bootloader upgrade program.
In one embodiment, the above apparatus further comprises:
the receiving module is used for jumping to the current Bootloader and receiving an updating instruction after waiting for the updating instruction under the condition that the validity flag of the functional software is determined to be in an invalid state;
the first starting module is used for setting the validity flag of the Bootloader upgrading program to be in a valid state under the condition that the updating instruction is determined that the Bootloader is updated, controlling the electronic control unit to restart and reset, and starting the boot jump management program;
and the second starting module is used for setting the validity flag of the Bootloader upgrading program and the validity flag of the functional software to be in an invalid state under the condition that the updating instruction is determined to indicate that the functional software is updated, controlling the electronic control unit to restart and reset, and starting the boot jump management program.
A terminal device comprising a processor and a memory for storing processor-executable instructions, the instructions when executed by the processor implementing the steps of the method of:
starting a jump management program to obtain an effective mark of a Bootloader upgrading program;
under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, jumping to execute the Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program;
under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state, skipping to the execution function software;
the boot jump management program, the Bootloader upgrading program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit.
A computer readable storage medium having stored thereon computer instructions which, when executed, implement steps implementing a method of:
starting a jump management program to obtain a validity mark of a Bootloader upgrading program;
under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, jumping to execute the Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program;
under the condition that the validity flag of the Bootloader upgrading program is determined to be in an invalid state, jumping to execution function software;
the boot jump management program, the Bootloader upgrading program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit.
The method and the device for updating the Bootloader in the electronic control unit are characterized in that a boot jump management program and a Bootloader upgrading program are set, the boot jump management program, the Bootloader upgrading program and functional software are respectively stored in different address spaces of a storage space of the electronic control unit, when the boot jump management program is started, an effectiveness mark of the Bootloader upgrading program is obtained through the boot jump management program, under the condition that the effectiveness mark of the Bootloader upgrading program is determined to be in an effective state, the Bootloader upgrading program is jumped to be executed, and the Bootloader is updated through the Bootloader upgrading program; and under the condition that the validity flag of the Bootloader upgrading program is determined to be in an invalid state, jumping to the execution functional software. Because different storage spaces are allocated for the boot jump management program, the Bootloader upgrading program and the functional software, when the Bootloader is updated, two erasing operations are not needed, and the cost and the efficiency are higher, so that the technical problems of complicated updating operation and long updating time in the existing Bootloader updating process are solved, and the aim of simply and efficiently updating the Bootloader is fulfilled to improve the updating efficiency of the Bootloader.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the description below are only some embodiments described in the present application, and for those skilled in the art, other drawings may be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a method according to an embodiment of a method for updating Bootloader in an electronic control unit.
Fig. 2 is another flowchart of an embodiment of a method for updating Bootloader in an electronic control unit according to the present application.
Fig. 3 is a block diagram of a terminal device according to the present application.
Fig. 4 is a block diagram of a structure of an embodiment of an updating apparatus for Bootloader in an electronic control unit according to the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Considering that the existing Bootloader upgrading program and the function software are linked to the same memory address, after the Bootloader upgrading program is written into the memory by the old Bootloader, the ECU executes the restart jump to the Bootloader upgrading program to operate, the Bootloader upgrading program erases the Flash memory, erases the old Bootloader and writes the new Bootloader into the erased memory space, and the verification is executed to ensure that the Bootloader upgrading program erases the effective flag bit after the successful writing.
Based on this, in this example, a method for updating a Bootloader in an electronic control unit is provided, and fig. 1 is a flowchart of a method of an embodiment of the method for updating a Bootloader in an electronic control unit according to the present application. Although the present application provides method operational steps or apparatus configurations as illustrated in the following examples or figures, more or fewer operational steps or modular units may be included in the methods or apparatus based on conventional or non-inventive efforts. In the step or structure in which the necessary cause and effect relationship does not logically exist, the execution sequence of the steps or the module structure of the apparatus is not limited to the execution sequence or the module structure described in the embodiment of the present application and shown in the drawings. When the described method or module structure is applied in an actual device or end product, the method or module structure according to the embodiments or shown in the drawings can be executed sequentially or executed in parallel (for example, in a parallel processor or multi-thread processing environment, or even in a distributed processing environment).
Specifically, as shown in fig. 1, an updating method of a Bootloader in an electronic control unit according to an embodiment of the present application may include:
step 101: the method comprises the steps that a jump starting management program obtains an effectiveness mark of a Bootloader upgrading program, wherein the jump starting management program, the Bootloader upgrading program and functional software are respectively stored in different address spaces of a storage space of an electronic control unit;
step 102: under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, jumping to execute the Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program;
step 103: and jumping to the execution function software under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state.
Considering that in actual implementation, when the functional software needs to be updated, bootloader needs to be started to update the functional software. That is, when starting, it is necessary to control whether the Bootloader upgrade program and the functional software are started, and also to control whether the Bootloader is started. For this reason, when it is determined that the validity flag of the Bootloader upgrade program is in an invalid state, jumping to the execution function software may include:
1) Under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state, obtaining the validity mark of the functional software;
2) Under the condition that the validity flag of the functional software is determined to be in a valid state, skipping to the execution of the functional software;
3) And under the condition that the validity flag of the functional software is determined to be in an invalid state, jumping to the current Bootloader and waiting for an updating instruction.
That is, the state of the validity flag of the Bootloader upgrade program and the state of the validity flag of the functional software may be sequentially determined, so as to determine whether to start the Bootloader upgrade program, the functional software, or the Bootloader, thereby implementing the requirements for different situations. And because the boot jump management program, the Bootloader upgrade program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit, repeated erasing and writing operations are not required, and mutual occupation is avoided, so that the updating efficiency of the Bootloader can be effectively improved.
Further, under the condition that the validity flag of the functional software is determined to be in an invalid state, skipping to the current Bootloader, and waiting for an update instruction, and then receiving the update instruction; setting the validity flag of the Bootloader upgrading program to be in a valid state under the condition that the update instruction is determined to be that the Bootloader is updated, controlling the electronic control unit to restart and reset, and starting the starting skip management program; and under the condition that the updating instruction is determined to be that the functional software is updated, setting the validity flag of the Bootloader upgrading program and the validity flag of the functional software to be in an invalid state, controlling the electronic control unit to restart and reset, and starting the starting skip management program.
Specifically, when jumping to execute the Bootloader upgrade program and updating the Bootloader through the Bootloader upgrade program, the method may include:
s1: running a Bootloader upgrading program;
s2: erasing the current Bootloader through a Bootloader upgrading program, and copying a new Bootloader to a corresponding address space;
that is, the content in the storage space corresponding to the Bootloader is erased and the new Bootloader is written.
S3: after the completion of the copying is determined, setting an invalid state of a validity flag bit of a Bootloader upgrading program;
that is, after the update is determined to be completed, it may be determined that the function of the Bootloader upgrade program is completed, and therefore, the invalid status of the validity flag of the Bootloader upgrade program may be set.
S4: and controlling the electronic control unit to restart and reset, and starting the starting jump management program.
Only after the update is finished, the electronic control unit can be controlled to restart and reset, and the boot jump management program is started, because the validity flag bit of the boot loader upgrading program is in an invalid state at the moment, the boot loader upgrading program cannot be started any more after the boot jump management program is started, and functional software or the updated boot loader is executed.
To implement data checking, i.e., to determine whether Bootloader completes the correct update, a checking process may be added. Specifically, after copying a new Bootloader to a corresponding address space, the Bootloader upgrade program reads the address space corresponding to the Bootloader, and calculates a first checksum of the entire address space corresponding to the Bootloader; acquiring a second checksum calculated by the new Bootloader in the compiling process; determining that the first checksum and the second checksum pass in the case that the first checksum and the second checksum are determined to be the same; in the case where it is determined that the check passes, it is determined that the copy is completed. The checksum algorithm used by the Bootloader upgrading program is consistent with the checksum algorithm used in the compiling process, and the checksum stored in the Bootloader upgrading program is compared with the checksum obtained by reading the Bootloader storage area:
when the Bootloader is updated through the Bootloader upgrading program, the Bootloader upgrading program CAN be skipped to be executed to print the running Bootloader upgrading program into the electronic control unit through the vehicle-mounted CAN bus, so that the Bootloader is updated through the Bootloader upgrading program.
The method for updating the Bootloader software in the vehicle-mounted electronic control unit through the communication bus is described below with reference to an embodiment, however, it should be noted that the embodiment is only for better describing the present application and is not to be construed as a limitation to the present application.
Aiming at the problem that the Bootloader in the existing vehicle-mounted electronic control unit is low in efficiency when being updated, in the embodiment, two erasing operations can be avoided by reasonably utilizing the storage space of the vehicle-mounted electronic control unit and designing the starting skip program of the electronic control unit, the Bootloader updating process is simplified, the Bootloader updating time is shortened, and the method specifically comprises the following steps:
step a: in the initial stage of development of the electronic control unit, a Flash memory of a single chip microcomputer platform is reasonably selected, planned and utilized, and a Bootloader, functional software, a Bootloader upgrading program and a boot skip management program are respectively stored in different address spaces;
step b: respectively setting validity marks for the functional software and the Bootloader upgrading program and linking the validity marks to fixed storage addresses; the functional software comprises software which has an actual control function and supports the running of the vehicle, and the electronic control unit runs the function through the software under the condition that the vehicle runs normally; the Bootloader upgrading program is special software which can be independently operated, and the Bootloader upgrading program cannot be operated under the condition that the vehicle normally operates;
step c: designing a boot jump management program, performing necessary initialization on hardware by the boot jump management program, at the moment, deciding to jump to corresponding software to run by the boot jump management program according to the functional software and the validity mark of the Bootloader upgrading program, and if the Bootloader upgrading program is valid, preferentially jumping to the Bootloader upgrading program; otherwise, jumping to functional software to run;
step d: the method comprises the steps that a running Bootloader upgrading program is printed into an electronic control unit through a vehicle-mounted CAN bus, so that an old version Bootloader is erased from a memory, and a new version Bootloader contained in the Bootloader upgrading program is written into a storage space corresponding to the Bootloader;
step e: after the Bootloader is successfully written into the Bootloader storage area, the task of the Bootloader upgrading program is completed, and the Bootloader upgrading program sets the Bootloader upgrading program valid flag to be invalid; the electronic control unit executes restart, starts a jump management program to jump to the running of functional software according to the invalidity of the Bootloader upgrading program valid flag;
furthermore, when the Bootloader upgrading program is refreshed to the electronic control unit memory, the version of the Bootloader can be read through the DID and compared with the version information contained in the Bootloader upgrading program, if the two versions are the same, the two versions are judged to be the same, the updating process does not need to be continued, and unnecessary time waste can be avoided.
The invention will be further described with reference to specific embodiments: a method for updating Bootloader software in a vehicle-mounted electronic control unit through a communication bus comprises the following steps:
step 1: respectively storing the Bootloader, the functional software, the Bootloader upgrading program and the boot jump management program in different address spaces;
step 2: respectively setting validity marks for the functional software and the Bootloader upgrading program and linking the validity marks to fixed storage addresses; the jump management program is started to jump to the functional software or the Bootloader upgrading program to execute according to the effective marks of the functional software and the Bootloader upgrading program;
and step 3: and designing a starting and skipping management program, wherein the starting and skipping management program is a first section of code executed by the single chip microcomputer after the electronic control unit is reset, and specifically skipping to the Bootloader, the functional software or the Bootloader upgrading program for running is determined according to the effective state of the software in the memory. After the jump management program is started, as shown in fig. 2, the validity flag of the Bootloader upgrade program is detected preferentially to judge whether the valid Bootloader upgrade program exists or not; and if so, jumping to the Bootloader upgrading program, and if the Bootloader upgrading program validity mark is invalid, jumping to the functional software or jumping to the existing Bootloader.
And 4, step 4: designing a Bootloader upgrading program as special software which can run independently, wherein the Bootloader upgrading program comprises the following steps: erasing and writing a code memory (generally a Flash memory), calculating a checksum for a Bootloader storage area according to a specific algorithm, setting a valid flag of a Bootloader upgrading program to be invalid and the like; in the process of linking and generating the binary file, a new Bootloader to be updated into the electronic control unit is contained in a Bootloader upgrading program file;
and 5: establishing a physical connection between a PC (personal computer) or a diagnostic instrument and a vehicle-mounted electronic control unit, wherein a vehicle-mounted communication bus is generally a CAN (controller area network) bus to ensure normal communication with the vehicle-mounted communication bus; the method comprises the steps that Bootloader upgrading programs are transmitted to a memory of an electronic control unit through interaction of PC software or a diagnostic instrument and Bootloader of the electronic control unit; the Bootloader upgrading program is successfully written into the memory, and the original Bootloader can set the Bootloader upgrading program mark as valid;
and 6: the electronic control unit is restarted and effectively jumps to a Bootloader upgrading program to execute according to a Bootloader upgrading program mark, the Bootloader upgrading program firstly executes the erasing of a Bootloader storage area, after the erasing of the Bootloader storage area is completed, the Bootloader upgrading program copies a new Bootloader contained in the Bootloader upgrading program to the Bootloader storage area, and after the copying of the new Bootloader is completed, the Bootloader upgrading program needs to check the copying process so as to ensure the successful upgrading of the Bootloader;
and 7: after the fact that the new Bootloader is successfully written into the memory is ensured, the Bootloader upgrading program sets the valid flag bit of the Bootloader upgrading program to be invalid and triggers the electric control unit to restart, the jump management program is started to detect whether the flag of the Bootloader upgrading program is invalid or not, namely, the boot jump management program jumps to the functional software or the new Bootloader to execute, and the whole Bootloader upgrading is completed;
in the step 5, the write-in process of the new version Bootloader is checked, and the specific checking method is that the new version Bootloader calculates the check sum during compiling, and the check sum calculated in the compiling process can be stored in a certain address of the Bootloader upgrading program; after the new Bootloader is copied, the Bootloader upgrading program reads a Bootloader storage area and calculates a checksum on the whole address interval; the checksum algorithm used by the Bootloader upgrading program must be completely consistent with the checksum algorithm used in the compiling process; comparing the check sum stored in the Bootloader upgrading program with the check sum obtained by reading the Bootloader storage area:
1) And if the two checksums are identical, the new Bootloader is considered to be successfully written into the Bootloader storage area. After the fact that the new Bootloader is successfully written into the Bootloader storage area is determined, the task of the Bootloader upgrading program is completed, and the Bootloader upgrading program erases the valid mark of the Bootloader upgrading program; if the Bootloader upgrading program judges that the Bootloader upgrading program effective mark is successfully erased, the electronic control unit is restarted and reset; after resetting, the valid flag of the Bootloader upgrading program is erased, and a jump management program is started to jump to the functional software or a new Bootloader for running;
2) If the two checksums are completely different, the new Bootloader is considered to be unsuccessfully written into the Bootloader storage area, and when the new Bootloader is unsuccessfully written into the Bootloader storage area, the Bootloader upgrading program restarts the electronic control unit; after the reset is restarted, the valid flag state of the Bootloader upgrading program is still valid, the boot jump management program jumps to the Bootloader upgrading program to run, and the process is repeatedly executed until the new Bootloader is successfully written into the Bootloader storage area.
By the above method, the Bootloader of the electronic control unit cannot be damaged and cannot be used for updating the program again through the vehicle-mounted bus any time when the power supply of the electronic control unit is accidentally powered off. Specifically, if the electronic control unit is powered off in the process of transmitting the Bootloader upgrading program, the old Bootloader is still valid; if the electronic control unit is powered off in the process of erasing the old Bootloader by the Bootloader upgrading program, the flag bit of the Bootloader upgrading program cannot be set to be invalid, and the electronic control unit can still jump to the Bootloader upgrading program to execute after being restarted; if the electronic control unit is powered off in the process of copying the new Bootloader into the memory, the flag bit of the Bootloader upgrading program cannot be set to be invalid, and the electronic control unit can still jump to the Bootloader upgrading program to execute after being restarted. Because the valid flag bit of the Bootloader upgrading program is set to be invalid only after the new Bootloader is judged to be successfully written into the memory through the comparison between the Bootloader storage space and the checksum in the Bootloader upgrading program.
By the above method, the Bootloader of the electronic control unit cannot be damaged and cannot update the program again through the vehicle-mounted bus any time when the CAN communication bus of the electronic control unit is disconnected. Specifically, if the electronic control unit loses a CAN line in the process of transmitting the Bootloader upgrading program, the old Bootloader is still valid; if the electronic control unit loses the CAN line in the process of erasing the old Bootloader by the Bootloader upgrading program, the operation of the Bootloader upgrading program cannot be influenced; if the electronic control unit loses the CAN line in the process of copying the new Bootloader into the memory, the operation of the Bootloader upgrading program cannot be influenced. Only by comparing the checksum in the Bootloader storage space and the Bootloader upgrade program, it is determined that the method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking an operation on a terminal device as an example, fig. 3 is a block diagram of a hardware structure of the terminal device in the method for updating a Bootloader in an electronic control unit according to the embodiment of the present invention. As shown in fig. 3, terminal device 10 may include one or more (only one shown) processors 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. It will be understood by those skilled in the art that the structure shown in fig. 3 is only an illustration and is not intended to limit the structure of the electronic device. For example, terminal device 10 may also include more or fewer components than shown in FIG. 3, or have a different configuration than shown in FIG. 3.
The memory 104 may be configured to store a software program and a module of application software, such as a program instruction/module corresponding to an updating method of a Bootloader in an electronic control unit in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the software program and the module stored in the memory 104, that is, implements the updating method of the Bootloader in the electronic control unit. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission module 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission module 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In the software aspect, as shown in fig. 4, the apparatus for updating Bootloader in the electronic control unit may include:
an obtaining module 401, configured to obtain, by starting a skip manager, a validity flag of a Bootloader upgrade program;
a first skip module 402, configured to skip to execute the Bootloader upgrading program and update the Bootloader through the Bootloader upgrading program when it is determined that the validity flag of the Bootloader upgrading program is in a valid state;
a second skip module 403, configured to skip to execute the functional software when it is determined that the validity flag of the Bootloader upgrade program is in an invalid state and the validity flag of the functional software is in a valid state;
and a third jump module 404, configured to jump to the current Bootloader and wait for an update instruction when it is determined that the validity flag of the Bootloader upgrade program is in an invalid state and the validity flag of the functional software is in an invalid state.
The boot jump management program, the Bootloader upgrading program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit.
In one embodiment, the first skip module 402 may include: the operation unit is used for operating a Bootloader upgrading program; the updating unit is used for erasing the current Bootloader through the Bootloader upgrading program and copying the new Bootloader to the corresponding address space; the setting unit is used for setting the invalid state of the validity flag bit of the Bootloader upgrading program after the completion of the copying is determined; and the control unit is used for controlling the electronic control unit to restart and reset and starting the starting jump management program.
In an embodiment, the first skip module 402 may further include: the computing unit is used for controlling a Bootloader upgrading program to read the address space corresponding to the Bootloader after copying the new Bootloader to the corresponding address space, and computing a first checksum of the whole address space corresponding to the Bootloader; the obtaining unit is used for obtaining a second checksum calculated by the new Bootloader in the compiling process; a first determination unit, configured to determine that the checksum passes when it is determined that the first checksum and the second checksum are the same; and a second determination unit that determines that the copying is completed in a case where it is determined that the verification passes.
In an embodiment, the first skip module 402 may be specifically configured to brush a running Bootloader upgrade program into the electronic control unit through an in-vehicle CAN bus, so as to update the Bootloader through the Bootloader upgrade program.
In one embodiment, the apparatus may further include: the receiving module is used for jumping to the current Bootloader and receiving the updating instruction after waiting for the updating instruction under the condition that the validity mark of the functional software is determined to be in an invalid state; the first starting module is used for setting the validity flag of the Bootloader upgrading program to be in a valid state under the condition that the updating instruction is determined to be that the Bootloader is updated, controlling the electronic control unit to restart and reset, and starting the boot skip management program; and the second starting module is used for setting the validity flag of the Bootloader upgrading program and the validity flag of the functional software to be in an invalid state under the condition that the updating instruction is determined to indicate that the functional software is updated, controlling the electronic control unit to restart and reset, and starting the boot jump management program.
An embodiment of the present application further provides a specific implementation manner of an electronic device, which is capable of implementing all steps in the method for updating a Bootloader in an electronic control unit in the foregoing embodiment, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus;
the processor, the memory and the communication interface complete mutual communication through the bus; the processor is configured to call a computer program in the memory, and when executing the computer program, the processor implements all steps in the method for updating a Bootloader in an electronic control unit in the foregoing embodiment, for example, when executing the computer program, the processor implements the following steps:
a method for updating bootloaders in an electronic control unit, the method comprising:
step 1: starting a jump management program to obtain an effective mark of a Bootloader upgrading program;
and 2, step: under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, jumping to execute the Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program;
and step 3: under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state, skipping to the execution function software;
the boot jump management program, the Bootloader upgrading program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit.
As can be seen from the above description, a boot jump management program and a Bootloader upgrade program are set, the boot jump management program, the Bootloader upgrade program, and functional software are respectively stored in different address spaces of a storage space of an electronic control unit, when the boot jump management program is started, an validity flag of the Bootloader upgrade program is obtained through the boot jump management program, when it is determined that the validity flag of the Bootloader upgrade program is in a valid state, a jump is made to the Bootloader upgrade program, and the Bootloader is updated through the Bootloader upgrade program; and jumping to the execution function software under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state. Because different storage spaces are allocated for the boot jump management program, the Bootloader upgrading program and the functional software, when the Bootloader is updated, two erasing operations are not needed, and the cost and the efficiency are higher, so that the technical problems of complicated updating operation and long updating time in the existing Bootloader updating process are solved, and the aim of simply and efficiently updating the Bootloader is fulfilled to improve the updating efficiency of the Bootloader.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all steps in the method for updating Bootloader in an electronic control unit in the foregoing embodiments, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all steps of the method for updating Bootloader in an electronic control unit in the foregoing embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
step 1: starting a jump management program to obtain a validity mark of a Bootloader upgrading program;
and 2, step: under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, jumping to execute the Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program;
and 3, step 3: under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state, skipping to the execution function software;
the boot jump management program, the Bootloader upgrading program and the functional software are respectively stored in different address spaces of the storage space of the electronic control unit.
As can be seen from the above description, a boot jump management program and a Bootloader upgrade program are set, the boot jump management program, the Bootloader upgrade program, and the functional software are respectively stored in different address spaces of a storage space of an electronic control unit, when the boot jump management program is started, a validity flag of the Bootloader upgrade program is obtained through the boot jump management program, when the validity flag of the Bootloader upgrade program is determined to be in a valid state, the boot jump is performed to the Bootloader upgrade program, and the Bootloader is updated through the Bootloader upgrade program; and jumping to the execution function software under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state. Because different storage spaces are allocated for the boot jump management program, the Bootloader upgrading program and the functional software, when the Bootloader is updated, two erasing operations are not needed, and the cost and the efficiency are higher, so that the technical problems of complicated updating operation and long updating time in the existing Bootloader updating process are solved, and the aim of simply and efficiently updating the Bootloader is fulfilled to improve the updating efficiency of the Bootloader.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the hardware + program class embodiment, since it is substantially similar to the method embodiment, the description is simple, and reference may be made to part of the description of the method embodiment for relevant points.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Although the present application provides method steps as described in an embodiment or flowchart, additional or fewer steps may be included based on conventional or non-inventive efforts. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
The systems, apparatuses, modules or units described in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Although embodiments of the present description provide method steps as described in embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or end product executes, it may execute sequentially or in parallel (e.g., parallel processors or multi-threaded environments, or even distributed data processing environments) according to the method shown in the embodiment or the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in processes, methods, articles, or apparatus that include the recited elements is not excluded.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, when implementing the embodiments of the present specification, the functions of each module may be implemented in one or more pieces of software and/or hardware, or a module that implements the same function may be implemented by a combination of multiple sub-modules or sub-units, or the like. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Those skilled in the art will also appreciate that, in addition to implementing the controller in purely computer readable program code means, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Those skilled in the art will appreciate that the embodiments of the present description may be provided as a method, system, or computer program product and thus, the embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The embodiments of this specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification embodiments may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points. In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the embodiments of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Moreover, various embodiments or examples and features of various embodiments or examples described in this specification can be combined and combined by one skilled in the art without being mutually inconsistent.
The above description is only an example of the embodiments of the present disclosure, and is not intended to limit the embodiments of the present disclosure. Various modifications and variations to the embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present specification should be included in the scope of the claims of the embodiments of the present specification.

Claims (14)

1. A method for updating Bootloader in an electronic control unit is characterized by comprising the following steps:
the method comprises the steps that Bootloader upgrading programs are printed to an address space of a storage space of an electronic control unit in advance, and the address space where the Bootloader upgrading programs are located is different from the address space where functional software of the electronic control unit is located;
starting a jump management program to obtain an effective mark of a Bootloader upgrading program;
under the condition that the validity flag of the Bootloader upgrading program is determined to be in a valid state, jumping to execute the Bootloader upgrading program, and updating the Bootloader through the Bootloader upgrading program; the validity mark of the valid state of the Bootloader upgrading program is set after receiving an updating instruction which indicates that the Bootloader has updating;
under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state, obtaining the validity mark of the functional software; under the condition that the validity flag of the functional software is determined to be in a valid state, skipping to the execution of the functional software; under the condition that the validity flag of the functional software is determined to be in an invalid state, jumping to the current Bootloader; after receiving an update instruction indicating that the functional software is updated, setting a validity flag of a Bootloader upgrade program and a validity flag of the functional software to be in an invalid state;
and respectively storing the boot jump management program, the Bootloader upgrading program and the functional software in different address spaces of the storage space of the electronic control unit.
2. The method of claim 1, further comprising:
after jumping to the current Bootloader, an update instruction is awaited.
3. The method according to claim 1, wherein jumping to execute a Bootloader upgrade program, and updating the Bootloader through the Bootloader upgrade program comprises:
running a Bootloader upgrading program;
erasing the current Bootloader through a Bootloader upgrading program, and copying a new Bootloader to a corresponding address space;
after the completion of copying is determined, setting an invalid state of an effectiveness flag bit of a Bootloader upgrading program;
and controlling the electronic control unit to restart and reset, and starting the starting jump management program.
4. The method of claim 3, after copying the new Bootloader to the corresponding address space, further comprising:
a Bootloader upgrading program reads an address space corresponding to the Bootloader and calculates a first checksum of the whole address space corresponding to the Bootloader;
acquiring a second checksum calculated by the new Bootloader in the compiling process;
determining that the first checksum and the second checksum pass in the case that the first checksum and the second checksum are determined to be the same;
in the case where it is determined that the check passes, it is determined that the copy is completed.
5. The method according to claim 1, wherein jumping to execute a Bootloader upgrade program, and updating the Bootloader through the Bootloader upgrade program comprises:
and the running Bootloader upgrading program is printed into the electronic control unit through a vehicle-mounted CAN bus so as to update the Bootloader through the Bootloader upgrading program.
6. The method according to claim 2, wherein in a case that it is determined that the validity flag of the functional software is in an invalid state, after jumping to a current Bootloader and waiting for an update instruction, the method further comprises:
receiving an updating instruction;
under the condition that the update instruction is determined that the Bootloader has update, setting an effectiveness mark of the Bootloader upgrading program to be in an effective state, controlling an electronic control unit to restart and reset, and starting the boot jump management program;
and under the condition that the updating instruction is determined to be that the functional software is updated, setting the validity flag of the Bootloader upgrading program and the validity flag of the functional software to be in an invalid state, controlling the electronic control unit to restart and reset, and starting the starting skip management program.
7. An updating device of Bootloader in an electronic control unit is characterized by being positioned in a vehicle-mounted system and comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for printing a Bootloader upgrading program to an address space of a storage space of an electronic control unit in advance, and the address space of the Bootloader upgrading program is different from the address space of functional software of the electronic control unit; obtaining an effectiveness mark of a Bootloader upgrading program by starting a jump management program;
the first skip module is used for skipping to execute the Bootloader upgrading program under the condition that the validity mark of the Bootloader upgrading program is determined to be in a valid state, and updating the Bootloader through the Bootloader upgrading program; the validity mark of the valid state of the Bootloader upgrading program is set after an updating instruction indicating that the Bootloader has updating is received;
the second skip module is used for acquiring the validity mark of the functional software under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state; under the condition that the validity flag of the functional software is determined to be in a valid state, skipping to the execution of the functional software; under the condition that the validity mark of the functional software is determined to be in an invalid state, skipping to the current Bootloader; after receiving an update instruction indicating that the functional software is updated, setting a validity flag of a Bootloader upgrade program and a validity flag of the functional software to be in an invalid state;
and respectively storing the boot jump management program, the Bootloader upgrading program and the functional software in different address spaces of the storage space of the electronic control unit.
8. The apparatus of claim 7, wherein the second hopping module comprises:
the obtaining unit is used for obtaining the validity mark of the functional software under the condition that the validity mark of the Bootloader upgrading program is determined to be in an invalid state;
the first jumping unit is used for jumping to the execution functional software under the condition that the validity flag of the functional software is determined to be in a valid state;
and the second jumping unit is used for jumping to the current Bootloader and waiting for an updating instruction under the condition that the validity flag of the functional software is determined to be in an invalid state.
9. The apparatus of claim 7, wherein the first hopping module comprises:
the operation unit is used for operating the Bootloader upgrading program;
the updating unit is used for erasing the current Bootloader through the Bootloader upgrading program and copying a new Bootloader to a corresponding address space;
the setting unit is used for setting the invalid state of the validity flag bit of the Bootloader upgrading program after the completion of the copying is determined;
and the control unit is used for controlling the electronic control unit to restart and reset and starting the starting jump management program.
10. The apparatus of claim 9, wherein the first hopping module further comprises:
the computing unit is used for controlling the upgrading program of the Bootloader to read the address space corresponding to the Bootloader and computing a first checksum of the whole address space corresponding to the Bootloader after copying the new Bootloader to the corresponding address space;
the obtaining unit is used for obtaining a second checksum calculated by the new Bootloader in the compiling process;
a first determining unit, configured to determine that the checksum passes when it is determined that the first checksum and the second checksum are the same;
and a second determination unit that determines that the copying is completed in a case where it is determined that the verification passes.
11. The device according to claim 7, wherein the first jump module is specifically configured to brush the running Bootloader upgrade program into the electronic control unit through an in-vehicle CAN bus, so as to update the Bootloader through the Bootloader upgrade program.
12. The apparatus of claim 8, further comprising:
the receiving module is used for jumping to the current Bootloader and receiving the updating instruction after waiting for the updating instruction under the condition that the validity mark of the functional software is determined to be in an invalid state;
the first starting module is used for setting the validity flag of the Bootloader upgrading program to be in a valid state under the condition that the updating instruction is determined to be that the Bootloader is updated, controlling the electronic control unit to restart and reset, and starting the boot skip management program;
and the second starting module is used for setting the validity flag of the Bootloader upgrading program and the validity flag of the functional software to be in an invalid state under the condition that the updating instruction is determined to be that the functional software is updated, controlling the electronic control unit to restart and reset, and starting the jump starting management program.
13. A terminal device comprising a processor and a memory for storing processor-executable instructions which, when executed by the processor, implement the steps of the method of any one of claims 1 to 6.
14. A computer readable storage medium having stored thereon computer instructions which, when executed, implement the steps of the method of any one of claims 1 to 6.
CN201910052372.1A 2019-01-21 2019-01-21 Method and device for updating Bootloader in electronic control unit Active CN109933348B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910052372.1A CN109933348B (en) 2019-01-21 2019-01-21 Method and device for updating Bootloader in electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910052372.1A CN109933348B (en) 2019-01-21 2019-01-21 Method and device for updating Bootloader in electronic control unit

Publications (2)

Publication Number Publication Date
CN109933348A CN109933348A (en) 2019-06-25
CN109933348B true CN109933348B (en) 2023-02-14

Family

ID=66984952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910052372.1A Active CN109933348B (en) 2019-01-21 2019-01-21 Method and device for updating Bootloader in electronic control unit

Country Status (1)

Country Link
CN (1) CN109933348B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362327B (en) * 2019-07-12 2023-05-16 北京经纬恒润科技股份有限公司 Application program updating method, device and system
CN110209420A (en) * 2019-08-01 2019-09-06 潍柴动力股份有限公司 A kind of method and device updating bootstrap loader
CN110618825B (en) * 2019-08-02 2023-06-13 惠州市德赛西威汽车电子股份有限公司 Self-updating method of Boot Loader of vehicle
CN110688135A (en) * 2019-09-20 2020-01-14 浙江吉利汽车研究院有限公司 Program flashing method, device and medium for controller
CN110794804B (en) * 2019-09-25 2021-02-23 潍柴动力股份有限公司 System, ECU, motor vehicle and method for flashing ECU
CN110704076A (en) * 2019-10-15 2020-01-17 上海元城汽车技术有限公司 Data processing method and device, vehicle-mounted controller and computer-readable storage medium
CN110990041A (en) * 2019-12-16 2020-04-10 杭州涂鸦信息技术有限公司 Bootloader upgrading method and bootloader upgrading system
CN111061500A (en) * 2019-12-31 2020-04-24 宝能汽车有限公司 bootloader program updating method and bootloader program updating device
CN111459508B (en) * 2020-03-27 2023-12-01 北京经纬恒润科技股份有限公司 BootLoader self-upgrading method and system
CN111666091B (en) * 2020-06-12 2023-08-29 成都极米科技股份有限公司 System updating method, device, electronic equipment and computer readable storage medium
EP4006718A1 (en) * 2020-11-30 2022-06-01 Carrier Corporation Failsafe update of bootloader firmware
CN112596766A (en) * 2020-12-24 2021-04-02 浙江合众新能源汽车有限公司 Software upgrading method and device based on Bootloader
CN112988172A (en) * 2021-02-20 2021-06-18 浙江禾川科技股份有限公司 Program updating method, device and system of encoder
CN113343314A (en) * 2021-07-02 2021-09-03 北京汽车集团越野车有限公司 Data verification method and device for data flashing
CN113741943B (en) * 2021-11-08 2022-03-18 湘投云储科技有限公司 Embedded equipment program upgrading system and method
CN114281392A (en) * 2022-03-04 2022-04-05 季华实验室 Serial port upgrading method and system for multi-MCU slave station
CN114610415B (en) * 2022-03-23 2024-01-16 北京经纬恒润科技股份有限公司 Program starting method, system, storage medium and electronic equipment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2453352A1 (en) * 2010-11-08 2012-05-16 Gemalto SA Software updating process for an embedded device
CN102243591B (en) * 2011-06-30 2014-02-19 南京熊猫信息产业有限公司 Method for improving Loader-upgrading stability of set top box by adopting two zone bits
CN102855151B (en) * 2012-08-21 2016-06-08 武汉电信器件有限公司 The optical module firmware not interrupting business is in application upgrade method
CN104360877B (en) * 2014-10-24 2017-12-05 同济大学 ECU firmware updates based on Bootloader self refreshes
FR3040094B1 (en) * 2015-08-14 2017-09-15 Alstom Transp Tech ELECTRONIC EQUIPMENT COMPRISING A PARTITIONED STARTING PROGRAM, RAILWAY VEHICLE AND RAILWAY SYSTEM THEREFOR
WO2017095955A1 (en) * 2015-12-04 2017-06-08 Alibaba Group Holding Limited Implementing application jumps
CN107632862A (en) * 2017-09-20 2018-01-26 江苏兆能电子有限公司 A kind of multistage start-up loading method of vehicle electronic control unit ECU
CN108920196A (en) * 2018-06-28 2018-11-30 国机智骏(北京)汽车科技有限公司 Entire car controller bootload upgrade method, device, entire car controller and vehicle
CN109189461B (en) * 2018-11-27 2022-01-18 上海辛格林纳新时达电机有限公司 Procedure upgrading method for elevator control system, elevator control system and elevator equipment

Also Published As

Publication number Publication date
CN109933348A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN109933348B (en) Method and device for updating Bootloader in electronic control unit
CN110231952B (en) ECU program backup and cyclic upgrade control method and device
KR100880783B1 (en) Tri-phase boot process in electronic devices
CN110597542B (en) Software automatic OTA (over the air) upgrading method and device and electronic equipment
CN111796848A (en) Bootloader software updating method and device, embedded controller and storage medium
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
CN111427596A (en) Software upgrading method and device and terminal equipment
CN110007935B (en) Processing method, device and equipment for program upgrading
CN110764486B (en) Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium
CN111684416B (en) Vehicle control device and program update system
CN111459508B (en) BootLoader self-upgrading method and system
CN113220319A (en) Data updating method and device and vehicle
CN110688135A (en) Program flashing method, device and medium for controller
CN115951920A (en) Mobile equipment upgrading method and device, storage unit and mobile equipment
CN112711427A (en) Method and device for acquiring mirror image file
CN100359485C (en) Testing device and method for flush-bonding system
JP2011175352A (en) Firmware updating device, communication apparatus, electronic apparatus, firmware updating system, firmware updating method and program
CN115061713A (en) Method and device for upgrading electronic equipment
CN110362320B (en) Command implementation method and device of application development platform
CN109428936B (en) APP upgrading method, device, system, electronic equipment and storage medium
CN112905217B (en) Program updating method, terminal, system and storage medium of embedded program
CN115658122A (en) Software upgrading method and device and Internet of things equipment upgrading system
CN110618824A (en) Software upgrading method, device, medium and equipment
CN108664259B (en) Method and terminal for installing application
CN111124461B (en) Method and device for upgrading OTA (over the air) of singlechip and singlechip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Xie Shaowei

Inventor before: Xie Shaowei

Inventor before: Zhou Zhimin

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant