CN111273928A - Self-upgrading bootloader design method - Google Patents
Self-upgrading bootloader design method Download PDFInfo
- Publication number
- CN111273928A CN111273928A CN202010060383.7A CN202010060383A CN111273928A CN 111273928 A CN111273928 A CN 111273928A CN 202010060383 A CN202010060383 A CN 202010060383A CN 111273928 A CN111273928 A CN 111273928A
- Authority
- CN
- China
- Prior art keywords
- bootloader
- module
- upgrading
- firmware
- self
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000013461 design Methods 0.000 title claims abstract description 23
- 230000008439 repair process Effects 0.000 claims abstract description 7
- 238000012795 verification Methods 0.000 claims description 19
- 230000006870 function Effects 0.000 claims description 11
- 230000009191 jumping Effects 0.000 claims description 3
- 230000008569 process Effects 0.000 abstract description 25
- 230000009977 dual effect Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1417—Boot up procedures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/142—Reconfiguring to eliminate the error
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1433—Saving, restoring, recovering or retrying at system level during software upgrading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1438—Restarting or rejuvenating
Abstract
The invention relates to a self-elevating bootloader device and a design method thereof, wherein the design method comprises the following steps: the system comprises a bootloader module, a bootloader configuration module and a guide module; the bootloader module comprises: the system comprises a first bootloader module and a second bootloader module, wherein the second bootloader module is a backup module of the first bootloader module; the bootloader configuration module is used for storing the parameter information of the bootloader module; the guide module is used for checking the integrity and the legality of the bootloader module and repairing the bootloader module. The invention can automatically repair and restore normal work when encountering abnormity in the upgrading process or the bootloader module is damaged in the using process, thereby ensuring the safety and reliability of the program starting and upgrading process.
Description
Technical Field
The invention relates to the field of embedded electronic products, in particular to a self-upgrading bootloader device and a design method thereof.
Background
At present, most embedded electronic products have a bootloader function, and are used for online upgrading of firmware, so that new features are quickly added to the products or potential bugs are repaired in an online upgrading mode. In most cases, the bootloader function is single, and only the firmware is upgraded, and in many application scenarios, the bootloader itself needs to be upgraded to support some new features and new functions, for example, the original single bank firmware upgrade mode is changed into the dual bank firmware upgrade mode.
Based on this, engineers design various bootloader devices or programs capable of self-upgrading, but these designs all have obvious defects, and often the problems that the programs cannot be started normally due to the damage of bootloader modules, or the application programs of embedded products cannot be loaded due to sudden power failure in the upgrading process, the online upgrading fails, and the like.
The existing solution has the following disadvantages:
1, the bootloader module is damaged to cause that the program can not be started normally;
2. and the sudden power failure in the upgrading process causes that the application program of the embedded product cannot be loaded and the online upgrading fails.
Disclosure of Invention
The invention aims to solve the technical problems that in the existing design, a program cannot be normally started due to damage of a bootloader module, or an application program of an embedded product cannot be loaded and online upgrading fails due to sudden power failure in the upgrading process.
The technical scheme adopted by the invention for solving the technical problems is as follows: a self-upgrading bootloader device and a design method are constructed, the self-upgrading function of the bootloader module is realized by adopting a combination mode of a guide module, a bootloader dual module and a bootloader configuration module, and meanwhile, when the upgrading fails due to special conditions such as abnormity, power failure and the like in the upgrading process or the bootloader module is damaged in the using process, the self-repairing bootloader device can automatically restore and recover normal work, so that the safety and reliability of program starting and the upgrading process are ensured.
In the bootloader device of the invention, the bootloader device comprises: the system comprises a bootloader module, a bootloader configuration module and a guide module;
the bootloader module comprises: the system comprises a first bootloader module and a second bootloader module, wherein the second bootloader module is a backup module of the first bootloader module;
the bootloader configuration module is used for storing the parameter information of the bootloader module;
the guide module is used for checking the integrity and the legality of the bootloader module and repairing the bootloader module.
In the bootloader device of the invention, the first bootloader module further comprises: and receiving an upgrading command and judging whether to upgrade the mobile terminal.
In the self-elevating bootloader device, the boot module, the first bootloader module and the second bootloader module are all independent executable firmware modules.
In the bootloader device of the self-elevating stage of the present invention, the parameter information of the bootloader module includes: version information, program size, valid flag, and check code.
In the bootloader device of the invention, the bootloader device also comprises the following functions: and judging whether the upgrade bootloader firmware is downloaded completely and whether errors occur, and sending a corresponding instruction according to a judgment result.
The design method of the self-upgrading bootloader comprises the following steps;
after the S1 device is powered on or reset, the program is executed from the guide module;
in a boot module, checking the integrity and the legality of a first bootloader module and a second bootloader module;
if the verification is qualified, the verification is successful, and if the verification is not qualified, the verification is failed;
s2, if the verification fails, executing the repair process, if the verification succeeds, jumping the program to the first bootloader module and executing the upgrade command;
s3, whether the first bootloader module is upgraded or not is judged in the first bootloader module, and if the judgment result is yes, the first bootloader module is upgraded;
and if the judgment result is negative, executing firmware upgrading or skipping the application program.
In the self-upgrading bootloader design method, if the first bootloader module judges whether to upgrade itself, the second bootloader module is erased, and then the parameters related to the second bootloader module in the bootloader configuration area are erased;
and then downloading and upgrading the bootloader firmware, judging whether the downloading is completed or has errors in real time, and verifying the integrity and the legality of the first bootloader module and the second bootloader module.
In the self-upgrading bootloader design method, if the firmware of the upgrading bootloader is wrongly downloaded and is not completely downloaded or the integrality or the legality of the first bootloader module and the second bootloader module is unqualified, the starting is restarted, and then the boot module is re-entered and the second bootloader module is repaired; otherwise, continuing downloading until the downloading is completed.
In the self-upgrading bootloader design method, after the upgrading bootloader firmware is downloaded, the parameters related to the second bootloader module in the bootloader configuration area are updated, and then the second bootloader module firmware is copied to the first bootloader module.
In the self-upgrading bootloader design method, parameters related to the first bootloader module in the bootloader configuration module are updated finally.
The bootloader device and the design method have the advantages that the bootloader device and the design method achieve the self-upgrade function of the bootloader module by adopting a combination mode of the guide module, the bootloader dual module and the bootloader configuration module, and meanwhile, when the upgrade fails due to special conditions such as abnormity and power failure in the upgrade process or the bootloader module is damaged in the use process, the bootloader device can automatically repair and restore normal work, so that the safety and reliability of program starting and the upgrade process are ensured.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a schematic view of a self-elevating bootloader device and design method according to the present invention;
FIG. 2 is a self-upgrade flow diagram of a bootloader module of a self-upgrade bootloader device and design method of the present invention;
fig. 3 is a schematic diagram of a verification and self-repair process of a self-elevating bootloader device and a design method according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, a bootloader device of a self-elevating stage includes: the system comprises a bootloader module, a bootloader configuration module and a guide module;
the bootloader module comprises: the system comprises a first bootloader module and a second bootloader module, wherein the second bootloader module is a backup module of the first bootloader module;
the bootloader configuration module is used for storing the parameter information of the bootloader module;
the guide module is used for checking the integrity and the legality of the bootloader module and repairing the bootloader module.
Further, bootloader refers to: a piece of applet that runs before the operating system kernel runs. Through the small program, hardware equipment can be initialized, and a mapping chart of a memory space is established, so that the software and hardware environment of the system is brought to a proper state, and a correct environment is prepared for finally calling an operating system kernel.
Further, the first bootloader module further functions to: and receiving an upgrading command and judging whether to upgrade the mobile terminal.
Further, the boot module, the first bootloader module and the second bootloader module are all independent executable firmware modules.
Further, the parameter information of the bootloader module includes: version information, program size, valid flag, and check code.
Further, the following functions are also included: and judging whether the upgrade bootloader firmware is downloaded completely and whether errors occur, and sending a corresponding instruction according to a judgment result.
As shown in fig. 2, a self-upgraded bootloader design method includes the following steps;
after the S1 device is powered on or reset, the program is executed from the guide module;
in a boot module, checking the integrity and the legality of a first bootloader module and a second bootloader module;
if the verification is qualified, the verification is successful, and if the verification is not qualified, the verification is failed;
s2, if the verification fails, executing the repair process, if the verification succeeds, jumping the program to the first bootloader module and executing the upgrade command;
s3, whether the first bootloader module is upgraded or not is judged in the first bootloader module, and if the judgment result is yes, the first bootloader module is upgraded;
and if the judgment result is negative, executing firmware upgrading or skipping the application program.
Further, if the first bootloader module judges whether to upgrade itself, the second bootloader module is erased, and then parameters related to the second bootloader module in the bootloader configuration area are erased;
and then downloading and upgrading the bootloader firmware, judging whether the downloading is completed or has errors in real time, and verifying the integrity and the legality of the first bootloader module and the second bootloader module.
Furthermore, if the upgrading bootloader firmware is wrongly downloaded and is not downloaded completely or the integrality or the legality of the first bootloader module and the second bootloader module is unqualified, restarting immediately, then reentering the boot module and repairing the second bootloader module; otherwise, continuing downloading until the downloading is completed.
Furthermore, after the bootloader firmware is upgraded and downloaded, the parameters related to the second bootloader module in the bootloader configuration area are updated, and then the second bootloader module firmware is copied to the first bootloader module.
Furthermore, the parameters related to the first bootloader module in the bootloader configuration module are updated finally, and the whole self-generation process is completed completely.
Furthermore, it should be noted that, in the whole upgrading process, a complete bootloader module and parameters of its related bootloader configuration module are always maintained, so that when an abnormal condition occurs in any link, another damaged or destroyed bootloader module can be repaired based on the complete bootloader module, thereby ensuring the safety and reliability of the whole upgrading process.
As shown in fig. 3, if the first bootloader module is damaged in the upgrading process, and if the power is lost in the midway, when the power is re-turned on, the first bootloader module is judged to be damaged and the second bootloader module is normal by combining the parameters stored in the configuration area and the calculated check parameters of the first bootloader module or the second bootloader module, at this time, the firmware of the second bootloader module is copied into the first bootloader module, and meanwhile, the related parameters of the first bootloader module in the configuration area are modified, so that the repair of the damaged area is completed.
The second bootloader module is assumed to be damaged in the upgrading process, and the same operation as that performed when the first bootloader module is assumed to be damaged in the upgrading process is performed.
Furthermore, a combined mode of the boot module, the first bootloader module, the second bootloader module and the bootloader configuration module is adopted, so that the self-upgrade function of the boot loader module is realized, and meanwhile, when the upgrade fails due to special conditions such as abnormity and power failure in the upgrade process or the bootloader module is damaged in the use process, the self-repair and normal work recovery can be realized, and the safety and reliability of the program starting and the upgrade process are ensured.
Furthermore, a combination mode of a guide module, a first bootloader module, a second bootloader module and a bootloader configuration module is adopted, so that a safe self-upgrade bootloader is realized. The boot module, the first bootloader module and the second bootloader module are all independently operable firmware areas, and the boot areas are used for verifying the integrity and the legality of the bootloader modules and repairing damaged modules; the second bootloader module is a backup module of the first bootloader module, and codes are completely the same; the bootloader configuration module is used for storing parameter information related to the first bootloader module and the second bootloader module.
The invention provides a self-upgrading bootloader device and a design method thereof, which realize the self-upgrading function of a bootloader module by adopting a combination mode of a guide module, a bootloader dual module and a bootloader configuration module, and can automatically repair and recover normal work when the upgrading fails due to special conditions such as abnormity, power failure and the like in the upgrading process or the bootloader module is damaged in the using process, thereby ensuring the safety and reliability of the program starting and the upgrading process.
Although the present invention has been described with reference to the above embodiments, the scope of the present invention is not limited thereto, and modifications, substitutions and the like of the above members are intended to fall within the scope of the claims of the present invention without departing from the spirit of the present invention.
Claims (10)
1. A self-elevating bootloader device, comprising: the system comprises a bootloader module, a bootloader configuration module and a guide module;
the bootloader module comprises: the system comprises a first bootloader module and a second bootloader module, wherein the second bootloader module is a backup module of the first bootloader module;
the bootloader configuration module is used for storing the parameter information of the bootloader module;
the boot module is used for checking the integrity and the legality of the bootloader module and repairing the bootloader module at the same time.
2. The bootloader device of claim 1, wherein said first bootloader module further comprises: and receiving an upgrading command and judging whether to upgrade the mobile terminal.
3. The self-elevating bootloader device according to claim 1, wherein said boot module, said first bootloader module and said second bootloader module are all independent executable firmware modules.
4. The bootloader device according to claim 1, wherein the parameter information of the bootloader module comprises: version information, program size, valid flag, and check code.
5. The bootloader device of claim 1, further comprising the following functions: and judging whether the upgrade bootloader firmware is downloaded completely and whether errors occur, and sending a corresponding instruction according to a judgment result.
6. A design method of a self-upgrading bootloader is characterized by comprising the following steps;
after the S1 device is powered on or reset, the program is executed from the guide module;
in the boot module, checking the integrity and the legality of the first bootloader module and the second bootloader module;
if the verification is qualified, the verification is successful, and if the verification is not qualified, the verification is failed;
s2, if the verification fails, executing the repair process, if the verification succeeds, jumping the program to the first bootloader module and executing the upgrade command;
s3, judging whether the first bootloader module is upgraded or not in the first bootloader module, and if so, upgrading the first bootloader module;
and if the judgment result is negative, executing firmware upgrading or skipping the application program.
7. The method as claimed in claim 6, wherein if the first bootloader module determines that the bootloader module is upgraded, the second bootloader module is erased, and then the parameters related to the second bootloader module in the bootloader configuration area are erased;
and then downloading the upgraded bootloader firmware, judging whether the downloading is completed or has errors in real time, and verifying the integrity and the legality of the first bootloader module and the second bootloader module.
8. The design method of the self-upgrading bootloader according to claim 7, wherein if the firmware of the upgrading bootloader is downloaded incorrectly or not completely, or the integrity or validity of the first bootloader module and the second bootloader module is not qualified, then restarting is performed, and then re-entering the boot module and repairing the second bootloader module; otherwise, continuing downloading until the downloading is completed.
9. The method of claim 8, wherein after the bootloader firmware is downloaded, the bootloader firmware is first updated to parameters related to the second bootloader module in the bootloader configuration area, and then the second bootloader module firmware is copied to the first bootloader module.
10. The method of claim 9, wherein the parameters related to the first bootloader module in the bootloader configuration module are updated last.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201921499176 | 2019-09-10 | ||
CN2019214991760 | 2019-09-10 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111273928A true CN111273928A (en) | 2020-06-12 |
CN111273928B CN111273928B (en) | 2024-02-27 |
Family
ID=70998890
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010060383.7A Active CN111273928B (en) | 2019-09-10 | 2020-01-19 | Bootloader design method for self-upgrading |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111273928B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112379932A (en) * | 2020-11-23 | 2021-02-19 | 歌尔科技有限公司 | Boot method and Boot device of electronic equipment and electronic equipment |
CN112948183A (en) * | 2021-03-30 | 2021-06-11 | 西安微电子技术研究所 | Software and hardware combined embedded device and method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102693139A (en) * | 2011-03-25 | 2012-09-26 | 比亚迪股份有限公司 | Method and system for wirelessly upgrading mobile phone software |
CN103995712A (en) * | 2014-04-16 | 2014-08-20 | 潍柴动力股份有限公司 | Boot loader device capable of updating automatically and updating method thereof |
CN106406955A (en) * | 2016-09-22 | 2017-02-15 | 深圳市金溢科技股份有限公司 | A method and a device for upgrades of a bootloader program in an RSU apparatus |
CN107608702A (en) * | 2017-10-25 | 2018-01-19 | 迈普通信技术股份有限公司 | Bootloader program modules update method and device |
DE102017125172A1 (en) * | 2017-10-26 | 2019-05-02 | Schréder S.A. | Method for updating a bootloader of a controller of a luminaire |
CN109857426A (en) * | 2018-12-27 | 2019-06-07 | 百度在线网络技术(北京)有限公司 | Bootloader method for updating program, device, electronic equipment and storage medium |
-
2020
- 2020-01-19 CN CN202010060383.7A patent/CN111273928B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102693139A (en) * | 2011-03-25 | 2012-09-26 | 比亚迪股份有限公司 | Method and system for wirelessly upgrading mobile phone software |
CN103995712A (en) * | 2014-04-16 | 2014-08-20 | 潍柴动力股份有限公司 | Boot loader device capable of updating automatically and updating method thereof |
CN106406955A (en) * | 2016-09-22 | 2017-02-15 | 深圳市金溢科技股份有限公司 | A method and a device for upgrades of a bootloader program in an RSU apparatus |
CN107608702A (en) * | 2017-10-25 | 2018-01-19 | 迈普通信技术股份有限公司 | Bootloader program modules update method and device |
DE102017125172A1 (en) * | 2017-10-26 | 2019-05-02 | Schréder S.A. | Method for updating a bootloader of a controller of a luminaire |
CN109857426A (en) * | 2018-12-27 | 2019-06-07 | 百度在线网络技术(北京)有限公司 | Bootloader method for updating program, device, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
董维宁: "嵌入式系统自更新机制的设计与应用", 《单片机与嵌入式系统应用》, no. 12, 31 December 2008 (2008-12-31), pages 63 - 65 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112379932A (en) * | 2020-11-23 | 2021-02-19 | 歌尔科技有限公司 | Boot method and Boot device of electronic equipment and electronic equipment |
CN112379932B (en) * | 2020-11-23 | 2023-05-23 | 歌尔科技有限公司 | Boot method and device of electronic equipment and electronic equipment |
CN112948183A (en) * | 2021-03-30 | 2021-06-11 | 西安微电子技术研究所 | Software and hardware combined embedded device and method |
CN112948183B (en) * | 2021-03-30 | 2023-05-12 | 西安微电子技术研究所 | Software and hardware combined embedded device and method |
Also Published As
Publication number | Publication date |
---|---|
CN111273928B (en) | 2024-02-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106775610B (en) | Electronic equipment starting method and electronic equipment | |
CN102298545B (en) | System startup boot processing method and device | |
US20100169709A1 (en) | System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware | |
CN108345464A (en) | A kind of the startup method and Android vehicle device of Android system | |
CN106897166B (en) | Mobile terminal and repairing method thereof | |
CN111273928B (en) | Bootloader design method for self-upgrading | |
CN111767172A (en) | Self-repairing method for set top box based on watchdog and bootloader | |
CN109634781A (en) | One kind is based on embedded program two-region Backup Images system and starting method | |
CN110806884A (en) | Method and device for repairing operating system fault | |
WO2015184732A1 (en) | Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium | |
CN115454469A (en) | Mirror image updating method and device, chip, electronic equipment and storage medium | |
CN105677409A (en) | System upgrading method and device | |
WO2018049798A1 (en) | Method and apparatus for reconstructing cache partition | |
CN110908722B (en) | Method and device applied to starting of operating system, electronic equipment and storage medium | |
CN113220319A (en) | Data updating method and device and vehicle | |
JP2005284902A (en) | Terminal device, control method and control program thereof, host device, control method and control program thereof, and method, system, and program for remote updating | |
WO2021012170A1 (en) | Firmware booting method and device, and computer-readable storage medium | |
CN111090443A (en) | Method, equipment and storage medium for guaranteeing safe upgrade of linux system | |
US9529581B2 (en) | Circuit and method for writing program codes of basic input/output system | |
CN106325912B (en) | The starting method and device of embedded OS | |
CN112394965B (en) | Battery management system upgrade and operation method, controller, battery management system and storage medium | |
CN112596749A (en) | Method and device for system power-on self-test and self-repair | |
CN112395130A (en) | System backup method and device | |
CN112667444A (en) | System upgrading method, storage medium and terminal equipment | |
CN111813597A (en) | Air conditioner |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |