CN113535201A - Firmware loading and upgrading mechanism for improving success rate of firmware upgrading - Google Patents

Firmware loading and upgrading mechanism for improving success rate of firmware upgrading Download PDF

Info

Publication number
CN113535201A
CN113535201A CN202110682684.8A CN202110682684A CN113535201A CN 113535201 A CN113535201 A CN 113535201A CN 202110682684 A CN202110682684 A CN 202110682684A CN 113535201 A CN113535201 A CN 113535201A
Authority
CN
China
Prior art keywords
upgrading
upgrade
application program
firmware
package
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
CN202110682684.8A
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 Hongxing Zhilian Technology Co ltd
Original Assignee
Shenzhen Hongxing Zhilian 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 Hongxing Zhilian Technology Co ltd filed Critical Shenzhen Hongxing Zhilian Technology Co ltd
Priority to CN202110682684.8A priority Critical patent/CN113535201A/en
Publication of CN113535201A publication Critical patent/CN113535201A/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
    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Landscapes

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

Abstract

The invention provides a firmware loading and upgrading mechanism for improving the success rate of firmware upgrading, and relates to the technical field of hardware upgrading. The firmware loading and upgrading mechanism for improving the success rate of firmware upgrading comprises an application program remote upgrading error proofing mechanism and process, and a BOOTLOADER loading application program error proofing mechanism and processing process, wherein the application program remote upgrading error proofing mechanism and process comprise AT command check, upgrading packet check, MD5 check and writing upgrading marks. The firmware upgrading mechanism of the invention is mainly applied to the upgrading of the application program of an embedded product and the loading of the application program of BOOTOLADER, in order to prevent the crash of the product caused by the error upgrading of the hardware version of different products, when the application program is compiled, the code number of the hardware chip version (different chip code numbers are configured for different chips) and the software version (different software version segments are distributed for different products) are written into a certain position of a program code, and MD5 verification is added at the tail of the program when the upgrading program is manufactured, so as to prevent the error of the verification of the package after the upgrading and the receiving are completed.

Description

