CN111459508A - Boot L loader self-upgrading method and system - Google Patents

Boot L loader self-upgrading method and system Download PDF

Info

Publication number
CN111459508A
CN111459508A CN202010231994.3A CN202010231994A CN111459508A CN 111459508 A CN111459508 A CN 111459508A CN 202010231994 A CN202010231994 A CN 202010231994A CN 111459508 A CN111459508 A CN 111459508A
Authority
CN
China
Prior art keywords
area
boot
loader
program
flag
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.)
Granted
Application number
CN202010231994.3A
Other languages
Chinese (zh)
Other versions
CN111459508B (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.)
Beijing Jingwei Hirain Tech Co Ltd
Original Assignee
Beijing Jingwei Hirain Tech 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 Beijing Jingwei Hirain Tech Co Ltd filed Critical Beijing Jingwei Hirain Tech Co Ltd
Priority to CN202010231994.3A priority Critical patent/CN111459508B/en
Publication of CN111459508A publication Critical patent/CN111459508A/en
Application granted granted Critical
Publication of CN111459508B publication Critical patent/CN111459508B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a Boot L loader self-upgrading method and a Boot L loader self-upgrading system, wherein the method comprises the steps of running a program in a starting program area, judging whether a BT mark is 0 or 1, copying codes in a backup BT program area to a normal BT program area when the BT mark is 1, setting the BT mark in the running mark area to 0, running the program in the normal BT program area, judging whether an upgrading mark is 0 or 1, judging whether an upgrading area is a flash area of BT and/or a flash area of an application program when the upgrading mark is 1, erasing the flash area of the backup BT program area and writing new BT program codes when the flash area of BT is the flash area, setting the BT mark to 1, setting the upgrading mark to 0, and returning to the program running again in the starting program area.

Description

