A system updating method for electronic controller
By eliminating and firing programs from the BootLoader program and downloading them to the random storage area, the problem of low update efficiency of electronic controllers is solved, and faster update speed and higher security are achieved.
Patent Information
- Application Number
- CN202010219827.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-25
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-03-25
AI Technical Summary
In the update method of existing electronic controllers, the BootLoader program code takes up a lot of space and the communication protocol runs slowly, resulting in a long update time and low efficiency, and the update algorithm cannot be improved in time.
The erase and burn-in programs are removed from the BootLoader program, downloaded to the random storage area of the microcontroller unit, and automatically deleted after update, improving the running speed of the BootLoader program, and realizing the self-test of the BootLoader program to optimize the system update efficiency.
It improves the running rate of the BootLoader program, reduces storage space usage, enhances system security, and realizes self-test and efficiency improvement of system updates.
Smart Images

Figure CN113449307B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automobile parts and components, and in particular to a system updating method of an electronic controller. Background Art
[0002] In the automotive field, the electronic control unit (ECU) mainly collects signals (data), performs calculations and comparisons, performs logic analysis on these signals, and then generates corresponding control instructions to control various actuators of the car to perform corresponding functions, thereby ultimately achieving automatic control of the car. With the continuous development of autonomous driving technology, the development of electronic controllers has an increasingly obvious impact on the development of automobiles.
[0003] Various applications are loaded in the electronic controller, and these applications are used to perform functions such as signal acquisition, calculation and comparison, logic analysis, and generation and issuance of control instructions. However, these applications generally have frequent update requirements. In the update method of the electronic controller in the prior art, the BootLoader program code used occupies a large space, the communication protocol between the host computer and the electronic controller runs slowly, and usually requires a long update time, and the update algorithm cannot be improved in time, and the update efficiency is low. Summary of the invention
[0004] To solve the above problems, the present invention proposes a system update method for an electronic controller. In the present invention, the erasing and burning program is removed from the BootLoader program, so that it is downloaded from the host computer to the random storage area of the microcontroller unit during the update, so that the erasing and burning program can be automatically deleted from the random storage area after the system update is completed and reset, thereby avoiding it from occupying the storage space all the time and improving the running speed of the BootLoader program; in addition, the present invention can also realize the self-check of the BootLoader program update, greatly improving the system update efficiency of the electronic controller.
[0005] A system update method for an electronic controller, characterized in that the BootLoader program solidified and stored in a microcontroller unit of the electronic controller does not include an erasing and burning program, wherein the system update method comprises the following steps:
[0006] S1: Establishing a connection between the electronic controller and the host computer;
[0007] S2: The microcontroller unit of the electronic controller enters the BootLoader program area and determines whether there is an update requirement for the application program on the microcontroller unit according to the first instruction issued by the host computer;
[0008] S3: when there is an update requirement, download the erasing and burning program to the random access memory area of the micro control unit;
[0009] S4: The microcontroller unit executes the erasing and programming procedures of the random storage area, completes the update, and sends an update feedback to the upper computer;
[0010] S5: The micro control unit receives the reset instruction and performs a reset operation;
[0011] S6: After resetting, the microcontroller jumps to the BootLoader program area and detects whether the BootLoader program needs to be updated according to the second instruction issued by the host computer;
[0012] S7: When the BootLoader program needs to be updated, executing BootLoader update;
[0013] S7': When the BootLoader program does not need to be updated, the microcontroller detects the application program on the microcontroller, and runs the application program according to the detection result, so that the electronic controller runs normally.
[0014] Preferably, in the system update method of the above-mentioned electronic controller, the electronic controller includes at least two microcontroller units, the first microcontroller unit is communicatively connected to the host computer, and is communicatively connected to the other microcontroller units respectively, and the system update method also includes: after the first microcontroller unit completes the update, the first microcontroller unit receives an update instruction from the host computer and sends it to the other microcontroller units; downloads the erasing and burning program from the host computer to the random storage area of the other microcontroller units; the other microcontroller units start the BootLoader program and execute the erasing and burning program of the random storage area to complete the update; the other microcontroller units send update feedback to the host computer through the first microcontroller unit; after the first microcontroller unit and the other microcontroller units complete the update, they perform a reset operation according to the reset instruction.
[0015] Preferably, in the above-mentioned system update method of the electronic controller, the step of detecting whether the BootLoader program needs to be updated includes: the microcontroller receives a reset instruction, and after executing the first reset operation, the microcontroller jumps to the interrupt vector reboot area, and according to the guidance of the boot identification bit, jumps to the BootLoader program area; and detects whether there is any update requirement for the BootLoader program.
[0016] Preferably, in the above-mentioned system update method of the electronic controller, the update method of the BootLoader program includes the following steps: when it is detected that there is a need to update the BootLoader program, the microcontroller enters the BootLoader program area, and downloads the erasing and burning program from the host computer to the random storage area; erases the designated area of the microcontroller; downloads the BootLoader updater from the host computer to the designated area; changes the data of the boot identification bit of the interrupt vector redirection area; the microcontroller receives a reset instruction and performs a second reset operation; the microcontroller jumps to the updater according to the guidance of the boot flag bit of the interrupt vector redirection area, runs the updater, and completes the update of the BootLoader program.
[0017] Preferably, in the above-mentioned system update method of the electronic controller, after completing the update of the BootLoader program, an update feedback is sent to the host computer to change the data of the boot identification bit of the interrupt vector reboot area; a reset instruction is received and a third reset operation is performed; the microcontroller unit jumps to the interrupt vector reboot area, and according to the guidance of the boot identification bit, jumps to the updated BootLoader program area, communicates with the host computer, and determines whether there is an update requirement for the application of the microcontroller unit.
[0018] Preferably, in the above-mentioned system updating method of the electronic controller, the first micro control unit establishes a communication connection with the host computer via Flexray, and the first micro control unit establishes a communication connection with the other micro control units via CAN FD.
[0019] Preferably, in the above-mentioned system update method of the electronic controller, the step of establishing a connection between the electronic controller and the host computer includes: the host computer sends a verification key to the microcontroller unit of the electronic controller; the microcontroller unit receives and verifies the verification key; based on the verification result, the microcontroller unit starts a security verification program and generates a seed to feed back to the host computer; after the host computer verifies the seed, it allows a communication connection to be established with the microcontroller unit.
[0020] Preferably, in the above-mentioned system updating method of the electronic controller, the first micro control unit and the other micro control units perform security verification via a security key.
[0021] Preferably, in the above-mentioned system update method of the electronic controller, the microcontroller unit detects the application on the microcontroller unit, and the step of running the application according to the detection result includes: the microcontroller unit detects whether the application on the microcontroller unit is valid; when the application is valid, runs the application; when the application is invalid, remains in the BootLoader program area, communicates with the host computer, and receives a fourth instruction from the host computer to determine whether the application needs to be updated; when the application needs to be updated, repeats steps S3-S7'; when the application does not need to be updated, repeatedly detects whether the application on the microcontroller unit is valid.
[0022] Compared with the prior art, the advantages of the present invention are:
[0023] 1) Remove the erasing and burning programs from the BootLoader program, and download them from the host computer to the random storage area of the microcontroller unit during the update, thereby increasing the running speed of the BootLoader program;
[0024] 2) After the erase and burn program is updated and the system is reset, it is automatically deleted from the random storage area, reducing the useless occupation of storage space, improving the system operation speed, avoiding abnormal damage to system applications, and improving system security;
[0025] 3) It can realize self-check of BootLoader program update requirements and improve system work efficiency;
[0026] 4) Establish a secure access mechanism between the microcontroller unit and the host computer, and between microcontroller units to avoid arbitrary erasure of application programs in the microcontroller unit and improve system security;
[0027] 5) Flexray is used to realize the communication between the host computer and the microcontroller unit, CAN FD is used to realize the communication between the microcontroller units, and an error correction mechanism is established between the microcontroller units to improve the robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 The figure is a flow chart of a system updating method of an electronic controller according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0029] The advantages of the present invention are described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0030] See also Figure 1 , which is a flow chart of a system update method of an electronic controller in accordance with a preferred embodiment of the present invention. It can be seen from the figure that the system update method of the electronic controller provided in this embodiment mainly includes the following steps:
[0031] S1: Establish a connection between the electronic controller and the host computer;
[0032] Preferably, a Flexray bus is used to realize the communication connection between the electronic controller and the host computer. Since the Flexray communication protocol can realize a data transmission rate of 10Mhz baud rate, the rate of system update can be greatly improved.
[0033] S2: The microcontroller unit of the electronic controller enters the BootLoader program area and determines whether there is an update requirement for the application program on the microcontroller unit according to the first instruction issued by the host computer;
[0034] In this embodiment, the electronic controller may be powered on and reset, so that the microcontroller of the electronic controller enters the BootLoader program area, and establishes a communication connection with the host computer through a communication protocol to receive an update instruction, i.e., a first instruction, issued by the host computer. After receiving the update instruction, the microcontroller parses the update instruction to obtain whether there is an update requirement for the application on the microcontroller, and specifically which application needs to be updated. At the same time, in this embodiment, the BootLoader program may be solidified in the microcontroller, but the erasing and burning program (Flash program) is removed from the BootLoader program, reducing the space occupancy ratio of the BootLoader program code.
[0035] S3: when there is an update requirement, download the erasing and burning program to the random access memory area of the micro control unit;
[0036] When it is obtained from the update instruction sent by the parsed host computer that there is a need to update the application on the microcontroller unit, the microcontroller unit will download the erasing and burning program, preferably the Flash program, from the host computer, and store the erasing and burning program in the random storage area of the microcontroller unit. Due to the volatility of random storage, when the system is updated and reset, the erasing and burning program will be automatically deleted, thereby reducing the occupation of the system memory by the erasing and burning program, and at the same time avoiding the risk of abnormal damage to the system application due to the solidified storage of the erasing and burning program, thereby improving the security of the system.
[0037] S4: The microcontroller unit executes the erasing and programming procedures of the random storage area, completes the update, and sends update feedback to the host computer;
[0038] Since the BootLoader program has been started, when the erase and burn program is downloaded, the microcontroller unit will directly execute the erase and burn program to complete the update of all or part of the application programs that need to be updated in the microcontroller unit. When it is detected that all application updates are completed, the microcontroller unit generates an update feedback and sends it to the host computer.
[0039] S5: The microcontroller unit performs a reset operation according to the reset instruction;
[0040] In this embodiment, preferably, after receiving the update feedback from the microcontroller unit, the upper computer will send a reset instruction to the microcontroller unit, and the microcontroller unit will perform a reset operation according to the reset instruction, after the reset operation; or after the application programs of the microcontroller unit have been updated, the reset operation of the updated microcontroller unit will be performed by turning off and starting the power supply.
[0041] S6: After resetting, the microcontroller jumps to the BootLoader program area and detects whether the BootLoader program needs to be updated according to the second instruction issued by the host computer;
[0042] Another advantage of this embodiment is that after the microcontroller completes the update of the application and resets, it does not directly jump to the application area and run the application, but first jumps to the BootLoader program area, receives the update instruction issued by the host computer, parses the update instruction, and determines whether there is an update requirement, so as to detect whether the BootLoader program needs to be updated.
[0043] S7: When the BootLoader program needs to be updated, the BootLoader program is updated;
[0044] S7': When the BootLoader program does not need to be updated, the microcontroller detects the application program on the microcontroller, and runs the application program according to the detection result, so that the electronic controller runs normally.
[0045] That is, when it is detected that the BootLoader program does not need to be updated, the microcontroller will jump to the application area to detect the validity of each application. Preferably, when it is detected that each application is valid, these applications are run to enable the electronic controller to operate normally; and when it is detected that all or part of the applications are invalid, the microcontroller remains in the BootLoader program area and communicates with the host computer to receive the fourth instruction from the host computer to determine whether these invalid applications need to be updated. When the applications need to be updated, the above steps S3-S7' are repeated again; when it is determined that no application needs to be updated, the validity of these applications is determined again, and the cycle is repeated in sequence until all applications are valid, so that these applications can be run and the electronic controller can operate normally.
[0046] Based on the above embodiments, it can be seen that the system update method of the electronic controller provided by the present invention removes the erasing and burning programs from the BootLoader program, and downloads them from the host computer to the random storage area of the microcontroller unit during updating, thereby improving the running speed of the BootLoader program; after the erasing and burning programs are updated and the system is reset, they are automatically deleted from the random storage area, thereby reducing useless occupation of storage space, improving the system running speed, and avoiding abnormal damage to system applications, thereby improving system security; self-checking of the BootLoader program update requirements can be realized, thereby improving system work efficiency.
[0047] Based on the above embodiment, in another embodiment consistent with the present invention, the electronic controller may further include at least two micro control units, wherein a first micro control unit establishes a communication connection with the host computer, and the other micro control units respectively establish communication connections with the first micro control unit. In this case, the system update of the electronic controller may involve the update of application programs of multiple sub-level micro control units, and the system update method includes:
[0048] S11: After the first microcontroller unit completes the update, the erasing and burning program is downloaded from the host computer to the random storage area of other microcontroller units;
[0049] In this embodiment, after the update of the first microcontroller unit is completed according to the system update of the above embodiment, the first microcontroller unit will receive an update instruction from the host computer, and send the update instruction to these other microcontroller units through the communication connection with other microcontroller units; after receiving the update instruction, the other microcontroller units will parse the update instruction, and after the parsed update instruction, check whether there is an update requirement for the application in the update instruction, thereby determining whether there is an update requirement for the application in the other microcontroller units. Similarly, in this embodiment, the BootLoader program of these other microcontroller units no longer has the erasing and burning program solidified, so when there is an update requirement for the application in other microcontroller units, these other microcontroller units use the communication connection to download the erasing and burning program from the host computer through the first microcontroller unit to the random storage area of these other microcontroller units. That is, in this embodiment, the first microcontroller unit is used as a medium for communication connection between other microcontroller units and the host computer, and the first microcontroller unit downloads update instructions, erasing and burning programs, etc. required for updating other microcontroller units from the host computer to these other microcontroller units. Therefore, there is no need to establish communication connections between these other microcontroller units and the host computer one by one to obtain the instructions or programs required for application program updates, which simplifies the communication connection relationship for updating the electronic controller system and improves the update efficiency.
[0050] S12: Other microcontroller units start the BootLoader program and execute the erasing and burning procedures of the random storage area to complete the update;
[0051] Subsequently, the BootLoader programs of these other microcontroller units are started, so that these other microcontroller units execute the erasing and burning programs in the random storage area, complete the updating of the application program, and complete the system updating of these other microcontroller units.
[0052] S13: other micro-control units send update feedback to the upper computer through the first micro-control unit;
[0053] After the other micro control units complete the update, they will generate update feedback respectively and send it to the host computer through the first micro control unit.
[0054] S14: After the first micro control unit and other micro control units have completed updating, they perform a reset operation according to the reset instruction.
[0055] In the electronic controller of multiple microcontrollers of the present embodiment, it can be that, preferably, after the host computer receives update feedbacks from the first microcontroller and each other microcontroller, it will uniformly issue a reset instruction, and the first microcontroller that receives the reset instruction will transmit the reset instruction to each other microcontroller, so that the first microcontroller and each other microcontroller perform a reset operation after completing the update; it can also be that, preferably, after monitoring that the application programs of all microcontrollers have completed the update, the reset operation of the updated microcontroller is performed by turning off and starting the power supply. In the present embodiment, similarly, after the other microcontrollers are reset, they will also jump to their respective BootLoader program areas to detect whether there is an update requirement for their BootLoader programs. If there is an update requirement for their BootLoader programs, the BootLoader programs will be updated first; if there is no update requirement for the BootLoader program, these microcontrollers will jump to the application program area, and detect and run these applications, so that the electronic controller operates normally. At this time, as in the above embodiment, when it is detected that each application is valid, these applications are run to enable the electronic controller to operate normally; when it is detected that all or part of the applications are invalid, each microcontroller unit remains in the BootLoader program area, and communicates with the host computer through the first microcontroller unit, and receives the fourth instruction from the host computer to determine whether these invalid applications need to be updated. When the applications need to be updated, the update steps of the above microcontroller units are repeated again; when it is determined that no applications need to be updated, the validity of these applications are determined again, and the cycle is repeated in sequence until all applications are valid, so that these applications can be run and the electronic controller can operate normally.
[0056] It can be seen that in view of the above embodiments, the present invention can also realize the system update of an electronic controller including more than one microcontroller unit, which uses a microcontroller unit as a medium for connecting with a host computer, so that multiple microcontroller units can receive instructions from the host computer and download programs from the host computer with the help of the microcontroller unit, thereby simplifying the communication connection relationship with the host computer and improving the efficiency of system updates.
[0057] Based on the above embodiment, in another preferred embodiment of the present invention, a method for self-checking the update of a BootLoader program is also provided. The method comprises the following steps:
[0058] S21: The microcontroller receives the reset instruction from the host computer, and after executing the first reset operation, the microcontroller jumps to the interrupt vector reboot area, and according to the guidance of the boot identification bit, jumps to the BootLoader program area to check whether there is any update requirement for the BootLoader program.
[0059] In this embodiment, the microcontroller unit jumps to the interrupt vector reboot area after reset. Since the boot identification bit of the interrupt vector reboot area is invalid data after the first reset, the microcontroller unit will jump to the BootLoader program area after encountering the invalid data, receive the update request issued by the host computer, and parse the update request to check whether there is an update request for the BootLoader program.
[0060] It can be seen that in view of the method of the above embodiment, the present invention can detect whether the BootLoader program needs to be updated after other application programs of the microcontroller unit are updated, and complete the update of the BootLoader program at the same time, thereby improving the efficiency of system update.
[0061] Based on the above embodiment, in another preferred embodiment of the present invention, a method for updating a BootLoader program is also provided, which includes the following steps:
[0062] S31: The microcontroller enters the BootLoader program area and downloads the erase and burn program from the host computer to the random access memory area;
[0063] The microcontroller unit completes the application update based on the methods in the above embodiments, and resets to the BootLoader program area. If it detects that there is a need to update the BootLoader program, the microcontroller unit downloads the erase and burn program from the host computer to the random storage area of the microcontroller unit.
[0064] S32: Erasing the designated area of the micro control unit;
[0065] In this embodiment, a start address and an end address are obtained by parsing the update instruction of the BootLoader program issued by the host computer, which are used to plan a specified area. Therefore, when the erase and burn program is downloaded, it will erase the specified area according to the obtained start address and end address.
[0066] S33: Downloading the BootLoader updater from the host computer to the designated area;
[0067] After the designated area is erased, the microcontroller unit requests the host computer to download the BootLoader updater to the designated area.
[0068] S34: Change the data of the boot identification bit of the interrupt vector reboot area;
[0069] Preferably, when the download of the BootLoader updater is completed, under the triggering of this event, the micro control unit changes the boot identification bit of the interrupt vector redirection area from invalid to valid.
[0070] S35: The microcontroller receives the reset instruction and performs a second reset operation;
[0071] Preferably, the reset instruction may be generated by the host computer according to the update feedback from the microcontroller, or the microcontroller may pre-set a time threshold as the reset instruction, and when the time threshold is reached, the microcontroller executes the reset operation.
[0072] S36: The microcontroller unit jumps to the BootLoader updater according to the guidance of the boot flag bit of the interrupt vector reboot area, runs the BootLoader updater, and completes the update of the BootLoader program;
[0073] After the microcontroller unit is reset for the second time, if a valid boot identification bit is encountered in the interrupt vector reboot area, it jumps to the BootLoader updater position and runs the BootLoader updater to complete the update of the BootLoader program to fix the vulnerability of the BootLoader program and provide new functions.
[0074] Based on the above embodiment, in another preferred embodiment of the present invention, the electronic microcontroller can be further updated again based on the updated BootLoader program, so that the system update method of the electronic microcontroller also includes the following steps:
[0075] S41: After completing the update of the BootLoader program, send update feedback to the host computer;
[0076] After the BootLoader program is updated, the microcontroller generates an update feedback and sends it to the host computer.
[0077] S42: Change the data of the boot identification bit of the interrupt vector reboot area.
[0078] The microcontroller unit will further change the boot identification bit of the interrupt vector reboot area to invalid again, so that after the system is reset again, the microcontroller unit can directly jump to the BootLoader program area under the guidance of the boot identification bit to run the updated BootLoader program, and use the updated BootLoader program to further update the microcontroller unit.
[0079] S43: receiving a reset instruction from the host computer and performing a third reset operation;
[0080] After receiving the update feedback sent by the micro control unit, the host computer generates a reset instruction and sends it to the micro control unit. The micro control unit receives the reset instruction and thus performs a third reset.
[0081] S44: the microcontroller unit jumps to the interrupt vector reboot area, and according to the guidance of the boot identification bit, jumps to the updated BootLoader program area;
[0082] After reset, the microcontroller unit encounters an invalid boot flag and will jump to the BootLoader program area again.
[0083] S45: Communicate with the host computer to determine whether there is a need to update the application program of the microcontroller unit.
[0084] After the microcontroller enters the BootLoader program area, it will communicate with the host computer and, in accordance with the methods described in the above embodiments, inquire the host computer whether there is an update requirement for the application in the microcontroller, and update the corresponding application when there is an update requirement for the application. When there is no update requirement, the validity of the application is detected. When it is detected that all the applications are valid, the application on the microcontroller is run so that the electronic controller can operate normally. When it is detected that all or part of the application is invalid, the microcontroller remains in the BootLoader program area and communicates with the host computer to receive instructions from the host computer to determine whether these invalid applications need to be updated. When the application needs to be updated, the update steps of the microcontroller in the above embodiments are repeated again. When it is determined that no application needs to be updated, the validity of these applications is determined again, and the cycle is repeated in sequence until all applications are valid, so that these applications can be run, and the electronic controller can operate normally.
[0085] Based on the above embodiment, in another embodiment consistent with the present invention, a method for establishing a connection between an electronic controller and a host computer is also provided, comprising the following steps:
[0086] S51: The host computer sends a verification key to the micro control unit of the electronic controller;
[0087] S52: The micro control unit receives and verifies the verification key;
[0088] S53: According to the verification result, the microcontroller unit starts the safety verification program and generates a seed to feed back to the host computer;
[0089] S54: After the host computer verifies the seed, it allows the establishment of a communication connection with the micro control unit.
[0090] In the above method, the security verification program of the microcontroller unit generates a seed according to a pre-defined encryption algorithm. Since the same encryption algorithm is stored in the host computer, when the host computer receives the seed, it can determine whether the seed is correct by whether it can be parsed. When the seed is correct, the host computer allows the establishment of a communication connection with the microcontroller unit, otherwise, the communication connection is not allowed. Thus, arbitrary erasure or modification of the application program on the microcontroller unit is avoided, and security is improved.
[0091] Based on the above embodiment, in another embodiment of the present invention, the first microcontroller unit and the other microcontroller units perform security verification through a security key. Only when the verification is passed, the communication connection between the first microcontroller unit and the other microcontroller units is allowed to be established, further avoiding the arbitrary modification or erasure of the application programs on the other microcontroller units, thereby improving the security of the electronic controller.
[0092] The specific embodiments of the present invention are described in detail above, but they are only examples, and the present invention is not limited to the specific embodiments described above. For those skilled in the art, any equivalent modifications and substitutions made to the present invention are also within the scope of the present invention. Therefore, the equalization changes and modifications made without departing from the spirit and scope of the present invention should be included in the scope of the present invention.
Claims
1. A system update method for an electronic controller, characterized in that: The BootLoader program solidified and stored in the microcontroller unit of the electronic controller does not include an erasing and burning program, wherein the system updating method comprises the following steps: S1: Establish a connection between the electronic controller and the host computer. S2: The microcontroller of the electronic controller enters the BootLoader program area and determines whether there is an update requirement for the application program on the microcontroller according to the first instruction issued by the host computer. S3: When there is an update requirement, download the erase and burn program to the random storage area of the micro control unit, S4: The microcontroller unit executes the erasing and programming procedures of the random storage area, completes the update, and sends update feedback to the upper computer. S5: The microcontroller receives the reset instruction and performs a reset operation. S6: After reset, the microcontroller jumps to the BootLoader program area and executes the first reset operation according to the reset instruction issued by the host computer. The microcontroller jumps to the interrupt vector reboot area, and according to the guidance of the boot identification bit, jumps to the BootLoader program area. Detect whether the BootLoader program needs to be updated. S7: When the BootLoader program needs to be updated, the microcontroller enters the BootLoader program area and downloads the erasing and burning program from the host computer to the random access memory area. Erasing a designated area of the microcontroller unit, Download the BootLoader updater from the host computer to the specified area. Change the data of the boot identification bit of the interrupt vector reboot area, The microcontroller receives the reset instruction and performs a second reset operation. The microcontroller unit jumps to the updater according to the guidance of the boot flag bit of the interrupt vector reboot area, runs the updater, and completes the update of the BootLoader program. S7': When the BootLoader program does not need to be updated, the microcontroller detects the application program on the microcontroller, and runs the application program according to the detection result, so that the electronic controller runs normally.
2. The system updating method according to claim 1, characterized in that: The electronic controller includes at least two micro control units, a first micro control unit is communicatively connected to the host computer, and is communicatively connected to other micro control units respectively, and the system updating method further includes: After the first micro control unit completes the update, the first micro control unit receives an update instruction from the host computer and sends it to the other micro control units. Download the erasing and burning program from the host computer to the random storage area of the other microcontroller unit, and the other microcontroller unit starts the BootLoader program and executes the erasing and burning program of the random storage area to complete the update. The other micro control units send update feedback to the host computer through the first micro control unit. After the first micro control unit and the other micro control units complete the update, they perform a reset operation according to the reset instruction.
3. The system updating method according to claim 1 or 2, characterized in that: Also includes, After completing the update of the BootLoader program, send update feedback to the host computer. Change the data of the boot identification bit of the interrupt vector reboot area, Receive the reset command and perform the third reset operation. The microcontroller jumps to the interrupt vector reboot area, and according to the guidance of the boot identification bit, jumps to the updated BootLoader program area. Communicate with the host computer to determine whether there is a need to update the application of the micro control unit.
4. The system updating method according to claim 2, characterized in that: The first micro control unit establishes a communication connection with the host computer via Flexray. The first micro control unit establishes a communication connection with the other micro control units via CAN FD.
5. The system updating method according to claim 1, characterized in that: The step of establishing connection between the electronic controller and the host computer includes: The host computer sends a verification key to the micro control unit of the electronic controller, The micro control unit receives and verifies the verification key, According to the verification result, the micro control unit starts a safety verification program, generates a seed and feeds it back to the host computer. After the host computer verifies the seed, it allows a communication connection to be established with the micro control unit.
6. The system updating method according to claim 2, characterized in that: The first micro control unit and the other micro control units perform security verification via a security key.
7. The system updating method according to claim 1, characterized in that: The microcontroller unit detects the application program on the microcontroller unit, and the step of running the application program according to the detection result includes: The microcontroller unit detects whether the application on the microcontroller unit is valid, When the application is valid, running the application, When the application is invalid, it remains in the BootLoader program area, communicates with the host computer, and receives a fourth instruction from the host computer to determine whether the application needs to be updated. When the application needs to be updated, repeat steps S3-S7'; When the application does not need to be updated, it is repeatedly detected whether the application on the micro control unit is valid.