Firmware loading and upgrading mechanism for improving success rate of firmware upgrading
Technical Field
The invention relates to the technical field of hardware upgrading, in particular to a firmware loading and upgrading mechanism for improving the success rate of firmware upgrading.
Background
Firmware is a program written in EPROM (erasable programmable read only memory) or EEPROM (electrically erasable programmable read only memory). The firmware refers to a device "driver" stored in the device, and through the firmware, the operating system can implement the operation of a specific machine according to the standard device driver, for example, the optical disc drive and the recorder have internal firmware. Firmware is software that acts as the most basic and bottom layer of a system. In a hardware device, the firmware is the soul of the hardware device, and because some hardware devices have no other software components except for the firmware, the firmware determines the functions and performances of the hardware device.
In the prior art, when firmware is upgraded, hardware versions of different products are upgraded mistakenly, so that the products are halted, and data loss is caused to cause large loss.
Disclosure of Invention
Technical problem to be solved
Aiming at the defects of the prior art, the invention provides a firmware loading and upgrading mechanism for improving the success rate of firmware upgrading, and solves the problem that the products are halted due to the wrong upgrading of hardware versions of different products.
(II) technical scheme
In order to achieve the purpose, the invention is realized by the following technical scheme: a firmware loading and upgrading mechanism for improving the success rate of firmware upgrading comprises an application program remote upgrading error proofing mechanism and process, and a BOOTLOADER loading application program error proofing mechanism and process, wherein the application program remote upgrading error proofing mechanism and process comprises AT command check, upgrading packet check, MD5 check, writing upgrading mark, file size, file CRC16 and upgrading head CRC16, and the BOOTLOADER loading application program error proofing mechanism and process comprises product power-on or reset, upgrading mark reading and on-chip LASH application program and on-chip FLASH comparison consistency verification.
Preferably, the remote upgrading and error proofing mechanism and the process of the application program comprise the following steps:
step one, AT command check is carried out when the upgrade is started, whether the first frame is upgraded or not is selected when the upgraded AT command is received, and the AT command check is continuously executed if the upgraded AT command is received;
step two, whether the first frame is upgraded or not is selected
a. When the first frame of the upgrade is not selected, checking an upgrade package, if the upgrade package has no problem, requesting a next-level upgrade package, if the upgrade package has the problem, checking the MD5, if the upgrade package has the problem, requesting the current upgrade package and executing the upgrade package from the first step again, and if the MD5 checks the upgrade package has the problem, terminating the upgrade and executing the upgrade package from the first step again;
b. when the first frame is selected to be upgraded, checking whether the chip version is matched with the software version, if so, storing upgrading parameters, requesting a next-stage upgrading package, and if not, executing the first step again;
and step three, performing MD5 check after receiving the next-level upgrade package, writing an upgrade flag, a file size, a file CRC16 and an upgrade header CRC16 and performing reset hardware processing if the check is passed, executing the step one again if the check is not passed, and executing the step one again if the next-level upgrade package is not received.
Preferably, the upgrade package check includes checking of package size, block number, current package CRC and full package MD5, and the saved upgrade parameters include file size, upgrade type, upgrade package size and MD5 check data.
Preferably, the BOOTLOADER loading application program error-proofing mechanism and the processing flow steps are as follows:
step one, electrifying or resetting the product, and reading an upgrading mark
a. Skipping to the application program when the upgrading mark is invalid;
b. the upgrading mark is valid, whether CRC16 of the FLAS outside the chip is qualified is checked, if not, the application program is skipped to, if the application program is qualified, the application program is stored in the FLASH outside the chip to the FLASH inside the chip, and whether the application program of the FLASH outside the chip is consistent with the FLASH inside the chip is detected;
and step three, if the application program of the FLASH outside the chip is consistent with the FLASH inside the chip, skipping to a program, and if not, resetting the product and executing the step one again.
(III) advantageous effects
The invention provides a firmware loading and upgrading mechanism for improving the success rate of firmware upgrading. The method has the following beneficial effects:
the firmware upgrading mechanism is mainly applied to upgrading of an embedded product application program and loading of the BOOTOLADER application program, in order to prevent the product from crashing caused by wrong upgrading of hardware versions of different products, when the application program is compiled, a hardware chip version code (different chips are configured with different chip codes) and a software version (different products are distributed with different software version segments) are written into a certain position of a program code, MD5 verification is added at the tail of the program when the upgrading program is manufactured, and the package verification error after the upgrading is received is prevented.
Drawings
Fig. 1 is a flow chart of a firmware loading and upgrading mechanism for improving the success rate of firmware upgrading according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
as shown in fig. 1, an embodiment of the present invention provides a firmware loading and firmware upgrading mechanism for increasing a success rate of firmware upgrading, which includes an application remote upgrade error protection mechanism and process, and a bootload application error protection mechanism and process, where the application remote upgrade error protection mechanism and process include AT command check, upgrade package check, MD5 check, write upgrade flag, file size, file CRC16, and upgrade header CRC16, and the bootload application error protection mechanism and process includes product power-on or reset, reading upgrade flag, and verifying whether an on-chip LASH application is consistent with an off-chip FLASH.
The application program remote upgrading error proofing mechanism and the process steps are as follows:
step one, AT command check is carried out when the upgrade is started, whether the first frame is upgraded or not is selected when the upgraded AT command is received, and the AT command check is continuously executed if the upgraded AT command is received;
step two, whether the first frame is upgraded or not is selected
a. When the first frame of the upgrade is not selected, checking an upgrade package, if the upgrade package has no problem, requesting a next-level upgrade package, if the upgrade package has the problem, checking the MD5, if the upgrade package has the problem, requesting the current upgrade package and executing the upgrade package from the first step again, and if the MD5 checks the upgrade package has the problem, terminating the upgrade and executing the upgrade package from the first step again;
b. when the first frame is selected to be upgraded, checking whether the chip version is matched with the software version, if so, storing upgrading parameters, requesting a next-stage upgrading package, and if not, executing the first step again;
and step three, performing MD5 check after receiving the next-level upgrade package, writing an upgrade flag, a file size, a file CRC16 and an upgrade header CRC16 and performing reset hardware processing if the check is passed, executing the step one again if the check is not passed, and executing the step one again if the next-level upgrade package is not received.
Upgrade package inspection includes inspection of package size, block number, current package CRC and full package MD5, and saved upgrade parameters include file size, upgrade type, upgrade package size and MD5 check data.
The BOOTLOADER loading application program error-proofing mechanism and the processing flow comprise the following steps:
step one, electrifying or resetting the product, and reading an upgrading mark
a. Skipping to the application program when the upgrading mark is invalid;
b. the upgrading mark is valid, whether CRC16 of the FLAS outside the chip is qualified is checked, if not, the application program is skipped to, if the application program is qualified, the application program is stored in the FLASH outside the chip to the FLASH inside the chip, and whether the application program of the FLASH outside the chip is consistent with the FLASH inside the chip is detected;
and step three, if the application program of the FLASH outside the chip is consistent with the FLASH inside the chip, skipping to a program, and if not, resetting the product and executing the step one again.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (4)

1. A firmware loading and upgrading mechanism for improving success rate of firmware upgrading is characterized in that: the method comprises an application program remote upgrading and error proofing mechanism and process, and a BOOTLOADER loading application program error proofing mechanism and process, wherein the application program remote upgrading and error proofing mechanism and process comprises AT command check, upgrade package check, MD5 check, writing upgrade flag, file size, file CRC16 and upgrade header CRC16, and the BOOTLOADER loading application program error proofing mechanism and process comprises product power-on or reset, upgrade flag reading and verification of consistency between an on-chip LASH application program and an off-chip FLASH.
2. The mechanism of claim 1 for improving success rate of firmware upgrade, comprising: the remote upgrading and error proofing mechanism and the process of the application program comprise the following steps:
step one, AT command check is carried out when the upgrade is started, whether the first frame is upgraded or not is selected when the upgraded AT command is received, and the AT command check is continuously executed if the upgraded AT command is received;
step two, whether the first frame is upgraded or not is selected
a. When the first frame of the upgrade is not selected, checking an upgrade package, if the upgrade package has no problem, requesting a next-level upgrade package, if the upgrade package has the problem, checking the MD5, if the upgrade package has the problem, requesting the current upgrade package and executing the upgrade package from the first step again, and if the MD5 checks the upgrade package has the problem, terminating the upgrade and executing the upgrade package from the first step again;
b. when the first frame is selected to be upgraded, checking whether the chip version is matched with the software version, if so, storing upgrading parameters, requesting a next-stage upgrading package, and if not, executing the first step again;
and step three, performing MD5 check after receiving the next-level upgrade package, writing an upgrade flag, a file size, a file CRC16 and an upgrade header CRC16 and performing reset hardware processing if the check is passed, executing the step one again if the check is not passed, and executing the step one again if the next-level upgrade package is not received.
3. The mechanism of claim 2 for improving success rate of firmware upgrade, comprising: upgrade package inspection includes inspection of package size, block number, current package CRC and full package MD5, and saved upgrade parameters include file size, upgrade type, upgrade package size and MD5 check data.
4. The mechanism of claim 1 for improving success rate of firmware upgrade, comprising: the BOOTLOADER loading application program error-proofing mechanism and the processing flow comprise the following steps:
step one, electrifying or resetting the product, and reading an upgrading mark
a. Skipping to the application program when the upgrading mark is invalid;
b. the upgrading mark is valid, whether CRC16 of the FLAS outside the chip is qualified is checked, if not, the application program is skipped to, if the application program is qualified, the application program is stored in the FLASH outside the chip to the FLASH inside the chip, and whether the application program of the FLASH outside the chip is consistent with the FLASH inside the chip is detected;
and step three, if the application program of the FLASH outside the chip is consistent with the FLASH inside the chip, skipping to a program, and if not, resetting the product and executing the step one again.
CN202110682684.8A 2021-06-20 2021-06-20 Firmware loading and upgrading mechanism for improving success rate of firmware upgrading Pending CN113535201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110682684.8A CN113535201A (en) 2021-06-20 2021-06-20 Firmware loading and upgrading mechanism for improving success rate of firmware upgrading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110682684.8A CN113535201A (en) 2021-06-20 2021-06-20 Firmware loading and upgrading mechanism for improving success rate of firmware upgrading