Boot L loader self-upgrading method and system
Technical Field
The invention relates to the technical field of electronic product software upgrading, in particular to a Boot L loader self-upgrading method and system.
Background
At present, the ECU (Electronic Control Unit) in the traditional automotive electronics field is a common single chip microcomputer, and its Boot L loader (BT, Boot load) is different from the Boot L loader of the embedded L inux system, and it is not responsible for hardware initialization before system application is started, but is an independent program, and is only responsible for application program upgrade.
At present, the upgrading mode of the ECU in the traditional automotive electronics field is that the upgrading package of the ECU is transmitted to Boot L loader of the ECU through an OBD (On Board Diagnostics) interface and a CAN bus communication mode, and then the Boot L loader performs flash writing operation to complete upgrading.
However, in the era of intelligent internet vehicles, the upgrading mode of the ECU software becomes various, and the ECU software can be upgraded remotely through OTA (over the Air Technology), or the ECU in the vehicle can be upgraded through the vehicle machine, or the original OBD upgrading mode can be adopted. In the era of intelligent networking, the user demand changes rapidly, and the software updating speed is accelerated, so as to meet the requirement of the user on continuously pursuing the driving experience.
Therefore, the importance of Boot L loader responsible for ECU upgrading is self-evident, and rapid iteration of application software needs to depend on the running stability and reliability of Boot L loader, while a new product or a new project sometimes preempts market leader in order to rapidly develop a new product, the stability of Boot L loader is not good, so that the upgrading failure rate is high, or the dormancy current of the ECU is influenced, and the like, so the Boot L loader also has upgrading functions like application software, which is commonly called Boot L loader self-upgrading.
Therefore, how to simply and quickly realize the self-elevating stage of Boot L loader is a problem to be solved urgently.
Disclosure of Invention
In view of the above, the invention provides a method and a system for self-upgrading a Boot L loader, which can simply and quickly realize self-upgrading of a Boot L loader, and effectively solve the problems of time and labor consumption and low efficiency caused by manual updating of a Boot L loader program in the prior art.
The invention provides a Boot L loader self-upgrading method, which is applied to an electronic control unit, wherein a programmable storage area of the electronic control unit is divided into an operation mark area, a starting program area, a normal Boot L loader program area, a backup Boot L loader program area and an application program area, and the method comprises the following steps:
running a program in a start program area;
judging whether a Boot L loader mark in the operation mark area is 0 or 1;
when the Boot L loader mark in the operation mark area is 1, copying codes in a backup Boot L loader program area to a normal Boot L loader program area;
after the code copying is finished, setting a Boot L loader flag in the operation flag area to be 0;
running the program in the normal Boot L loader program area;
judging whether an upgrading mark in the operation mark area is 0 or 1;
when the upgrading mark in the operation mark area is 1, judging whether the upgrading area is a flash area of Boot L loader and/or a flash area of an application program;
when the upgrading area is a flash area of a Boot L loader, erasing the flash area of a backup Boot L loader program area, and writing a new Boot L loader program code;
setting a Boot L loader flag in the operation flag area to 1;
setting an upgrade flag in the operation flag region to 0;
and returning to run the program in the starting startup program area again.
Preferably, the method further comprises:
and when the Boot L loader flag in the operation flag area is 0, jumping to the program in the normal Boot L loader program area.
Preferably, the method further comprises:
when the upgrade flag in the run flag area is 0, the program in the application program area is run.
Preferably, the method further comprises:
judging whether an upgrade request is received, if so, then:
setting an upgrade flag in the operation flag region to 1;
and returning to run the program in the starting startup program area again.
Preferably, the method further comprises:
and when the upgrading area is the flash area of the application program, erasing the flash area of the application program and writing a new application program code.
A Boot L loader self-upgrading system is applied to an electronic control unit, a programmable storage area of the electronic control unit is divided into an operation mark area, a starting program area, a normal Boot L loader program area, a backup Boot L loader program area and an application program area, and the system comprises:
the first running module is used for running the program in the starting program area;
the first judgment module is used for judging whether a Boot L loader mark in the operation mark area is 0 or 1;
a copy module, configured to copy, when the Boot L loader flag in the operation flag area is 1, a code in the backup Boot L loader program area to a normal Boot L loader program area;
the first setting module is used for setting a Boot L loader flag in the running flag area to 0 after the code copying is finished;
the second running module is used for running the programs in the normal Boot L loader program area;
the second judgment module is used for judging whether the upgrading mark in the operation mark area is 0 or 1;
a third judging module, configured to, when the upgrade flag in the operation flag area is 1, judge whether the upgrade area is a flash area of the Boot L loader and/or a flash area of the application program;
the first updating module is used for erasing a flash area of a Boot L loader program area and writing a new Boot L loader program code when the upgrading area is the flash area of the Boot L loader;
the second setting module is used for setting a Boot L loader flag in the operation flag area to be 1;
the third setting module is used for setting the upgrading mark in the operation mark area to be 0;
and the return module is used for returning to operate the program in the starting program area again.
Preferably, the system further comprises:
and the jump module is used for jumping to a program in the program area of the normal Boot L loader when the Boot L loader mark in the operation mark area is 0.
Preferably, the system further comprises:
and the third running module is used for running the program in the application program area when the upgrading mark in the running mark area is 0.
Preferably, the system further comprises:
the fourth judging module is used for judging whether an upgrading request is received or not;
the fourth setting module is used for setting the upgrading mark in the operation mark area to be 1 when an upgrading request is received;
the return module is further configured to return to operate the program in the start program area again.
Preferably, the system further comprises:
and the second updating module is used for erasing the flash area of the application program and writing a new application program code when the upgrading area is the flash area of the application program.
In summary, the invention discloses a method for self-upgrading a Boot L loader, when automatic upgrading of a Boot L loader is required, firstly, a program in a Boot starting program area is operated, then whether a Boot L loader flag in an operation flag area is 0 or 1 is judged, when a Boot L loader flag in the operation flag area is 1, codes in a backup Boot L2 loader program area are copied to a normal Boot L loader program area, after code copying is completed, a Boot L4 loader flag in the operation flag area is set to 0, a program in the normal Boot L loader program area is operated, whether an upgrade flag in the operation flag area is 0 or 1 is judged, when the upgrade flag in the operation flag area is 1, whether the upgrade area is a Boot 6348 loader area and/or an application program area is set to 0 or 1, when the upgrade flag in the operation flag area is 1, whether the upgrade area is a Boot 638 loader area or an application program area, when the upgrade flag in the operation flag area is 1, the upgrade area is set to a Boot 638 Boot loader area, the Boot 638 loader area, when the Boot loader area is written to the Boot loader area, the Boot loader flag area is set to a code loader area, the Boot 638, the Boot loader area, when the Boot loader area is written to the Boot loader area, the Boot 858, the Boot loader area, the Boot 856 loader area, the Boot loader area is set to the Boot loader area, the Boot loader area is set to the Boot loader area, the Boot 856 area, the Boot loader area of the Boot loader.
Drawings
In order to more clearly illustrate the embodiments of the present invention 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 following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method of Boot L loader self-upgrading according to embodiment 1 of the present invention;
FIG. 2 is a flowchart of a Boot L loader self-upgrading method according to embodiment 2 of the present invention;
fig. 3 is a schematic structural diagram of a Boot L loader self-upgrading system embodiment 1 disclosed in the present invention;
fig. 4 is a schematic structural diagram of a Boot L loader self-upgrading system embodiment 2 disclosed in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of 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 invention.
As shown in fig. 1, a flowchart of a method of embodiment 1 of a Boot L loader self-upgrading method disclosed by the present invention is applied to an electronic control unit, a programmable storage area of the electronic control unit is divided into an operation flag area, a start Boot program area, a normal Boot L loader program area, a backup Boot L loader program area, and an application program area, and the method may include the following steps:
s101, running a program in a starting program area;
when the self-upgrade of the Boot L loader needs to be realized, a programmable storage area of the electronic control unit is divided into an operation mark area, a starting program area, a normal Boot L loader program area, a backup Boot L loader program area and an application program area, and after the electronic control unit is powered on and started, a program in the starting program area is operated firstly.
S102, judging whether a Boot L loader mark in the operation mark area is 0 or 1;
when a program in a program starting area is operated, checking a mark in an operation mark area, and judging whether a Boot L loader mark in the operation mark area is 0 or 1, wherein when the Boot L loader mark is 0, the Boot L loader is not represented to be updated, and when the Boot L loader mark is 1, the Boot L loader is represented to be updated.
S103, when the Boot L loader mark in the operation mark area is 1, copying codes in the backup Boot L loader program area to a normal Boot L loader program area;
when the Boot L loader flag in the operation flag area is 1, that is, when a Boot L loader needs to be updated, copying codes in the backup Boot L loader program area to a normal Boot L loader program area, wherein the codes in the backup Boot L loader program area are Boot L loader program codes which need to be updated.
S104, after the code copying is finished, setting a Boot L loader mark in the operation mark area to be 0;
after copying codes in a backup Boot L loader program area to a normal Boot L loader program area, setting a Boot L loader flag in an operation flag area from 1 to 0, and representing that no Boot L loader needs to be updated at this time.
S105, running a program in a normal Boot L loader program area;
after copying codes in a backup Boot L loader program area to a normal Boot L loader program area and setting a Boot L loader flag in an operation flag area to 0, jumping to the normal Boot L loader program area and operating programs in the normal Boot L loader program area, wherein the updated Boot L loader program codes take effect.
S106, judging whether the upgrading mark in the operation mark area is 0 or 1;
when the program in the normal Boot L loader program area is operated, further checking the mark in the operation mark area, and judging whether the upgrading mark in the operation mark area is 0 or 1, wherein the upgrading mark is 0, which indicates that the electronic control unit has no upgrading requirement, and the upgrading mark is 1, which indicates that the electronic control unit has upgrading requirement.
S107, when the upgrading mark in the operation mark area is 1, judging whether the upgrading area is a flash area of Boot L loader and/or a flash area of the application program;
when the upgrading mark in the operation mark area is 1, namely when the electronic control unit has upgrading requirements, whether the upgrading area is a flash area of a Boot L loader and/or a flash area of an application program is further judged, when the upgrading area is the flash area of the Boot L loader, it is indicated that the Boot L loader needs to be upgraded, and when the upgrading area is the flash area of the application program, it is indicated that the application program needs to be upgraded.
S108, when the upgrading area is a flash area of a Boot L loader, erasing the flash area of a backup Boot L loader program area, and writing a new Boot L loader program code;
when the upgrading area is a flash area of a Boot L loader, erasing the flash area of a backup Boot L loader program area, and writing new Boot L loader program codes into the flash area of the backup Boot L loader program area after the erasing.
S109, setting a Boot L loader flag in the operation flag area to be 1;
after writing new Boot L loader program codes into a flash area erased from a backup Boot L loader program area, further setting a Boot L loader flag in an operation flag area to be 1, wherein the Boot L loader flag is 1, and the fact that the Boot L loader needs to be updated is represented.
And S110, setting the upgrading flag in the operation flag area to be 0, and returning to execute the step S101 again.
And writing the new Boot L loader program code into a flash area erased by the backup Boot L loader program area, further setting an upgrading mark in the operation mark area to be 0, wherein the upgrading mark is 0, and the electronic control unit is represented to have no upgrading requirement.
After the Boot L loader flag in the operation flag area is set to 1 and the upgrade flag in the operation flag area is set to 0, the electronic control unit is reset and restarted, the program in the start program area is operated again, and the corresponding Boot L loader upgrade operation is executed.
In summary, in the above embodiments, when it is necessary to automatically upgrade a Boot L loader, a program in a Boot start program area is first run, then it is determined whether a Boot L loader flag in an operation flag area is 0 or 1, when a Boot L loader flag in the operation flag area is 1, a code in a backup Boot L loader program area is copied to a normal Boot L loader program area, after the code copying is completed, a Boot L3 loader flag in the operation flag area is set to 0, a program in the normal Boot L loader program area is run, it is determined whether an upgrade flag in the operation flag area is 0 or 1, when an upgrade flag in the operation flag area is 1, it is determined whether an upgrade area is a flash area of a Boot L loader and/or a flash area of an application program, when an upgrade area is a Boot L loader, when an upgrade flag in the operation flag area is 1, it is determined whether the upgrade area is a flash area of a Boot L loader and/or an application program Boot loader area is set to a flash area of a backup port 638, when an upgrade area is a Boot 366 loader area, a Boot loader flag area is set to a Boot L, a code is written to a code area of a backup Boot 638, and when an upgrade flag area is written to a code is written to a new Boot loader area, a Boot loader area of a Boot 638, a Boot loader area, and a backup Boot loader area, a backup Boot loader area of a backup Boot loader area, and a backup Boot loader area of a backup Boot 638, and a backup Boot loader area is written to a backup Boot 638, and a backup Boot loader area of a backup Boot 638, and a backup Boot loader area of a backup.
As shown in fig. 2, a flowchart of a method embodiment 2 of the Boot L loader self-upgrading disclosed by the present invention is a method, which is applied to an electronic control unit, where a programmable storage area of the electronic control unit is divided into an operation flag area, a start Boot program area, a normal Boot L loader program area, a backup Boot L loader program area, and an application program area, and the method may include the following steps:
s201, running a program in a starting program area;
when the self-upgrade of the Boot L loader needs to be realized, a programmable storage area of the electronic control unit is divided into an operation mark area, a starting program area, a normal Boot L loader program area, a backup Boot L loader program area and an application program area, and after the electronic control unit is powered on and started, a program in the starting program area is operated firstly.
S202, judging whether a Boot L loader mark in the operation mark area is 0 or 1;
when a program in a program starting area is operated, checking a mark in an operation mark area, and judging whether a Boot L loader mark in the operation mark area is 0 or 1, wherein when the Boot L loader mark is 0, the Boot L loader is not represented to be updated, and when the Boot L loader mark is 1, the Boot L loader is represented to be updated.
S203, when the Boot L loader mark in the operation mark area is 0, jumping to the step S206;
when the Boot L loader flag in the operation flag area is 0, that is, when no Boot L loader needs to be updated, directly jumping to the normal Boot L loader program area, and operating the program in the normal Boot L loader program area.
S204, when the Boot L loader mark in the operation mark area is 1, copying codes in the backup Boot L loader program area to a normal Boot L loader program area;
when the Boot L loader flag in the operation flag area is 1, that is, when a Boot L loader needs to be updated, copying codes in the backup Boot L loader program area to a normal Boot L loader program area, wherein the codes in the backup Boot L loader program area are Boot L loader program codes which need to be updated.
S205, after the code copying is finished, setting a Boot L loader mark in the operation mark area to be 0;
after copying codes in a backup Boot L loader program area to a normal Boot L loader program area, setting a Boot L loader flag in an operation flag area from 1 to 0, and representing that no Boot L loader needs to be updated at this time.
S206, running a program in a normal Boot L loader program area;
when a program in the normal Boot L loader program area is run, the program in the current normal Boot L loader program area is directly run, when the Boot L loader flag in the running flag area is judged to be 0, and when the Boot L1 loader flag in the running flag area is judged to be 1, the code in the backup Boot L2 loader program area is copied to the normal Boot L loader program area, and the Boot L loader flag in the running flag area is set to be 0, the program in the normal Boot L loader program area is run, and at this time, because the code in the backup Boot L loader program area is copied to the normal Boot L loader area, the updated Boot code L loader code is run, namely, the code in the normal Boot 632 loader program area is valid when the Boot loader flag in the normal Boot L loader area is set to be 0.
S207, judging whether the upgrading mark in the operation mark area is 0 or 1;
when the program in the normal Boot L loader program area is operated, further checking the mark in the operation mark area, and judging whether the upgrading mark in the operation mark area is 0 or 1, wherein the upgrading mark is 0, which indicates that the electronic control unit has no upgrading requirement, and the upgrading mark is 1, which indicates that the electronic control unit has upgrading requirement.
S208, when the upgrading mark in the running mark area is 0, running the program in the application program area;
when the upgrade flag in the operation flag area is 0, that is, when the electronic control unit has no upgrade demand, the program in the application program area is directly operated.
S209, judging whether an upgrading request is received, if so, entering S210:
when the program in the application program area is operated, whether an upgrade request is received is further judged.
S210, setting an upgrading flag in the operation flag area to be 1, and returning to execute the step S201 again;
and when an upgrading request is received, setting the upgrading flag in the operation flag area to be 1, carrying out soft reset restarting on the electronic control unit, operating the program in the starting program area again, and executing corresponding upgrading operation.
S211, when the upgrading mark in the operation mark area is 1, judging whether the upgrading area is a flash area of Boot L loader and/or a flash area of an application program;
when the upgrading mark in the operation mark area is 1, namely when the electronic control unit has upgrading requirements, whether the upgrading area is a flash area of a Boot L loader and/or a flash area of an application program is further judged, when the upgrading area is the flash area of the Boot L loader, it is indicated that the Boot L loader needs to be upgraded, and when the upgrading area is the flash area of the application program, it is indicated that the application program needs to be upgraded.
S212, when the upgrading area is a flash area of a Boot L loader, erasing the flash area of a backup Boot L loader program area, and writing a new Boot L loader program code;
when the upgrading area is a flash area of a Boot L loader, erasing the flash area of a backup Boot L loader program area, and writing new Boot L loader program codes into the flash area of the backup Boot L loader program area after the erasing.
S213, setting a Boot L loader flag in the operation flag area to be 1;
after writing new Boot L loader program codes into a flash area erased from a backup Boot L loader program area, further setting a Boot L loader flag in an operation flag area to be 1, wherein the Boot L loader flag is 1, and the fact that the Boot L loader needs to be updated is represented.
S214, when the upgrading area is the flash area of the application program, erasing the flash area of the application program, and writing a new application program code;
and when the upgrading area is the flash area of the application program, erasing the flash area of the application program, and writing a new application program code into the flash area after the application program is erased, so that the application program is further updated.
S215, the upgrading flag in the operation flag area is set to be 0, and the step S201 is executed again.
After writing new Boot L loader program codes into a flash area erased in a backup Boot L loader program area, or after writing new application program codes into a flash area erased in an application program area, further setting an upgrade flag in an operation flag area to be 0, wherein the upgrade flag is 0, and the electronic control unit is represented to have no upgrade requirement.
After the upgrading flag in the operation flag area is set to 0, the electronic control unit is reset and restarted, the program in the starting program area is operated again, and corresponding upgrading operation is executed.
In summary, in this embodiment, based on the above embodiment, when the Boot L loader flag in the running flag area is 0, the method jumps to the program in the normal Boot L loader program area, when the upgrade flag in the running flag area is 0, runs the program in the application program area, determines whether an upgrade request is received, if so, sets the upgrade flag in the running flag area to 1, returns to run the program in the starting program area again, and when the upgrade area is the flash area of the application program, can erase the flash area of the application program and write a new application program code, that is, update the application program.
As shown in fig. 3, a schematic structural diagram of an embodiment 1 of a system for Boot L loader self-upgrade disclosed by the present invention is a system, where the system is applied to an electronic control unit, a programmable storage area of the electronic control unit is divided into an operation flag area, a start-up program area, a normal Boot L loader program area, a backup Boot L loader program area, and an application program area, and the system may include:
a first running module 301, configured to run a program in the start-up program area;
a first determining module 302, configured to determine whether a Boot L loader flag in the operation flag area is 0 or 1;
a copying module 303, configured to copy, when a Boot L loader flag in the running flag area is 1, a code in the backup Boot L loader program area to the normal Boot L loader program area;
a first setting module 304, configured to set a Boot L loader flag in the running flag area to 0 after the code copying is completed;
a second running module 305, configured to run a program in a normal Boot L loader program area;
a second determination module 306, configured to determine whether an upgrade flag in the operation flag area is 0 or 1;
a third judging module 307, configured to, when the upgrade flag in the operation flag area is 1, judge whether the upgrade area is a flash area of the Boot L loader and/or a flash area of the application program;
the first updating module 308 is configured to erase a flash area of a Boot L loader program area and write new Boot L loader program codes when the upgrade area is the flash area of the Boot L loader;
a second setting module 309, configured to set a Boot L loader flag in the operation flag area to 1;
a third setting module 310, configured to set the upgrade flag in the running flag area to 0, and return to running the program in the start-up program area again through a returning module 311.
The working principle of the Boot L loader self-upgrading system disclosed in this embodiment is the same as that of the Boot L loader self-upgrading method embodiment 1, and is not described herein again.
As shown in fig. 4, a schematic structural diagram of an embodiment 2 of a system for Boot L loader self-upgrade disclosed by the present invention is a system, where the system is applied to an electronic control unit, a programmable storage area of the electronic control unit is divided into an operation flag area, a start-up program area, a normal Boot L loader program area, a backup Boot L loader program area, and an application program area, and the system may include:
a first running module 401 for running the program in the start starting program area
A first determining module 402, configured to determine whether a Boot L loader flag in the operation flag area is 0 or 1;
a skip module 403, configured to skip to the second running module 406 when the Boot L loader flag in the running flag area is 0;
a copy module 404, configured to copy, when a Boot L loader flag in the running flag area is 1, a code in the backup Boot L loader program area to the normal Boot L loader program area;
a first setting module 405, configured to set a Boot L loader flag in the running flag area to 0 after the code copying is completed;
a second running module 406, configured to run a program in a normal Boot L loader program area;
a second judging module 407, configured to judge whether the upgrade flag in the operation flag area is 0 or 1;
a third running module 408, configured to run the program in the application program area when the upgrade flag in the running flag area is 0;
a fourth judging module 409, configured to judge whether an upgrade request is received;
a fourth setting module 410, configured to set the upgrade flag in the operation flag area to 1 when the upgrade request is received, and return to the first operation module 401 through the returning module 416;
a third determining module 411, configured to determine, when the upgrade flag in the operation flag area is 1, whether the upgrade area is a flash area of the Boot L loader and/or a flash area of the application program;
the first updating module 412 is configured to erase a flash area of a backup Boot L loader program area and write new Boot L loader program codes when the upgrade area is the flash area of the Boot L loader;
a second setting module 413, configured to set a Boot L loader flag in the operation flag area to 1;
a second updating module 414, configured to erase the flash area of the application program and write a new application program code when the upgrade area is the flash area of the application program;
a third setting module 415, configured to set the upgrade flag in the operation flag area to 0, and return to the first operation module 401 through the return module 416.
The working principle of the Boot L loader self-upgrading system disclosed in this embodiment is the same as that of the Boot L loader self-upgrading method embodiment 1, and is not described herein again.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A Boot L loader self-upgrading method is applied to an electronic control unit, a programmable storage area of the electronic control unit is divided into an operation mark area, a starting program area, a normal Boot L loader program area, a backup Boot L loader program area and an application program area, and the method comprises the following steps:
running the program in the starting program area;
judging whether a Boot L loader mark in the operation mark area is 0 or 1;
when the Boot L loader mark in the operation mark area is 1, copying codes in a backup Boot L loader program area to a normal Boot L loader program area;
after the code copying is finished, setting a Boot L loader flag in the operation flag area to be 0;
running the program in the normal Boot L loader program area;
judging whether an upgrading mark in the operation mark area is 0 or 1;
when the upgrading mark in the operation mark area is 1, judging whether the upgrading area is a flash area of Boot L loader and/or a flash area of an application program;
when the upgrading area is a flash area of a Boot L loader, erasing the flash area of a backup Boot L loader program area, and writing a new Boot L loader program code;
setting a Boot L loader flag in the operation flag area to 1;
setting an upgrade flag in the operation flag region to 0;
and returning to run the program in the starting startup program area again.
2. The method of claim 1, further comprising:
and when the Boot L loader flag in the operation flag area is 0, jumping to the program in the normal Boot L loader program area.
3. The method of claim 2, further comprising:
when the upgrade flag in the run flag area is 0, the program in the application program area is run.
4. The method of claim 3, further comprising:
judging whether an upgrade request is received, if so, then:
setting an upgrade flag in the operation flag region to 1;
and returning to run the program in the starting startup program area again.
5. The method of claim 1, further comprising:
and when the upgrading area is the flash area of the application program, erasing the flash area of the application program and writing a new application program code.
6. A Boot L loader self-upgrading system is applied to an electronic control unit, a programmable storage area of the electronic control unit is divided into an operation mark area, a starting program area, a normal Boot L loader program area, a backup Boot L loader program area and an application program area, and the system comprises:
the first running module is used for running the program in the starting program area;
the first judgment module is used for judging whether a Boot L loader mark in the operation mark area is 0 or 1;
a copy module, configured to copy, when the Boot L loader flag in the operation flag area is 1, a code in the backup Boot L loader program area to a normal Boot L loader program area;
the first setting module is used for setting a Boot L loader flag in the running flag area to 0 after the code copying is finished;
the second running module is used for running the programs in the normal Boot L loader program area;
the second judgment module is used for judging whether the upgrading mark in the operation mark area is 0 or 1;
a third judging module, configured to, when the upgrade flag in the operation flag area is 1, judge whether the upgrade area is a flash area of the Boot L loader and/or a flash area of the application program;
the first updating module is used for erasing a flash area of a Boot L loader program area and writing a new Boot L loader program code when the upgrading area is the flash area of the Boot L loader;
the second setting module is used for setting a Boot L loader flag in the operation flag area to be 1;
the third setting module is used for setting the upgrading mark in the operation mark area to be 0;
and the return module is used for returning to operate the program in the starting program area again.
7. The system of claim 6, further comprising:
and the jump module is used for jumping to a program in the program area of the normal Boot L loader when the Boot L loader mark in the operation mark area is 0.
8. The system of claim 7, further comprising:
and the third running module is used for running the program in the application program area when the upgrading mark in the running mark area is 0.
9. The system of claim 8, further comprising:
the fourth judging module is used for judging whether an upgrading request is received or not;
the fourth setting module is used for setting the upgrading mark in the operation mark area to be 1 when an upgrading request is received;
the return module is further configured to return to operate the program in the start program area again.
10. The system of claim 6, further comprising:
and the second updating module is used for erasing the flash area of the application program and writing a new application program code when the upgrading area is the flash area of the application program.
CN202010231994.3A 2020-03-27 2020-03-27 BootLoader self-upgrading method and system Active CN111459508B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010231994.3A CN111459508B (en) 2020-03-27 2020-03-27 BootLoader self-upgrading method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010231994.3A CN111459508B (en) 2020-03-27 2020-03-27 BootLoader self-upgrading method and system

