CN114138295A - Method, device and system for upgrading application program firmware of electronic equipment - Google Patents

Method, device and system for upgrading application program firmware of electronic equipment Download PDF

Info

Publication number
CN114138295A
CN114138295A CN202111192972.1A CN202111192972A CN114138295A CN 114138295 A CN114138295 A CN 114138295A CN 202111192972 A CN202111192972 A CN 202111192972A CN 114138295 A CN114138295 A CN 114138295A
Authority
CN
China
Prior art keywords
upgrading
firmware
application program
application
preset
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.)
Pending
Application number
CN202111192972.1A
Other languages
Chinese (zh)
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 Honghe Innovation Information Technology Co Ltd
Original Assignee
Shenzhen Honghe Innovation Information Technology 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 Honghe Innovation Information Technology Co Ltd filed Critical Shenzhen Honghe Innovation Information Technology Co Ltd
Priority to CN202111192972.1A priority Critical patent/CN114138295A/en
Publication of CN114138295A publication Critical patent/CN114138295A/en
Pending legal-status Critical Current

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
    • 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

Landscapes

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

Abstract

The invention provides an application program firmware upgrading method of electronic equipment, which comprises the steps of running a bootstrap program, judging whether the application program firmware is effective, wherein the bootstrap program comprises a memory starting address, a memory ending address, a preset equipment matching value and a preset upgrading completion flag value; judging whether the application program firmware is valid, judging whether a stack address of the application program firmware is in a range of a memory starting address and a memory ending address, judging whether a device matching value in the application program firmware is the same as a preset device matching value, and judging whether an upgrade completion flag value in the application program firmware is the same as a preset upgrade completion flag value; if so, the application firmware is valid; otherwise, the application firmware is invalid; if the application program firmware is invalid, receiving a first upgrading instruction, and executing application program firmware upgrading; and when the upgrading is finished, setting the upgrading finishing mark value in the application program firmware as a preset upgrading finishing mark value.

Description

Method, device and system for upgrading application program firmware of electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device and a system for upgrading application program firmware of electronic equipment.
Background
When a new function is added to the equipment or the functional defect of the existing product is overcome, the firmware of the equipment needs to be upgraded, the firmware upgrading process needs to be stable and reliable, otherwise, the equipment has abnormal functions, even needs to be disassembled and reworked, and the loss is huge.
The manner in which the device firmware is upgraded is generally as follows: the device program storage area contains two different areas of boot and App, and the program runs in the boot area when power is on, if it is effective to detect APP, then jump to APP operation, if it is not effective to detect APP, then wait for the upgrading command to upgrade APP firmware, when running APP, if receive the firmware upgrading command, then clear away the APP effective mark, reset and re-enter the boot, begin firmware upgrade.
The prior art mainly has the following technical problems:
1, the mark detection mechanisms for whether the APPs are effective are inconsistent, and even if the wrong APP is upgraded in some methods, the APP can be operated, so that equipment is abnormal and cannot be upgraded again;
2. if the power is abnormally cut off in the burning process, the program cannot be operated, and the program cannot be upgraded, so that the equipment is abnormal or damaged finally.
Disclosure of Invention
Based on the above situation, a primary objective of the present invention is to provide a method and an apparatus for upgrading an application firmware of an electronic device, which ensure that no error occurs in the whole device upgrading process.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
an application firmware upgrading method for an electronic device, wherein a program storage area of the electronic device comprises a boot program area and an application program area, a boot program is stored in the boot program area, and application firmware is stored in the application program area, the method comprising the following steps:
operating the bootstrap program and judging whether the application program firmware is effective or not;
the bootstrap program comprises a memory starting address, a memory ending address, a preset equipment matching value and a preset upgrading completion flag value; determining whether the application firmware is valid comprises: judging whether the stack address of the application program firmware is in the range of the memory starting address and the memory ending address, judging whether a device matching value in the application program firmware is the same as the preset device matching value, and judging whether an upgrade completion flag value in the application program firmware is the same as the preset upgrade completion flag value, if so, considering the application program firmware to be valid, otherwise, considering the application program firmware to be invalid;
if the application program firmware is invalid, receiving a first upgrading instruction, and executing application program firmware upgrading;
and after the upgrading is finished, setting the upgrading finishing mark value in the application program firmware as the preset upgrading finishing mark value.
Preferably, the stack address includes: the application firmware area starts a value consisting of N bytes of data.
Preferably, the device matching values include: and starting program data with a continuous preset length from a preset fixed position in the application program firmware, wherein the preset length is the length of the preset equipment matching value.
Preferably, the device matching value further includes model information of the electronic device.
Preferably, the upgrade completion flag value includes: and the program value of the last fixed byte in the application program firmware.
Preferably, if the application firmware is valid, the application firmware is operated;
when a second upgrading instruction is received in the running process of the application program firmware, setting an upgrading completion flag value in the application program firmware as a non-preset upgrading completion flag value;
re-running the bootstrap program and determining that the application program firmware is invalid;
and the boot program receives the first upgrading instruction, upgrades the application program firmware, and sets an upgrading completion flag value in the application program firmware as the preset upgrading completion flag value.
The invention also provides electronic equipment, and the method for upgrading the application program firmware of the electronic equipment can be adopted to carry out upgrading operation on the application program firmware of the electronic equipment.
The invention also provides an application program firmware upgrading device of the electronic equipment, which comprises a boot program execution module and an application program firmware execution module, wherein the boot program execution module comprises a judgment unit, an instruction receiving unit and an upgrading unit,
the system comprises a bootstrap program execution module, a judgment unit and a control unit, wherein the bootstrap program execution module is used for running a bootstrap program, the application program firmware execution module is used for running an application program firmware, the judgment unit is used for judging whether the application program firmware is effective or not, and the bootstrap program comprises a memory starting address, a memory ending address, a preset equipment matching value and a preset upgrade completion flag value;
the judging unit comprises a first judging unit, a second judging unit and a third judging unit, wherein,
the first judging unit is used for judging whether the stack address of the application program firmware is in the range of the memory starting address and the memory ending address,
the second judging unit is used for judging whether the device matching value in the application program firmware is the same as the preset device matching value,
the third judging unit is used for judging whether the upgrading completion flag value in the application program firmware is the same as the preset upgrading completion flag value;
the judging unit can consider the application firmware to be valid if the judging results of the first judging unit, the second judging unit and the third judging unit are all yes, otherwise, the application firmware is considered to be invalid;
the instruction receiving unit can receive a first upgrading instruction when the application program firmware is invalid, the upgrading unit can execute application program firmware upgrading, and after upgrading is completed, an upgrading completion flag value in the application program firmware is set to be the preset upgrading completion flag value.
Preferably, if the instruction receiving unit receives a second upgrade instruction in the process of running the application firmware by the application execution module, the application execution module sets an upgrade completion flag value in the application data to a non-preset upgrade completion flag value, the bootstrap execution module runs the bootstrap again, and the determining unit determines that the application firmware is invalid;
after the instruction receiving unit receives the first upgrading instruction, the upgrading unit can execute upgrading of the application program firmware, and after upgrading is completed, the upgrading completion flag value in the application program firmware is set to be the preset upgrading completion flag value.
The invention also provides an application program firmware upgrading system of the electronic equipment, which comprises an upper computer and an application program firmware upgrading device of the electronic equipment,
the upper computer is used for acquiring the working mode of the application program firmware upgrading device of the electronic equipment;
the upper computer sends a first upgrading instruction to an application program firmware upgrading device of the electronic equipment when the application program firmware upgrading device of the electronic equipment operates in a bootstrap working mode, and the application program firmware upgrading device of the electronic equipment executes application program upgrading;
and the upper computer sends a second upgrading instruction to the application program firmware upgrading device of the electronic equipment when the application program firmware upgrading device of the electronic equipment operates in an application program working mode, the application program firmware upgrading device of the electronic equipment sets the upgrading completion flag value to a non-preset upgrading completion flag value, and the application program firmware upgrading device of the electronic equipment executes the upgrading of the application program firmware.
The invention relates to a method and a device for upgrading application program firmware of electronic equipment, wherein a bootstrap program is operated after being electrified, whether the application program firmware is valid is detected, the application program firmware is entered into for operation, otherwise the bootstrap program receives an upgrading instruction and executes the upgrading of the application program firmware, wherein the bootstrap program comprises a memory starting address, a memory ending address, a preset equipment matching value and a preset upgrading completion flag value, 3 values of the memory starting address, the memory ending address and the preset equipment matching value are all correct to ensure that an upgraded file is correct, an error program cannot be upgraded to the equipment, the preset upgrading completion flag value is written in at the last stage of an upgrading process, the value is correct to ensure that the upgrading of all data is completed, the power is lost before the correct program is not upgraded, the equipment cannot be abnormal, and the equipment can upgrade the application program again, therefore, the electronic equipment cannot make mistakes in the upgrading process.
The electronic equipment can adopt the application program firmware upgrading method to upgrade the application program of the electronic equipment, so that the wrong program cannot be upgraded to the equipment, the power failure cannot cause the equipment to be abnormal before the correct program is not updated, and the equipment can also upgrade the firmware again.
Other advantages of the present invention will be described in the detailed description, and those skilled in the art will understand the technical features and technical solutions presented in the description.
Drawings
Preferred embodiments of an application upgrade method and an application upgrade system of an electronic device according to the present invention will be described below with reference to the accompanying drawings. In the figure:
FIG. 1 is a flowchart of an application firmware upgrade method for an electronic device according to a preferred embodiment of the present invention;
FIG. 2 is a flowchart of an application firmware upgrade method for an electronic device according to another preferred embodiment of the present invention;
FIG. 3 is a block diagram of an application firmware upgrade mechanism of an electronic device in accordance with a preferred embodiment of the present invention;
FIG. 4 is a diagram of an application firmware upgrade system in accordance with a preferred embodiment of the present invention;
fig. 5 is a flowchart of the operation of the application firmware upgrade system shown in fig. 4.
Detailed Description
Fig. 1 is a flowchart of an application firmware upgrading method for an electronic device according to a preferred embodiment of the present invention, in which a program storage area of the electronic device includes a boot program area and an application firmware area, a boot program is stored in the boot program area, and an application firmware is stored in the application firmware area. In the present invention, the boot program may be used to perform an upgrade operation on the application firmware, and specifically, the boot program may determine whether the application firmware is valid, and implement the upgrade operation. The application firmware generally refers to an application used with hardware of the electronic device, and is an application existing depending on the hardware. After the electronic equipment is started, the boot program is firstly operated, whether the application program firmware is effective or not is judged through the boot program, if yes, the application program firmware is operated, and otherwise, the electronic equipment waits for an upgrading instruction and executes the upgrading of the application program firmware.
The method for upgrading the application program firmware of the electronic equipment comprises the following steps:
and S101, running a bootstrap program.
The bootstrap program includes a memory start address preFlag1_ L, a memory end address preFlag1_ H, a preset device matching value preFlag2, and a preset upgrade completion flag value preFlag 3.
S102, judging whether the application program firmware in the application program firmware area is effective.
Wherein, judging whether the application firmware is valid comprises:
s1021, judging whether the stack address of the application program firmware is in the range of the memory start address preFlag1_ L and the memory end address preFlag1_ H.
And S1022, judging whether the device matching value in the application program firmware is the same as the preset device matching value preFlag 2.
S1023, judging whether the upgrading completion flag value in the application program firmware data is the same as the preset upgrading completion flag value preFlag 3.
If the judgment results of S1021, S1022 and S1023 are yes, the application firmware is considered to be valid, and if one of the judgment results of S1021, S1022 and S1023 is no, the application firmware is judged to be invalid; if the application firmware is invalid, S103 is executed.
S103: and receiving a first upgrading instruction and upgrading the application program firmware. In a specific embodiment, a first upgrade instruction is generally issued by an upper computer.
And S104, after the upgrading is finished, setting the upgrading finishing mark value in the application program firmware as the preset upgrading finishing mark value.
Typically, the application firmware is run while it is valid.
In the method for upgrading the application program firmware of the electronic equipment, a bootstrap program is operated after power-on, whether the application program firmware is valid is detected, the application program firmware is operated if the application program firmware is valid, otherwise, the bootstrap program receives an upgrading instruction and executes the upgrading of the application program firmware, wherein the bootstrap program comprises 3 values of a memory starting address preFlag1_ L, a memory ending address preFlag1_ H, a preset equipment matching value preFlag2 and a preset upgrading completion flag value preFlag3, the memory starting address preFlag1_ L, the memory ending address preFlag1_ H and the preset equipment matching value preFlag2 which are all correct to ensure that an upgraded file is correct, an error program cannot be upgraded to the equipment, the preset upgrading completion flag value preFlag3 is written in at the last stage of an upgrading process, the values are correct to ensure that all data are upgraded, and power failure does not cause abnormal equipment before the correct program is not upgraded, the device can also upgrade the application program again, thereby ensuring that errors cannot occur in the upgrading process of the electronic device.
In S101, preFlag1_ L, preFlag1_ H in the boot loader may be a 32-bit unsigned integer value, which may represent a start address and an end address of a RAM area of the electronic device, and is determined by hardware, for example, the hardware includes 192K RAM, the start address is 0x2000000, then preFlag1_ L is equal to 0x2000000, preFlag1_ H is equal to 0x20030000, and preFlag2 and preFlag3 may be specific character strings or arrays.
In S1021, the value formed by reading the initial N bytes of data in the application firmware area is the stack address of the application firmware. For example, it may be 32-bit unsigned integer data composed of the first 4 bytes of the application firmware area. When the bootstrap program is operated, firstly, whether the stack address (Flag1) of the application program firmware meets preFlag1_ L < Flag1< preFlag1_ H is judged, if not, the application program firmware is judged to be invalid, and the bootstrap program enters to wait for upgrading. The stack address of the firmware of the application program is solidified in the software during the compiling process and represents the starting address of the application program running in the memory, the stack address is determined according to the memory address range of the electronic equipment during the compiling process, and when wrong memory information is input during the compiling process, the address is not in the starting address range and the ending address range of the RAM area of the electronic equipment, and the application program is not the electronic equipment, so that the Flag1 is correct and can ensure that the software is correct firmware.
In S1022, the device matching value in the application firmware may be program data starting at a preset fixed position in the application firmware and continuously having a preset length, which is the length of the device matching value preset in the boot program. For example, at a fixed position in the application firmware area, continuously reading fixed length (len) program data (Flag2), judging whether Flag2 is consistent with a preset device matching value in the boot program area, the size of len depends on the length of the preset device matching value, the preset device matching value is fixedly written inside the program by a coding person and can contain model information of the electronic device, some other specific mark information and the like, and if the program is wrong, the value is not possible to be consistent. If not, the firmware is not matched with the current equipment, the application program firmware is invalid, and the upgrading is waited.
In a specific embodiment, the preset device matches a string with a value of "mode _ HA86_ FLAG", and if the read FLAG2 is not equal to "mode _ HA86_ FLAG", the application firmware is invalid. The device match value is fixed inside the software, and the correct value can ensure that the software is the correct firmware.
In S1023, the upgrade complete Flag value (Flag3) may be the program value of the last fixed byte in the application firmware. The upgrade complete Flag value (Flag3) is written into the application firmware at the final stage of the upgrade process, and this Flag is correct to ensure that the upgrade of all data has been completed.
In S102, if the stack address of the application firmware is within the range of the memory start address preFlag1_ L and the memory end address preFlag1_ H, the device matching value in the application firmware is the same as the preset device matching value preFlag2, and the update completion flag value in the application firmware data is the same as the preset update completion flag value preFlag3, it is determined that the application firmware is valid, otherwise, as long as any one of the 3 conditions is no, it is determined that the application firmware is invalid, and the firmware update is waited.
In a specific embodiment, the execution of S1021, S1022, and S1023 may be parallel, serial, or by setting a priority, a certain item is determined first, and then a certain item is determined. For example, a determination may be made in parallel that when either is negative, the application firmware is determined to be invalid. Or serial judgment, firstly judging whether the stack address of the application program firmware is in the range of the memory start address preFlag1_ L and the memory end address preFlag1_ H, if so, judging whether the device matching value in the application program firmware is the same as the preset device matching value preFlag2, if so, judging whether the upgrading completion flag value in the application program firmware data is the same as the preset upgrading completion flag value preFlag3, if so, judging that the application program firmware is valid, otherwise, judging that the application program firmware is invalid when any one of the judgment is negative. The determination priorities of S1021, S1022, and S1023 may be set as required, and the determination may be performed according to the priorities, and similarly, when any one of the determinations is negative, the application firmware is determined to be invalid.
In one embodiment, as shown in FIG. 2, after the boot program determines that the application firmware is valid, step S105 is executed to run the application firmware; step S106: if the application firmware receives the second upgrade instruction in the running process, step S107 is executed: setting an upgrade completion flag value in the application firmware to a non-preset upgrade completion flag value, e.g., zero clearing; and the bootstrap program is re-run, at this time, the bootstrap program can determine that the application program is invalid because the upgrade completion flag is a non-preset upgrade completion flag value, the bootstrap program can receive the first upgrade instruction, perform upgrade on the application program firmware, and set the upgrade completion flag value in the application program firmware as the preset upgrade completion flag value, thereby completing the upgrade of the application program firmware. In a specific embodiment, the upper computer generally issues the second upgrade instruction.
In S106, the received second upgrade instruction and the first upgrade instruction received in S103 are different. The first upgrading instruction is sent when the application program is invalid, and at the moment, the electronic equipment runs in the bootstrap program area and can directly execute upgrading. The second upgrade instruction is sent when the application program is valid, and at this time, the electronic device operates in the application program area, and needs to set the upgrade completion flag value to the non-preset upgrade completion flag value, then operate the bootstrap program, and then execute the upgrade.
The upgrading mode of the method for upgrading the application program firmware of the electronic equipment can be USB, serial port, USB flash disk, SD card and the like, and the triggering upgrading mode can be self-defined USB command, serial port command, key triggering and the like, and is not limited.
The invention also provides electronic equipment which can adopt the application program firmware upgrading method of the electronic equipment to carry out upgrading operation on the application program firmware of the electronic equipment. By adopting the firmware upgrading method, the wrong program can not be upgraded to the equipment, the power failure can not be caused before the correct program is not updated, the equipment is not abnormal, and the equipment can also upgrade the firmware again. The electronic device may be a large-screen device, such as a conference large-screen, and for example, the electronic device may be configured to perform an upgrade operation on an application program of an infrared touch frame in the large-screen device.
The present invention further provides an application firmware upgrading apparatus of an electronic device, as shown in fig. 3, the application firmware upgrading apparatus includes a boot program execution module 20 and an application program execution module 30, and the boot program execution module 20 includes a determining unit 201, an instruction receiving unit 202, and an upgrading unit 203. The bootstrap program executing module 20 is configured to run a bootstrap program, and the application program firmware executing module is configured to run an application program firmware, where the bootstrap program includes a memory start address preFlag1_ L, a memory end address preFlag1_ H, a preset device matching value preFlag2, and a preset upgrade completion flag value preFlag 3; the determining unit 201 is configured to determine whether the application is valid, where the determining unit 201 includes a first determining unit 2011, a second determining unit 2012 and a third determining unit 2013, the first determining unit 2011 is configured to determine whether a stack address of the application firmware is within a range of a memory start address and a memory end address, the second determining unit 2012 is configured to determine whether a device matching value in the application firmware is the same as a preset device matching value, and the third determining unit 2013 is configured to determine whether an upgrade completion flag value in the application firmware is the same as a preset upgrade completion flag value; the determining unit 201 can determine that the application firmware is valid and run the application firmware if the first determining unit 2011, the second determining unit 2012 and the third determining unit 2013 determine that the results are all yes, and otherwise, determine that the application firmware is invalid; the instruction receiving unit 202 receives a first upgrade instruction when the application firmware is invalid, the upgrade unit 203 can execute the upgrade of the application firmware, and sets an upgrade completion flag value in the application firmware to a preset upgrade completion flag value after the upgrade is completed.
The invention relates to an upgrading device of application program firmware of electronic equipment, after being powered on, a bootstrap program execution module 20 runs a bootstrap program, whether the application program firmware is effective is judged by a judgment unit 201, if the application program firmware is effective, an application program firmware execution module 30 runs the application program firmware, otherwise, an instruction receiving unit 202 receives an upgrading instruction and an upgrading unit 203 executes the upgrading of the application program firmware, wherein the bootstrap program comprises 3 values of a memory starting address preFlag1_ L, a memory ending address preFlag1_ H, a preset equipment matching value preFlag2 and a preset upgrading completion flag value preFlag3, the memory starting address preFlag1_ L, the memory ending address preFlag1_ H and a preset equipment matching value preFlag2 which are all correct to ensure that an upgraded file is correct, an incorrect program cannot be upgraded to equipment, the preset upgrading completion flag value preFlag3 is written in the final stage of the upgrading process, the correct value can ensure that all data are upgraded, the correct program is not powered down before the update is finished, the equipment is not abnormal, and the equipment can upgrade the application program again, so that errors in the firmware upgrading process of the electronic equipment are avoided.
In an embodiment, the instruction receiving unit 202 is capable of receiving the second upgrade instruction during the application program executing module 30 runs the application program firmware, and the application program executing module 30 sets the upgrade completion flag value in the application program firmware to a non-preset upgrade completion flag value, for example, zero; the bootstrap execution module 20 re-runs the bootstrap, and the determination unit 201 determines that the application firmware is invalid; the instruction receiving unit 202 receives the first upgrade instruction, the upgrade unit 203 can execute the upgrade of the application program firmware, and after the upgrade is completed, the upgrade completion flag value in the application program firmware is set to the preset upgrade completion flag value. And in the running process of the application program firmware, the upgrading of the application program firmware can be smoothly executed.
The invention also provides an application program firmware upgrading system, as shown in fig. 4, comprising an upper computer and the application program firmware upgrading device of the electronic equipment, wherein the upper computer is used for acquiring the working mode of the application program firmware upgrading device of the electronic equipment; and when the application program firmware upgrading device is in an application program working mode, the upper computer sends a second upgrading instruction to the application program firmware of the electronic equipment, the application program firmware upgrading device of the electronic equipment sets the upgrading completion flag value to a non-preset upgrading completion flag value, for example, zero clearing is carried out, and the application program firmware upgrading device of the electronic equipment executes application program firmware upgrading. The boot program working mode refers to a state that the application program firmware is judged to be invalid after the application program firmware upgrading device of the electronic equipment runs the boot program, so that the boot program is continuously run to wait for an upgrading instruction, and the application program working mode refers to a state that the application program firmware is judged to be valid and runs the application program firmware after the application program firmware upgrading device of the electronic equipment runs the boot program.
The working mode of the application program firmware upgrading device of the electronic equipment is judged firstly through the communication between the upper computer and the application program firmware upgrading device of the electronic equipment, different upgrading instructions are sent out according to the working mode, and the application program firmware upgrading device of the electronic equipment executes different processing according to the different upgrading instructions, so that the upgrading of the application program firmware is completed. The wrong program cannot be upgraded to the equipment, the power failure is avoided before the correct program is updated, the equipment is not abnormal, and the equipment can upgrade the firmware again.
As shown in fig. 5, which is a working flow chart of the firmware upgrading system of the present invention, after establishing a communication connection between the upper computer and the application firmware upgrading device of the electronic device, step S401 is executed, and the upper computer obtains a working mode of the application firmware upgrading device of the electronic device; step S402, the upper computer judges whether an application program firmware upgrading device of the electronic equipment is in a boot program working mode or an application program working mode, if the application program firmware upgrading device is in the boot program working mode, step S403 is executed, the upper computer sends a first upgrading instruction to the application program firmware upgrading device of the electronic equipment, and step S404, the application program firmware upgrading device of the electronic equipment executes upgrading; if the application program firmware upgrading device of the electronic device is in the application program working mode, step S405 is executed, the upper computer sends a second upgrading instruction to the application program firmware upgrading device of the electronic device, and step S406, the application program firmware upgrading device of the electronic device sets the upgrading completion flag value to a non-preset upgrading completion flag value, for example, zero clearing is performed, and the application program firmware upgrading device of the electronic device executes upgrading. Generally, before the upgrade starts, the host reads the file, determines whether a fixed length of data (Flag2) starting at a specific location is equal to preFlag2, and if not, indicates that the firmware does not match the current device, and the upgrade cannot be continued until the user loads the correct file.
It should be noted that step numbers (letter or number numbers) are used to refer to some specific method steps in the present invention only for the purpose of convenience and brevity of description, and the order of the method steps is not limited by letters or numbers in any way. It will be clear to a person skilled in the art that the order of the steps of the method in question, as determined by the technology itself, should not be unduly limited by the presence of step numbers.
It will be appreciated by those skilled in the art that the above-described preferred embodiments may be freely combined, superimposed, without conflict.
It will be understood that the embodiments described above are illustrative only and not restrictive, and that various obvious and equivalent modifications and substitutions for details described herein may be made by those skilled in the art without departing from the basic principles of the invention.

Claims (10)

1. An application firmware upgrading method for an electronic device, wherein a program storage area of the electronic device includes a boot program area and an application program area, a boot program is stored in the boot program area, and an application firmware is stored in the application program area, the method comprising:
operating the bootstrap program and judging whether the application program firmware is effective or not;
the bootstrap program comprises a memory starting address, a memory ending address, a preset equipment matching value and a preset upgrading completion flag value; determining whether the application firmware is valid comprises: judging whether the stack address of the application program firmware is in the range of the memory starting address and the memory ending address, judging whether a device matching value in the application program firmware is the same as the preset device matching value, and judging whether an upgrade completion flag value in the application program firmware is the same as the preset upgrade completion flag value, if so, considering the application program firmware to be valid, otherwise, considering the application program firmware to be invalid;
if the application program firmware is invalid, receiving a first upgrading instruction, and executing application program firmware upgrading;
and after the upgrading is finished, setting the upgrading finishing mark value in the application program firmware as the preset upgrading finishing mark value.
2. The method of claim 1, wherein the stack address comprises: the application firmware area starts a value consisting of N bytes of data.
3. The method of claim 1, wherein the device match value comprises: and starting program data with a continuous preset length from a preset fixed position in the application program firmware, wherein the preset length is the length of the preset equipment matching value.
4. The method of claim 3, wherein the device matching value further comprises model information of the electronic device.
5. The method of claim 1, wherein the upgrade complete flag value comprises: and the program value of the last fixed byte in the application program firmware.
6. The method for upgrading application firmware of an electronic device according to any one of claims 1 to 5,
if the application program firmware is valid, operating the application program firmware;
when a second upgrading instruction is received in the running process of the application program firmware, setting an upgrading completion flag value in the application program firmware as a non-preset upgrading completion flag value;
re-running the bootstrap program and determining that the application program firmware is invalid;
and the boot program receives the first upgrading instruction, upgrades the application program firmware, and sets an upgrading completion flag value in the application program firmware as the preset upgrading completion flag value.
7. An electronic device, characterized in that the application firmware of the electronic device can be upgraded by using the application firmware upgrading method of the electronic device according to any one of claims 1 to 6.
8. An application program firmware upgrading device of electronic equipment is characterized by comprising a boot program execution module and an application program firmware execution module, wherein the boot program execution module comprises a judgment unit, an instruction receiving unit and an upgrading unit,
the system comprises a bootstrap program execution module, a judgment unit and a control unit, wherein the bootstrap program execution module is used for running a bootstrap program, the application program firmware execution module is used for running an application program firmware, the judgment unit is used for judging whether the application program firmware is effective or not, and the bootstrap program comprises a memory starting address, a memory ending address, a preset equipment matching value and a preset upgrade completion flag value;
the judging unit comprises a first judging unit, a second judging unit and a third judging unit, wherein,
the first judging unit is used for judging whether the stack address of the application program firmware is in the range of the memory starting address and the memory ending address,
the second judging unit is used for judging whether the device matching value in the application program firmware is the same as the preset device matching value,
the third judging unit is used for judging whether the upgrading completion flag value in the application program firmware is the same as the preset upgrading completion flag value;
the judging unit can consider the application firmware to be valid if the judging results of the first judging unit, the second judging unit and the third judging unit are all yes, otherwise, the application firmware is considered to be invalid;
the instruction receiving unit can receive a first upgrading instruction when the application program firmware is invalid, the upgrading unit can execute application program firmware upgrading, and after upgrading is completed, an upgrading completion flag value in the application program firmware is set to be the preset upgrading completion flag value.
9. The apparatus for upgrading application firmware of an electronic device according to claim 8,
if the instruction receiving unit receives a second upgrading instruction in the process that the application program executing module runs the application program firmware, the application program executing module sets an upgrading completion flag value in the application program data to a non-preset upgrading completion flag value, the bootstrap program executing module runs the bootstrap program again, and the judging unit determines that the application program firmware is invalid;
after the instruction receiving unit receives the first upgrading instruction, the upgrading unit can execute upgrading of the application program firmware, and after upgrading is completed, the upgrading completion flag value in the application program firmware is set to be the preset upgrading completion flag value.
10. An application firmware upgrading system of an electronic device, comprising an upper computer and an application firmware upgrading device of the electronic device according to claim 8 or 9,
the upper computer is used for acquiring the working mode of the application program firmware upgrading device of the electronic equipment;
the upper computer sends a first upgrading instruction to an application program firmware upgrading device of the electronic equipment when the application program firmware upgrading device of the electronic equipment operates in a bootstrap working mode, and the application program firmware upgrading device of the electronic equipment executes application program upgrading;
and the upper computer sends a second upgrading instruction to the application program firmware upgrading device of the electronic equipment when the application program firmware upgrading device of the electronic equipment operates in an application program working mode, the application program firmware upgrading device of the electronic equipment sets the upgrading completion flag value to a non-preset upgrading completion flag value, and the application program firmware upgrading device of the electronic equipment executes the upgrading of the application program firmware.
CN202111192972.1A 2021-10-13 2021-10-13 Method, device and system for upgrading application program firmware of electronic equipment Pending CN114138295A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111192972.1A CN114138295A (en) 2021-10-13 2021-10-13 Method, device and system for upgrading application program firmware of electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111192972.1A CN114138295A (en) 2021-10-13 2021-10-13 Method, device and system for upgrading application program firmware of electronic equipment