Publications (1)

Publication Number Publication Date
CN113535201A true CN113535201A (en) 2021-10-22

Family

ID=78125263

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110682684.8A Pending CN113535201A (en) 2021-06-20 2021-06-20 Firmware loading and upgrading mechanism for improving success rate of firmware upgrading

Country Status (1)

Country Link
CN (1) CN113535201A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090119657A1 (en) * 2007-10-24 2009-05-07 Link Ii Charles M Methods and systems for software upgrades
CN110389778A (en) * 2019-07-19 2019-10-29 苏州浪潮智能科技有限公司 A kind of isomery accelerates the MCU firmware upgrade method and relevant apparatus of platform

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090119657A1 (en) * 2007-10-24 2009-05-07 Link Ii Charles M Methods and systems for software upgrades
CN110389778A (en) * 2019-07-19 2019-10-29 苏州浪潮智能科技有限公司 A kind of isomery accelerates the MCU firmware upgrade method and relevant apparatus of platform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FILIPPO COSTA等: "The ALICE C-RORC GBT card, a prototype readout solution for the ALICE upgrade", 《2016 IEEE-NPSS REAL TIME CONFERENCE (RT)》, 15 August 2016 (2016-08-15), pages 1 - 5 *
谭凡: "智能网联汽车FOTA系统安全机制的研究与实现", 《CNKI优秀硕士学位论文全文库 工程科技Ⅱ辑》, no. 07, 15 July 2020 (2020-07-15), pages 035 - 299 *

Similar Documents

Publication Publication Date Title
US7774382B2 (en) Method and apparatus for configuring a control device, and corresponding control device
CN109189405B (en) Method and system for verifying Flash data consistency of program
US9086961B2 (en) Repair method and device for abnormal-erase memory block of non-volatile flash memory
CN103577275B (en) A kind of method, apparatus and system of data check
US9418224B2 (en) Portable electronic device and control method of portable electronic device
US8601464B2 (en) Memory online update system and method
CN111190629B (en) Embedded terminal upgrading software package and analysis method thereof
US20140173179A1 (en) Virtual boundary codes in a data image of a read-write memory device
CN112540725A (en) Nonvolatile data storage method, embedded system and storage medium
CN114860279A (en) Rapid empty-film upgrading method
CN114443175B (en) Startup configuration method for missile-borne FPGA (field programmable Gate array) online upgrading
US9721665B2 (en) Data writing method and system
US20050240719A1 (en) Controller including electrically rewritable nonvolatile memory
CN107894899B (en) ROM program upgrading system and upgrading method
CN113535201A (en) Firmware loading and upgrading mechanism for improving success rate of firmware upgrading
CN112559071A (en) Segmented dual-redundancy boot loading method for DSP
US7979736B2 (en) Method for updating nonvolatile memory
CN116755735A (en) Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium
US20090077445A1 (en) Nonvolatile storage device, controller of nonvolatile memory, and nonvolatile storage system
CN114356365A (en) Remote updating method based on PSoC chip
US8302182B2 (en) Embedded system with authentication, and associated authentication method
CN102708927A (en) Method for improving reliability of storage, and flash memory operating method
US20060143369A1 (en) Nonvolatile memory and card reader provided with the same
CN110888605A (en) EEPROM data writing method and device and electronic equipment
JP5786702B2 (en) Security token, instruction execution method in security token, and computer program

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