Publications (2)

Publication Number Publication Date
CN111459508A true CN111459508A (en) 2020-07-28
CN111459508B CN111459508B (en) 2023-12-01

Family

ID=71685731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010231994.3A Active CN111459508B (en) 2020-03-27 2020-03-27 BootLoader self-upgrading method and system

Country Status (1)

Country Link
CN (1) CN111459508B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112261089A (en) * 2020-09-28 2021-01-22 中国科学院沈阳自动化研究所 Method and device for remotely upgrading program of underwater glider
CN112631625A (en) * 2020-11-20 2021-04-09 展讯通信(上海)有限公司 System upgrading method and device of embedded equipment and embedded equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360877A (en) * 2014-10-24 2015-02-18 同济大学 ECU (electronic control unit) firmware updating method based on Bootloader self update
CN105511929A (en) * 2015-12-31 2016-04-20 青岛高校信息产业股份有限公司 Remote wireless upgrading method for equipment
CN106569847A (en) * 2016-10-14 2017-04-19 数源科技股份有限公司 Method for realizing IAP remote upgrade through vehicle-mounted system based on mobile network
CN106933641A (en) * 2017-05-16 2017-07-07 江苏新安电器有限公司 A kind of scm software is from upgrade method and system
WO2018120213A1 (en) * 2016-12-30 2018-07-05 深圳配天智能技术研究院有限公司 Firmware updating method and controller
CN109582372A (en) * 2018-11-12 2019-04-05 青岛海信电器股份有限公司 A kind of starting method and device of system
CN109933348A (en) * 2019-01-21 2019-06-25 宁波普瑞均胜汽车电子有限公司 The update method and device of Bootloader in a kind of electronic control unit
CN109992280A (en) * 2017-12-29 2019-07-09 深圳市优必选科技有限公司 Method for upgrading embedded software, terminal device and storage device
CN110532014A (en) * 2019-08-20 2019-12-03 海信(广东)空调有限公司 Program upgrading method and device, terminal equipment and computer readable storage medium
CN110618825A (en) * 2019-08-02 2019-12-27 惠州市德赛西威汽车电子股份有限公司 Self-updating method for Boot Loader of car machine

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360877A (en) * 2014-10-24 2015-02-18 同济大学 ECU (electronic control unit) firmware updating method based on Bootloader self update
CN105511929A (en) * 2015-12-31 2016-04-20 青岛高校信息产业股份有限公司 Remote wireless upgrading method for equipment
CN106569847A (en) * 2016-10-14 2017-04-19 数源科技股份有限公司 Method for realizing IAP remote upgrade through vehicle-mounted system based on mobile network
WO2018120213A1 (en) * 2016-12-30 2018-07-05 深圳配天智能技术研究院有限公司 Firmware updating method and controller
CN106933641A (en) * 2017-05-16 2017-07-07 江苏新安电器有限公司 A kind of scm software is from upgrade method and system
CN109992280A (en) * 2017-12-29 2019-07-09 深圳市优必选科技有限公司 Method for upgrading embedded software, terminal device and storage device
CN109582372A (en) * 2018-11-12 2019-04-05 青岛海信电器股份有限公司 A kind of starting method and device of system
CN109933348A (en) * 2019-01-21 2019-06-25 宁波普瑞均胜汽车电子有限公司 The update method and device of Bootloader in a kind of electronic control unit
CN110618825A (en) * 2019-08-02 2019-12-27 惠州市德赛西威汽车电子股份有限公司 Self-updating method for Boot Loader of car machine
CN110532014A (en) * 2019-08-20 2019-12-03 海信(广东)空调有限公司 Program upgrading method and device, terminal equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王毅: "BootLoader 跳转程序设计及CANBootLoader 实现", pages 63 - 65 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112261089A (en) * 2020-09-28 2021-01-22 中国科学院沈阳自动化研究所 Method and device for remotely upgrading program of underwater glider
CN112631625A (en) * 2020-11-20 2021-04-09 展讯通信(上海)有限公司 System upgrading method and device of embedded equipment and embedded equipment
CN112631625B (en) * 2020-11-20 2022-10-21 展讯通信(上海)有限公司 System upgrading method and device for embedded equipment and embedded equipment

Also Published As

Publication number Publication date
CN111459508B (en) 2023-12-01

Similar Documents

Publication Publication Date Title
CN110231952B (en) ECU program backup and cyclic upgrade control method and device
KR100506203B1 (en) Booting and boot code update method and system thereof
CN109933348B (en) Method and device for updating Bootloader in electronic control unit
WO2022007656A1 (en) Bootloader software updating method and apparatus, embedded controller, and storage medium
JP3838840B2 (en) Computer
CN109358887B (en) On-line upgrading method, device and system for single chip microcomputer program
US20100058316A1 (en) Updating Firmware with Multiple Processors
CN111459508A (en) Boot L loader self-upgrading method and system
CN106020861A (en) FOTA upgrading method and system for smart watch
CN109408122B (en) Equipment starting method, electronic equipment and computer storage medium
CN110874237A (en) Software upgrading method, device, terminal and readable storage medium
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN115061713A (en) Method and device for upgrading electronic equipment
CN110597532A (en) Data acquisition module, firmware upgrading method thereof and storage medium
CN105677416A (en) Uboot upgrading control system and method
CN115686554A (en) BootLoader program upgrading method and device
KR100762618B1 (en) The method and system of upgrading firmware upgrade engine of mobile terminal
US7075518B2 (en) Method for updating a keyboard controller in a notebook computer
CN107247642B (en) Method and device for determining executable mapping file during system startup
KR100876748B1 (en) Method for updating boot code
JP2006252278A (en) Microcomputer
CN113064608A (en) OTA (over the air) upgrading method, device, equipment and medium
CN115480795A (en) Method and system for upgrading vehicle-mounted ECU (electronic control Unit) supporting sleep function
CN116560696A (en) Singlechip partition with high application data duty ratio and firmware upgrading method
CN117149230A (en) Vehicle-mounted electronic control unit software upgrading method with rollback and backup functions

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 4 / F, building 1, No.14 Jiuxianqiao Road, Chaoyang District, Beijing 100020

Applicant after: Beijing Jingwei Hirain Technologies Co.,Inc.

Address before: 8 / F, block B, No. 11, Anxiang Beili, Chaoyang District, Beijing 100101

Applicant before: Beijing Jingwei HiRain Technologies Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant