CN107704258B - Uboot upgrading method, system and terminal equipment - Google Patents

Uboot upgrading method, system and terminal equipment Download PDF

Info

Publication number
CN107704258B
CN107704258B CN201711022505.8A CN201711022505A CN107704258B CN 107704258 B CN107704258 B CN 107704258B CN 201711022505 A CN201711022505 A CN 201711022505A CN 107704258 B CN107704258 B CN 107704258B
Authority
CN
China
Prior art keywords
uboot
starting
value
area
timer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711022505.8A
Other languages
Chinese (zh)
Other versions
CN107704258A (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.)
Shenzhen Hengyang Data Co ltd
Original Assignee
Shenzhen Hengyang Data 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 Shenzhen Hengyang Data Co ltd filed Critical Shenzhen Hengyang Data Co ltd
Priority to CN201711022505.8A priority Critical patent/CN107704258B/en
Publication of CN107704258A publication Critical patent/CN107704258A/en
Application granted granted Critical
Publication of CN107704258B publication Critical patent/CN107704258B/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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating

Abstract

The invention is suitable for the technical field of software upgrading, and provides a Uboot upgrading method, a system and terminal equipment. The Uboot upgrading method, the Uboot upgrading system and the terminal equipment provided by the invention can ensure normal starting of a product when the Uboot upgrading fails, reduce the complexity of hardware design and save the cost.

Description

Uboot upgrading method, system and terminal equipment
Technical Field
The invention belongs to the technical field of software upgrading, and particularly relates to a Uboot upgrading method, a system and terminal equipment.
Background
The Uboot (Universal Boot loader) is the most widely used open source bootstrap program at present, supports the Boot of most mainstream 32-bit hardware platforms and mainstream operating systems, has rich instructions and peripheral drivers, and can meet the requirements of most of the systems. Because the inside of the Uboot contains some hardware drivers, sometimes the Uboot driver of the product needs to be upgraded, or the Uboot is discovered to have a bug at a later stage, and needs to be upgraded, so as to enhance the stability of the system. However, if the upgrade fails, the whole product cannot be started, and the product cannot be used.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a system, and a terminal device for Uboot upgrade, so as to solve the problem in the prior art that a product cannot be started after a Uboot upgrade fails.
In order to solve the above problem, a first aspect of an embodiment of the present invention provides a Uboot upgrade method, including the following steps:
after the single board is powered on, a timer is started to start timing, and whether a Uboot start flag bit is established or not is detected.
And if the Uboot start flag bit is detected to be established, judging whether the value of the timing flag bit of the timer is a first preset value.
And if the value of the timing zone bit of the timer is not the first preset value, jumping to a first Uboot starting region or a second Uboot starting region in the storage module according to the value of the Uboot starting zone bit to start the Uboot.
And after the Uboot is started successfully, stopping timing by the timer, setting a timing zone bit of the timer to be a second preset numerical value, and modifying the value of the Uboot starting zone bit according to the area where the Uboot is started successfully.
And after the Uboot is started, detecting whether a Uboot upgrading instruction exists.
And if a Uboot upgrading instruction is detected, upgrading the Uboot program stored in the first Uboot starting area according to the Uboot upgrading instruction.
And detecting whether the Uboot program stored in the first Uboot startup area is upgraded successfully.
If the Uboot program stored in the first Uboot starting area is detected to be upgraded successfully, modifying the value of the Uboot starting zone bit to be a third preset value, re-executing the starting timer to start timing, and detecting whether the Uboot starting zone bit is established; and if the Uboot program stored in the first Uboot starting area is detected to be failed to be upgraded, quitting Uboot upgrading, and re-executing the step of detecting whether the Uboot upgrading instruction exists or not.
Further, the Uboot upgrade method further includes:
and if the Uboot start flag bit is not established, initializing the value of the Uboot start flag bit to be a fourth preset value, and jumping to a second Uboot start area to start the Uboot.
Further, the jumping to the first Uboot startup area or the second Uboot startup area in the storage module according to the value of the Uboot startup flag bit to perform Uboot startup includes:
and if the value of the Uboot startup zone bit is a third preset value, verifying whether the mirror image file in the first Uboot startup zone has an error.
And if the mirror image file in the first Uboot starting region is verified to have no error, jumping to the first Uboot starting region in the storage module to start the Uboot.
And if the mirror image file in the first Uboot starting region is verified to have errors, jumping to a second Uboot starting region in the storage module to start the Uboot.
And if the value of the Uboot start flag bit is a fifth preset value, jumping to a second Uboot start area in the storage module to start the Uboot.
Further, the modifying the value of the Uboot starting flag bit according to the area where the Uboot is successfully started includes:
and if the area in which the Uboot is successfully started is the first Uboot starting area, modifying the value of the Uboot starting zone bit into a third preset value.
And if the area in which the Uboot is successfully started is the second Uboot starting area, modifying the value of the Uboot starting zone bit to a fifth preset value.
Further, the Uboot upgrade method further includes:
and detecting whether the timing of the timer exceeds a preset time.
And if the timer is detected to be timed to exceed the preset time, setting the value of the timing zone bit of the timer to be a first preset value, re-executing the step of starting the timer to start timing and detecting whether the Uboot start zone bit is established.
A second aspect of an embodiment of the present invention provides a Uboot upgrade system, including:
and the power-on starting module is used for starting a timer to start timing after the single board is powered on and detecting whether the Uboot starting flag bit is established.
And the timing zone bit judging module is used for judging whether the value of the timing zone bit of the timer is a first preset value or not if the Uboot start zone bit is detected to be established.
And the starting region jumping module is used for jumping to a first Uboot starting region or a second Uboot starting region in the storage module according to the value of the Uboot starting zone bit to start the Uboot if the value of the timing zone bit of the timer is not the first preset numerical value.
And the starting zone bit modification module is used for stopping the timer for timing after the Uboot is started successfully, setting the timing zone bit of the timer to be a second preset numerical value, and modifying the value of the Uboot starting zone bit according to the area where the Uboot is started successfully.
And the upgrade instruction detection module is used for detecting whether a Uboot upgrade instruction exists or not after the Uboot is started.
And the upgrade instruction execution module is used for upgrading the Uboot program stored in the first Uboot starting area according to the Uboot upgrade instruction if the Uboot upgrade instruction is detected.
And the program detection module is used for detecting whether the Uboot program stored in the first Uboot startup area is successfully upgraded.
The upgrade processing module is used for modifying the value of the Uboot start flag bit to a third preset value if the Uboot program stored in the first Uboot start area is successfully upgraded, re-executing the start timer to start timing, and detecting whether the Uboot start flag bit is established; and if the Uboot program stored in the first Uboot starting area is detected to be failed to be upgraded, quitting Uboot upgrading, and re-executing the step of detecting whether the Uboot upgrading instruction exists or not.
Further, the Uboot upgrade system further includes:
and the starting flag bit initialization module is used for initializing the value of the Uboot starting flag bit to be a fourth preset value and jumping to a second Uboot starting area to start the Uboot if the Uboot starting flag bit is not established.
Further, the Uboot upgrade system further includes:
and the timing detection module is used for detecting whether the timing of the timer exceeds the preset time, setting the value of the timing zone bit of the timer to be a first preset value if the timing of the timer exceeds the preset time, re-executing the step of starting the timer to start timing and detecting whether the Uboot starting zone bit is established.
A third aspect of an embodiment of the present invention provides a Uboot upgrade terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the Uboot upgrade method according to the first aspect when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the Uboot upgrade method according to the first aspect.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: by dividing the storage module into two starting regions respectively storing the Uboot program, when the upgrading of the starting region for upgrading the Uboot program fails, the Uboot program stored in the other starting region can be started, so that the normal starting of a product can be ensured when the upgrading of the Uboot program fails, the complexity of hardware design is reduced, and the cost is saved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart of a Uboot upgrade method provided in an embodiment of the present invention;
fig. 2 is a schematic block diagram of a Uboot upgrade system provided in an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a Uboot upgrade terminal device according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a Uboot upgrade method according to another embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Referring to fig. 1 and 4, a first aspect of an embodiment of the present invention provides a Uboot upgrade method, including the following steps:
s101, after the single board is powered on, a timer is started to start timing, and whether a Uboot start flag bit is established or not is detected.
Specifically, one memory chip includes two regions, which are a secure region and a working region, respectively, the first Uboot starting region is a working region for storing a Uboot working program, the working region is also used for storing a program after Uboot upgrade, the second Uboot starting region is a secure region for storing a Uboot secure program, and the Uboot secure program includes a boot module and a board starting module. Under normal conditions, the Uboot security program stored in the security area will not make mistakes, and the single board can be ensured to be normally started, and if the program of the working area has a problem, the single board can also be normally started through the security area, wherein the program of the working area may be the same as or different from the program of the security area.
Specifically, after the board is powered on, the CPU starts from a boot module of the Uboot security area, starts a Timer to start timing, the Timer may be a Timer of hardware inside the CPU, and the CPU detects whether a Uboot start flag bit "Uboot _ STS" is established according to an algorithm, where, for the first power on of the board, the "Uboot _ STS" is not established, the "Uboot _ STS" has no value, and if the "Uboot _ STS" is established, the "Uboot _ STS" has a value.
S102, if the Uboot start flag bit is detected to be established, judging whether the value of the timing flag bit of the timer is a first preset value.
Specifically, if it is detected that the "Uboot _ STS" is already established, the "Uboot _ STS" has a value, it is then determined whether a value of a timing flag bit "Timer _ STS" of the Timer is a first preset value 1, that is, it is determined whether the Timer is timed out, if the value of the timing flag bit "Timer _ STS" is a second preset value 0, it indicates that the preset time is not exceeded, the subsequent steps are executed, if the value of the timing flag bit "Timer _ STS" is the first preset value 1, it indicates that the preset time is exceeded, and the single board starting module directly jumps to the security area to perform Uboot starting.
S103, if the value of the timing flag bit of the timer is not the first preset value, jumping to a first Uboot starting area or a second Uboot starting area in the storage module according to the value of the Uboot starting flag bit to start the Uboot.
Specifically, if the value of the timing flag "Timer _ STS" is not the first preset value 1, which indicates that the Timer is not overtime, then the boot region to be skipped may be determined according to the value of the Uboot start flag "Uboot _ STS", that is, a boot path is selected, if the value of the Uboot start flag "Uboot _ STS" is 01, the boot may be skipped to the second Uboot start region to start, specifically, the boot may be skipped to the single board start module of the secure area to start, if the value of the Uboot start flag "Uboot _ STS" is 02, the mirror image file in the first Uboot start region is verified to have an error, that is, the mirror image file in the working area is verified to have an error, specifically, the mirror image file in the working area may be verified by using a Cyclic Redundancy Check (CRC) verification method, if the mirror image file in the working area has no error, the boot is skipped to the first Uboot start region, namely jumping to a working area for starting, if the mirror image file in the first Uboot starting area has an error, jumping to the second Uboot starting area for Uboot starting. And if the value of the timing flag bit Timer _ STS is a first preset value 1, it indicates that the previous start has overtime and the start fails, so that the start directly jumps to the safe area start module for start.
And S104, after the Uboot is started successfully, stopping timing of the timer, setting a timing zone bit of the timer to be a second preset numerical value, and modifying the value of the Uboot starting zone bit according to the area where the Uboot is started successfully.
Specifically, after the Uboot is started successfully, the Timer may stop timing, set the value of the timing flag bit to a second preset value 0, which indicates that timing is not overtime, then modify the value of the Uboot starting flag bit according to the region where the Uboot is started successfully, change the value of the Uboot starting flag bit to a third preset value 02 if the region where the Uboot is started successfully is the first Uboot starting region, and change the value of the Uboot starting flag bit to a fifth preset value 01 if the region where the Uboot is started successfully is the second Uboot starting region, so that, in the subsequent starting process, the user may directly jump to the region where the Uboot can be started successfully according to the value of the Uboot starting flag bit to start.
And S105, after the Uboot is started, detecting whether a Uboot upgrading instruction exists.
Specifically, after the Uboot startup is completed, whether a Uboot upgrade instruction is received is detected, that is, whether update upgrade is to be performed on the Uboot program is determined.
And S106, if a Uboot upgrading instruction is detected, upgrading the Uboot program stored in the first Uboot starting area according to the Uboot upgrading instruction.
Specifically, if a Uboot upgrade instruction is detected, the Uboot program stored in the first Uboot startup area is upgraded, that is, the Uboot working program of the working area is updated and upgraded, and if no Uboot upgrade instruction is detected, the Uboot startup process is ended and other steps are not executed.
S107, detecting whether the Uboot program stored in the first Uboot startup area is upgraded successfully.
Specifically, whether the Uboot program stored in the first Uboot startup area succeeds or not can be detected by verifying the correctness of the program, a timer can be started to count when the upgrade is performed, and if the upgrade is not completed within the specified upgrade time, the upgrade is determined to fail.
S108, if the Uboot program stored in the first Uboot starting area is detected to be upgraded successfully, modifying the value of the Uboot starting flag bit to be a third preset value, re-executing the starting timer to start timing, and detecting whether the Uboot starting flag bit is established; and if the Uboot program stored in the first Uboot starting area is detected to be failed to be upgraded, quitting Uboot upgrading, and re-executing the step of detecting whether the Uboot upgrading instruction exists or not.
Specifically, if the Uboot program in the first Uboot starting area is successfully upgraded, the value of the Uboot starting flag bit is changed to a third preset value 02, during the step of re-executing the starting timer to start timing and detecting whether the Uboot starting flag bit is established, the reset CPU is required to be included, the Uboot program can be started in the subsequent starting process after upgrading, if the upgrading fails, the Uboot upgrading process is exited, and the step of detecting whether the Uboot upgrading instruction exists is re-executed.
As can be seen from the above description, in the embodiment of the present invention, the storage module is divided into two boot areas in which the Uboot program is stored, and when the boot area for upgrading the Uboot program fails to be upgraded, the Uboot program stored in the other boot area can be started, so that when the Uboot upgrade fails, normal startup of a product can be ensured, complexity of hardware design is reduced, and cost is saved.
Further, the Uboot upgrade method further includes:
and if the Uboot start flag bit is not established, initializing the value of the Uboot start flag bit to be a fourth preset value, and jumping to a second Uboot start area to start the Uboot.
Specifically, if it is detected that the Uboot start flag is not established, it indicates that the single board is powered on for the first time, the Uboot start flag has no value, the value of the Uboot start flag is initialized to be the fourth preset value 03, and the method directly jumps to a security area to perform Uboot start, so as to ensure normal start of the Uboot.
Further, the jumping to the first Uboot startup area or the second Uboot startup area in the storage module according to the value of the Uboot startup flag bit to perform Uboot startup includes:
and if the value of the Uboot startup zone bit is a third preset value, verifying whether the mirror image file in the first Uboot startup zone has an error.
And if the mirror image file in the first Uboot starting region is verified to have no error, jumping to the first Uboot starting region in the storage module to start the Uboot.
And if the mirror image file in the first Uboot starting region is verified to have errors, jumping to a second Uboot starting region in the storage module to start the Uboot.
And if the value of the Uboot start flag bit is a fifth preset value, jumping to a second Uboot start area in the storage module to start the Uboot.
Specifically, if the value of the Uboot start flag bit "Uboot _ STS" is a third preset value 02, it is verified whether the image file in the first Uboot start area has an error, that is, whether the image file in the working area has an error, specifically, a CRC check mode may be adopted for verification, if the image file in the working area has no error, it is skipped to the working area for Uboot start, and if the image file in the working area has an error, it is skipped to the second Uboot start area for Uboot start. And if the value of the Uboot start flag bit 'Uboot _ STS' is a fifth preset value 01, jumping to a second Uboot start area to start the Uboot, specifically, jumping to a single board start module of the security area to start the Uboot.
Further, the modifying the value of the Uboot starting flag bit according to the area where the Uboot is successfully started includes:
and if the area in which the Uboot is successfully started is the first Uboot starting area, modifying the value of the Uboot starting zone bit into a third preset value.
And if the area in which the Uboot is successfully started is the second Uboot starting area, modifying the value of the Uboot starting zone bit to a fifth preset value.
Further, the Uboot upgrade method further includes:
and detecting whether the timing of the timer exceeds a preset time.
And if the timer is detected to be timed to exceed the preset time, setting the value of the timing zone bit of the timer to be a first preset value, re-executing the step of starting the timer to start timing and detecting whether the Uboot start zone bit is established.
Specifically, in the Uboot starting process, if the timing of the timer exceeds the preset time, the timing flag is set to be a first preset value 1, which indicates that the starting fails, the starting timer is executed again to start timing, and whether the Uboot starting flag is established or not is detected.
Referring to fig. 2, a second aspect of the embodiment of the present invention provides a Uboot upgrade system, including:
the power-on starting module 201 is configured to start a timer to start timing after the board is powered on, and detect whether a Uboot starting flag bit is established.
A timing flag bit determining module 202, configured to determine whether a value of a timing flag bit of the timer is a first preset value if it is detected that the Uboot start flag bit is already established.
And the starting region jumping module 203 is configured to jump to a first Uboot starting region or a second Uboot starting region in the storage module according to the value of the Uboot starting flag to perform Uboot starting if the value of the timing flag of the timer is not the first preset value.
And the start flag bit modification module 204 is configured to stop timing of the timer after the Uboot is successfully started, set a timing flag bit of the timer to a second preset value, and modify a value of the Uboot start flag bit according to a region where the Uboot is successfully started.
And the upgrade instruction detection module 205 is configured to detect whether a Uboot upgrade instruction exists after the Uboot start is completed.
And the upgrade instruction execution module 206 is configured to, if a Uboot upgrade instruction is detected, upgrade a Uboot program stored in the first Uboot start area according to the Uboot upgrade instruction.
And a program detection module 207, configured to detect whether the Uboot program stored in the first Uboot startup area is successfully upgraded.
An upgrade processing module 208, configured to modify a value of a Uboot start flag to be a third preset value if it is detected that the Uboot program stored in the first Uboot start area is successfully upgraded, re-execute the start timer to start timing, and detect whether the Uboot start flag is established; and if the Uboot program stored in the first Uboot starting area is detected to be failed to be upgraded, quitting Uboot upgrading, and re-executing the step of detecting whether the Uboot upgrading instruction exists or not.
Further, the starting region jumping module comprises:
the first jumping module is used for verifying whether an error exists in the image file in the first Uboot boot startup region if the value of the Uboot startup flag bit is a third preset value, jumping to the first Uboot startup region in the storage module for Uboot startup if the error does not exist in the image file in the first Uboot startup region, and jumping to the second Uboot startup region in the storage module for Uboot startup if the error exists in the image file in the first Uboot startup region.
And the second jumping module is used for jumping to a second Uboot starting area in the storage module to start the Uboot if the value of the Uboot starting flag bit is a fifth preset value.
Further, the start flag bit modification module includes:
and the first modification module is used for modifying the value of the Uboot start flag bit into a third preset value if the area in which the Uboot is successfully started is the first Uboot start area.
And the second modification module is used for modifying the value of the Uboot start flag bit into a fifth preset value if the area in which the Uboot is successfully started is the second Uboot start area.
Further, the Uboot upgrade system further includes:
and the starting flag bit initialization module is used for initializing the value of the Uboot starting flag bit to be a fourth preset value and jumping to a second Uboot starting area to start the Uboot if the Uboot starting flag bit is not established.
Further, the Uboot upgrade system further includes:
and the timing detection module is used for detecting whether the timing of the timer exceeds the preset time, setting the value of the timing zone bit of the timer to be a first preset value if the timing of the timer exceeds the preset time, re-executing the step of starting the timer to start timing and detecting whether the Uboot starting zone bit is established.
Referring to fig. 3, an embodiment of the present invention provides a Uboot upgrade terminal device, where the Uboot upgrade terminal device 3 of this embodiment includes: a processor 30, a memory 31 and a computer program 32, such as a Uboot upgrade program, stored in said memory 31 and executable on said processor 30. The processor 30, when executing the computer program 32, implements the steps in the above-described respective Uboot upgrade method embodiments, such as steps S101 to S108 shown in fig. 1. Alternatively, the processor 30, when executing the computer program 32, implements the functions of each module/unit in the above-mentioned device embodiments, for example, the functions of the modules 201 to 208 shown in fig. 2.
Illustratively, the computer program 32 may be partitioned into one or more modules/units that are stored in the memory 31 and executed by the processor 30 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 32 in the Uboot upgrade terminal device 3. For example, the computer program 32 may be divided into a synchronization module, a summarization module, an acquisition module, and a return module (module in a virtual device), and the specific functions of each module are as follows:
after the single board is powered on, a timer is started to start timing, and whether a Uboot start flag bit is established or not is detected.
And if the Uboot start flag bit is detected to be established, judging whether the value of the timing flag bit of the timer is a first preset value.
And if the value of the timing zone bit of the timer is not the first preset value, jumping to a first Uboot starting region or a second Uboot starting region in the storage module according to the value of the Uboot starting zone bit to start the Uboot.
And after the Uboot is started successfully, stopping the timer for timing, setting the timing of the timer to be a second preset numerical value, and modifying the value of the Uboot starting flag bit according to the area where the Uboot is started successfully.
And after the Uboot is started, detecting whether a Uboot upgrading instruction exists.
And if a Uboot upgrading instruction is detected, upgrading the Uboot program stored in the first Uboot starting area according to the Uboot upgrading instruction.
And detecting whether the Uboot program stored in the first Uboot startup area is upgraded successfully.
If the Uboot program stored in the first Uboot starting area is detected to be upgraded successfully, modifying the value of a Uboot starting flag to be a third preset value, re-executing the starting timer to start timing, and detecting whether a Uboot starting flag bit is established; and if the Uboot program stored in the first Uboot starting area is detected to be failed to be upgraded, quitting Uboot upgrading, and re-executing the step of detecting whether the Uboot upgrading instruction exists or not.
Further, the specific functions of each module further include:
and if the Uboot start flag bit is not established, initializing the value of the Uboot start flag bit to be a fourth preset value, and jumping to a second Uboot start area to start the Uboot.
Further, the specific functions of each module further include:
and if the value of the Uboot startup zone bit is a third preset value, verifying whether the mirror image file in the first Uboot startup zone has an error.
And if the mirror image file in the first Uboot starting region is verified to have no error, jumping to the first Uboot starting region in the storage module to start the Uboot.
If the mirror image file in the first Uboot starting region is verified to have errors, jumping to a second Uboot starting region in the storage module to start the Uboot;
and if the value of the Uboot start flag bit is a fifth preset value, jumping to a second Uboot start area in the storage module to start the Uboot.
Further, the specific functions of each module further include:
and if the area in which the Uboot is successfully started is the first Uboot starting area, modifying the value of the Uboot starting zone bit into a third preset value.
And if the area in which the Uboot is successfully started is the second Uboot starting area, modifying the value of the Uboot starting zone bit to a fifth preset value.
Further, the specific functions of each module further include:
and detecting whether the timing of the timer exceeds a preset time.
And if the timer is detected to be timed to exceed the preset time, setting the value of the timing zone bit of the timer to be a first preset value, re-executing the step of starting the timer to start timing and detecting whether the Uboot start zone bit is established.
The Uboot upgrade terminal device 3 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The Uboot upgrade terminal equipment may include, but is not limited to, a processor 30, a memory 31. Those skilled in the art will appreciate that fig. 3 is merely an example of the Uboot upgrade terminal device 3, and does not constitute a limitation of the Uboot upgrade terminal device 3, and may include more or less components than those shown, or combine some components, or different components, for example, the Uboot upgrade terminal device may further include an input-output device, a network access device, a bus, etc.
The Processor 30 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 31 may be an internal storage unit of the Uboot upgrade terminal device 3, for example, a hard disk or a memory of the Uboot upgrade terminal device 3. The memory 31 may also be an external storage device of the Uboot upgrade terminal device 3, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on the Uboot upgrade terminal device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the Uboot upgrade terminal device 3. The memory 31 is used for storing the computer program and other programs and data required by the Uboot upgrade terminal device. The memory 31 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. 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.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. A Uboot upgrading method is characterized by comprising the following steps:
after a single board is powered on, starting a timer to start timing, and detecting whether a Uboot start flag bit is established or not, wherein the Uboot start flag bit is not established when the single board is powered on for the first time;
if the Uboot start flag bit is detected to be established, judging whether the value of the timing flag bit of the timer is a first preset value or not;
if the value of the timing zone bit of the timer is not a first preset value, jumping to a first Uboot starting region or a second Uboot starting region in a storage module according to the value of the Uboot starting zone bit to start the Uboot; wherein, the jumping to the first Uboot startup region or the second Uboot startup region in the storage module according to the value of the Uboot startup flag bit to perform Uboot startup comprises: if the value of the Uboot startup zone bit is a third preset value, verifying whether the mirror image file in the first Uboot startup region has an error; if the fact that the mirror image file in the first Uboot starting region has no error is verified, jumping to the first Uboot starting region in the storage module to conduct Uboot starting; if the mirror image file in the first Uboot starting region is verified to have errors, jumping to a second Uboot starting region in the storage module to start the Uboot; if the value of the Uboot start flag bit is a fifth preset value, jumping to a second Uboot start area in the storage module to start the Uboot;
after the Uboot is started successfully, stopping timing of the timer, setting a timing zone bit of the timer to be a second preset numerical value, and modifying the value of the Uboot starting zone bit according to the area where the Uboot is started successfully; wherein, the modifying the value of the Uboot start flag bit according to the area in which the Uboot is successfully started comprises: if the area in which the Uboot is successfully started is the first Uboot starting area, modifying the value of the Uboot starting zone bit into a third preset value; if the area in which the Uboot is successfully started is the second Uboot starting area, modifying the value of the Uboot starting zone bit into a fifth preset value;
after the Uboot is started, detecting whether a Uboot upgrading instruction exists;
if a Uboot upgrading instruction is detected, upgrading a Uboot program stored in the first Uboot starting area according to the Uboot upgrading instruction;
detecting whether the Uboot program stored in the first Uboot startup area is successfully upgraded;
if the Uboot program stored in the first Uboot starting area is detected to be upgraded successfully, modifying the value of the Uboot starting zone bit to be a third preset value, re-executing the starting timer to start timing, and detecting whether the Uboot starting zone bit is established; and if the Uboot program stored in the first Uboot starting area is detected to be failed to be upgraded, quitting Uboot upgrading, and re-executing the step of detecting whether the Uboot upgrading instruction exists or not.
2. The Uboot upgrade method according to claim 1, further comprising:
and if the Uboot start flag bit is not established, initializing the value of the Uboot start flag bit to be a fourth preset value, and jumping to a second Uboot start area to start the Uboot.
3. The Uboot upgrade method according to claim 1, further comprising:
detecting whether the timing of the timer exceeds a preset time or not;
and if the timer is detected to be timed to exceed the preset time, setting the value of the timing zone bit of the timer to be a first preset value, re-executing the step of starting the timer to start timing and detecting whether the Uboot start zone bit is established.
4. A Uboot upgrade system, comprising:
a power-on starting module, configured to start a timer to start timing after a board is powered on, and detect whether a Uboot starting flag bit is established, where the Uboot starting flag bit is not established when the board is powered on for the first time;
the timing zone bit judging module is used for judging whether the value of the timing zone bit of the timer is a first preset value or not if the Uboot start zone bit is detected to be established;
the starting region jumping module is used for jumping to a first Uboot starting region or a second Uboot starting region in the storage module according to the value of the Uboot starting zone bit to start Uboot if the value of the timing zone bit of the timer is not a first preset numerical value; wherein, the jumping to the first Uboot startup region or the second Uboot startup region in the storage module according to the value of the Uboot startup flag bit to perform Uboot startup comprises: if the value of the Uboot startup zone bit is a third preset value, verifying whether the mirror image file in the first Uboot startup region has an error; if the fact that the mirror image file in the first Uboot starting region has no error is verified, jumping to the first Uboot starting region in the storage module to conduct Uboot starting; if the mirror image file in the first Uboot starting region is verified to have errors, jumping to a second Uboot starting region in the storage module to start the Uboot; if the value of the Uboot start flag bit is a fifth preset value, jumping to a second Uboot start area in the storage module to start the Uboot;
the starting zone bit modification module is used for stopping the timer for timing after the Uboot is started successfully, setting the timing zone bit of the timer to be a second preset numerical value, and modifying the value of the Uboot starting zone bit according to the area where the Uboot is started successfully; wherein, the modifying the value of the Uboot start flag bit according to the area in which the Uboot is successfully started comprises: if the area in which the Uboot is successfully started is the first Uboot starting area, modifying the value of the Uboot starting zone bit into a third preset value; if the area in which the Uboot is successfully started is the second Uboot starting area, modifying the value of the Uboot starting zone bit into a fifth preset value;
the upgrade instruction detection module is used for detecting whether a Uboot upgrade instruction exists or not after the Uboot is started;
the upgrade instruction execution module is used for upgrading a Uboot program stored in the first Uboot starting area according to the Uboot upgrade instruction if the Uboot upgrade instruction is detected;
the program detection module is used for detecting whether the Uboot program stored in the first Uboot startup area is successfully upgraded;
the upgrade processing module is used for modifying the value of the Uboot start flag bit to a third preset value if the Uboot program stored in the first Uboot start area is successfully upgraded, re-executing the start timer to start timing, and detecting whether the Uboot start flag bit is established; and if the Uboot program stored in the first Uboot starting area is detected to be failed to be upgraded, quitting Uboot upgrading, and re-executing the step of detecting whether the Uboot upgrading instruction exists or not.
5. The Uboot upgrade system according to claim 4 further comprising:
and the starting flag bit initialization module is used for initializing the value of the Uboot starting flag bit to be a fourth preset value and jumping to a second Uboot starting area to start the Uboot if the Uboot starting flag bit is not established.
6. The Uboot upgrade system according to claim 4 further comprising:
and the timing detection module is used for detecting whether the timing of the timer exceeds the preset time, setting the value of the timing zone bit of the timer to be a first preset value if the timing of the timer exceeds the preset time, re-executing the step of starting the timer to start timing and detecting whether the Uboot starting zone bit is established.
7. A Uboot upgrade terminal device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the Uboot upgrade method according to any of claims 1 to 3 when executing said computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the Uboot upgrade method as claimed in any one of claims 1 to 3.
CN201711022505.8A 2017-10-27 2017-10-27 Uboot upgrading method, system and terminal equipment Active CN107704258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711022505.8A CN107704258B (en) 2017-10-27 2017-10-27 Uboot upgrading method, system and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711022505.8A CN107704258B (en) 2017-10-27 2017-10-27 Uboot upgrading method, system and terminal equipment

Publications (2)

Publication Number Publication Date
CN107704258A CN107704258A (en) 2018-02-16
CN107704258B true CN107704258B (en) 2020-12-01

Family

ID=61181625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711022505.8A Active CN107704258B (en) 2017-10-27 2017-10-27 Uboot upgrading method, system and terminal equipment

Country Status (1)

Country Link
CN (1) CN107704258B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614265B (en) * 2018-11-05 2024-03-29 北京原子机器人科技有限公司 Double-backup system of intelligent inertial navigation sensing system and configuration starting method thereof
CN109582332B (en) * 2018-11-08 2022-04-01 深圳市景阳科技股份有限公司 System upgrading method and device for Internet camera
CN109871679A (en) * 2018-12-27 2019-06-11 延锋伟世通电子科技(上海)有限公司 Data display method, system, device and medium
CN111443951A (en) * 2019-01-16 2020-07-24 大唐移动通信设备有限公司 System starting method and system starting device
CN110427286B (en) * 2019-08-09 2022-11-11 成都千立网络科技有限公司 Gateway server main and standby system recovery method
CN111736892B (en) * 2020-06-19 2022-06-17 浪潮(北京)电子信息产业有限公司 Uboot starting method, system, equipment and computer storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR3010553A1 (en) * 2013-09-10 2015-03-13 Sagemcom Broadband Sas METHOD FOR UPDATING A STARTER SOFTWARE OF A MULTIPROCESSOR DEVICE

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100343807C (en) * 2004-09-14 2007-10-17 华为技术有限公司 Upgrading method for Boot software and recovering method for Boot software
US7533290B2 (en) * 2006-02-21 2009-05-12 Realtek Semiconductor Corp. Microcode updating error handling apparatus and method thereof
CN101499909B (en) * 2008-02-03 2011-05-11 中兴通讯股份有限公司 Single board starting system and method
CN101556547B (en) * 2009-05-25 2012-01-25 芯通科技(成都)有限公司 Safe method and system used for remotely upgrading embedded Linux kernel
CN103116511A (en) * 2013-01-29 2013-05-22 烽火通信科技股份有限公司 Double-booting method based on single FLASH storage chip

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR3010553A1 (en) * 2013-09-10 2015-03-13 Sagemcom Broadband Sas METHOD FOR UPDATING A STARTER SOFTWARE OF A MULTIPROCESSOR DEVICE

Also Published As

Publication number Publication date
CN107704258A (en) 2018-02-16

Similar Documents

Publication Publication Date Title
CN107704258B (en) Uboot upgrading method, system and terminal equipment
CN109358882B (en) Method and device for upgrading firmware of television terminal
JP5270377B2 (en) Platform boot with bridge support
US20110320794A1 (en) Flash System And Method For Updating The Flash System
WO2016206514A1 (en) Startup processing method and device
CN110162435B (en) Method, system, terminal and storage medium for starting and testing PXE of server
CN105718277B (en) Protection method, device and system for BIOS update
US8935558B2 (en) Overclocking module, a computer system and a method for overclocking
US11074148B2 (en) Method and system for visually displaying a bios message during a power-on self-test
CN110909360B (en) Electronic equipment safe starting method and device based on dual systems
US20150154091A1 (en) Bios maintenance method
CN107015878B (en) System repair method and system for computer
US20220237144A1 (en) Baseboard management controller and construction method thereof
US20130080751A1 (en) Method and device for updating bios program for computer system
CN113742237A (en) Program debugging method, device, equipment and storage medium
US20160103688A1 (en) Method of Starting Computing System
US20020103611A1 (en) System and method for receiving information from a test apparatus
WO2017143513A1 (en) Method, cpu and single board for starting boot
CN107451005B (en) Onboard memory configuration method, control device, computer mainboard and computer
US9619355B2 (en) Booting verification method of computer and electronic device
CN111857785B (en) MCU starting method and device and terminal equipment
US20170131946A1 (en) Method and device for formatting storage of mobile terminal
CN114510751A (en) Hardware replacement prevention device and method based on processor security kernel
CN103294837A (en) Method and system for verifying and debugging integrated circuit
CN111124461B (en) Method and device for upgrading OTA (over the air) of singlechip and singlechip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Pi Guanghui

Inventor after: Li Chao

Inventor before: Pi Guanghui

GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Uboot upgrade method, system and terminal equipment

Effective date of registration: 20220701

Granted publication date: 20201201

Pledgee: Bank of Communications Limited Shenzhen Branch

Pledgor: Shenzhen Hengyang Data Co.,Ltd.

Registration number: Y2022340000011