Publications (1)

Publication Number Publication Date
CN114138295A true CN114138295A (en) 2022-03-04

Family

ID=80395135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111192972.1A Pending CN114138295A (en) 2021-10-13 2021-10-13 Method, device and system for upgrading application program firmware of electronic equipment

Country Status (1)

Country Link
CN (1) CN114138295A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115098176A (en) * 2022-07-25 2022-09-23 珠海普林芯驰科技有限公司 Chip starting guide and program upgrading method and chip architecture
CN115437670A (en) * 2022-09-06 2022-12-06 北京斯年智驾科技有限公司 TFTP-based automobile controller program upgrading system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115098176A (en) * 2022-07-25 2022-09-23 珠海普林芯驰科技有限公司 Chip starting guide and program upgrading method and chip architecture
CN115098176B (en) * 2022-07-25 2023-02-21 珠海普林芯驰科技有限公司 Chip starting guide and program upgrading method and chip architecture
CN115437670A (en) * 2022-09-06 2022-12-06 北京斯年智驾科技有限公司 TFTP-based automobile controller program upgrading system
CN115437670B (en) * 2022-09-06 2023-11-21 北京斯年智驾科技有限公司 Automobile controller program upgrading system based on TFTP

Similar Documents

Publication Publication Date Title
TWI384367B (en) System of updating firmware and method thereof
EP3080693B1 (en) Devices, updaters, methods for controlling a device, and methods for controlling an updater
CN102945173B (en) User program online upgrade system and upgrade method
CN114138295A (en) Method, device and system for upgrading application program firmware of electronic equipment
WO2020062887A1 (en) Firmware upgrading method and system based on flash micro-controller, and flash micro-controller
US11995427B2 (en) Method, apparatus, device, and storage medium for upgrading vehicle-mounted Tbox
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
CN105677398A (en) Universal embedded computer software on-line upgrading method
CN112947978A (en) Method for upgrading firmware based on chip usbhid, terminal device and computer readable storage medium
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN103092659A (en) Digital signal processor (DSP) software upgrading system and upgrading method separated from support environment of emulator
CN112433769A (en) BMC starting method and device, computer equipment and storage medium
KR101197152B1 (en) Electronic device, electronic device system and control method thereof
CN110908733B (en) Working mode determining method and device, and control method and device
US11061689B2 (en) Synchronization method for performing bi-directional data synchronization for bios
CN102184115B (en) Method for updating system software and terminal device
CN114816491A (en) System upgrading method and device for multi-system mobile terminal and terminal
CN116755749A (en) On-board MCU upgrading method, on-board MCU, board card and information processing system
CN116301995A (en) Firmware upgrading method based on bootloader architecture
CN108052337A (en) A kind of firmware upgrade method and device of eMMC production tools
CN113377425A (en) BMC firmware generation method and device, BMC starting method and device and storage medium
CN106611124A (en) Computer device and boot method thereof
CN115437674B (en) Firmware upgrading method, device, medium and electronic equipment
KR100624723B1 (en) Mobile communication terminal managing hardware version and its operating method
CN115878149A (en) Firmware upgrading method, device, equipment and storage medium

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