CN114090045A - Firmware upgrading method applied to multi-singlechip control system and related equipment - Google Patents
Firmware upgrading method applied to multi-singlechip control system and related equipment Download PDFInfo
- Publication number
- CN114090045A CN114090045A CN202111413721.1A CN202111413721A CN114090045A CN 114090045 A CN114090045 A CN 114090045A CN 202111413721 A CN202111413721 A CN 202111413721A CN 114090045 A CN114090045 A CN 114090045A
- Authority
- CN
- China
- Prior art keywords
- target
- upgrading
- chip microcomputer
- single chip
- program
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 73
- 238000012795 verification Methods 0.000 claims abstract description 22
- 238000004590 computer program Methods 0.000 claims description 12
- 230000015654 memory Effects 0.000 claims description 6
- 238000004891 communication Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 8
- 238000012423 maintenance Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4405—Initialisation of multiprocessor systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4406—Loading of operating system
- G06F9/441—Multiboot arrangements, i.e. selecting an operating system to be loaded
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a firmware upgrading method applied to a multi-singlechip control system, which comprises the following steps: when the main singlechip receives a firmware upgrading instruction of the upper computer, searching a corresponding target singlechip, setting an upgrading mark for the target singlechip, and restarting the target singlechip; when the target single chip microcomputer operates a firmware starting module of the target single chip microcomputer and detects that an upgrading mark is set, backing up a current application program of the target single chip microcomputer to a backup module, and acquiring a target upgrading program from an upper computer; storing the target upgrading program to an application program module, clearing an upgrading mark and restarting; when the target single chip microcomputer operates a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is removed, verifying a target upgrading program; and if the verification is passed, operating the target upgrading program. The method can obviously reduce the difficulty in upgrading the firmware of the single chip microcomputer and is more convenient for the staff to upgrade and maintain the multi-single chip microcomputer control system.
Description
Technical Field
The invention relates to the technical field of servers, in particular to a firmware upgrading method, device, equipment and medium applied to a multi-singlechip control system.
Background
With the rapid development of embedded technology, the functions of embedded devices are increasing. In this technical background, a plurality of single-chip microcomputers are usually integrated into a control system to meet the needs of actual conditions, so as to form a control system with a plurality of single-chip microcomputers.
In the using process of the multiple-single-chip microcomputer control system, in order to meet the continuously developed application requirements, firmware upgrading is generally required to be performed on one single-chip microcomputer or a plurality of single-chip microcomputers in the multiple-single-chip microcomputer control system. Because the types and the structures of the single-chip microcomputers integrated in the multi-single-chip microcomputer control system are different, the firmware upgrading method of each single-chip microcomputer is also greatly different. Such as: when the single chip microcomputer with the program downloading interface is used for upgrading the firmware, the multi-single chip microcomputer control system needs to be dismounted, and then a special burning tool is used for burning and upgrading the single chip microcomputer control system; when the single chip without the program downloading interface is used for upgrading the firmware, the chip with the latest application program needs to be replaced; even when some single-chip microcomputers are used for upgrading the firmware, a circuit special for a jump program needs to be designed to upgrade the firmware of the single-chip microcomputers. Moreover, because the communication protocols of the single-chip microcomputers from various manufacturers are different, the difficulty in upgrading the firmware of the multi-single-chip microcomputer control system is increased, and the multi-single-chip microcomputer control system is not convenient for the upgrading and maintenance of workers. At present, no effective solution exists for the technical problem.
Disclosure of Invention
In view of this, an object of the present invention is to provide a firmware upgrading method, apparatus, device and medium for a multiple-mcu control system, so as to reduce the difficulty in upgrading the firmware of the single-chip microcomputer and facilitate the upgrade and maintenance of the multiple-mcu control system by the staff. The specific scheme is as follows:
a firmware upgrading method applied to a multi-single-chip control system comprises the following steps: the system comprises a main singlechip and a plurality of sub-singlechips connected with the main singlechip; each single chip microcomputer is provided with a firmware starting module for guiding the single chip microcomputer to start, an application program module for storing an application program, an information storage module for storing attribute information of the application program module and a backup module for backing up and storing the application program; the method comprises the following steps:
when the main singlechip receives a firmware upgrading instruction of an upper computer, searching a target singlechip corresponding to the firmware upgrading instruction, setting an upgrading mark for an information storage module of the target singlechip, and resetting and restarting the target singlechip;
when the target single chip microcomputer runs a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is set, backing up a current application program of the target single chip microcomputer to a backup module of the target single chip microcomputer, and acquiring a target upgrading program from the upper computer;
when the target single chip microcomputer obtains the target upgrading program, the target upgrading program is stored to an application program module of the target single chip microcomputer, the upgrading mark is cleared, and the target single chip microcomputer is reset and restarted;
when the target single chip microcomputer runs a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is removed, verifying the target upgrading program;
and if the target upgrading program passes the verification, operating the target upgrading program.
Preferably, the target single chip microcomputer comprises the main single chip microcomputer and the sub single chip microcomputer.
Preferably, after the process of verifying the target upgrade program, the method further includes:
and if the target upgrading program does not pass the verification, reading the current application program of the target single chip microcomputer from the backup module of the target single chip microcomputer, storing the current application program of the target single chip microcomputer to the information storage module of the target single chip microcomputer, and resetting and restarting the target single chip microcomputer.
Preferably, after the process of running the target upgrade program, the method further includes:
and if the target single chip receives a new firmware upgrading instruction, setting the upgrading mark for the information storage module of the target single chip, and resetting and restarting the target single chip.
Preferably, also includes;
when the upper computer needs to update the firmware of the target single chip microcomputer, downloading the target updating program and verifying the target updating program;
and if the target upgrading program passes the verification, sending the target upgrading program to the main singlechip.
Preferably, the downloading of the target upgrade program includes:
and downloading the target upgrading program by using a Ymodem protocol.
Correspondingly, the invention also discloses a firmware upgrading device applied to the multi-singlechip control system, and the multi-singlechip control system comprises: the system comprises a main singlechip and a plurality of sub-singlechips connected with the main singlechip; each single chip microcomputer is provided with a firmware starting module for guiding the single chip microcomputer to start, an application program module for storing an application program, an information storage module for storing attribute information of the application program module and a backup module for backing up and storing the application program; the method comprises the following steps:
the mark setting module is used for searching a target singlechip corresponding to a firmware upgrading instruction when the main singlechip receives the firmware upgrading instruction of the upper computer, setting an upgrading mark for an information storage module of the target singlechip and resetting and restarting the target singlechip;
the program acquisition module is used for backing up the current application program of the target single chip microcomputer to the backup module of the target single chip microcomputer when the target single chip microcomputer runs the firmware starting module of the target single chip microcomputer and detects that the upgrading mark is set, and acquiring the target upgrading program from the upper computer;
the mark clearing module is used for storing the target upgrading program to an application program module of the target single chip microcomputer when the target single chip microcomputer obtains the target upgrading program, clearing the upgrading mark and resetting and restarting the target single chip microcomputer;
the program checking module is used for checking the target upgrading program when the target single chip microcomputer runs a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is removed;
and the program running module is used for running the target upgrading program if the target upgrading program passes the verification.
Correspondingly, the invention also discloses firmware upgrading equipment applied to the multi-singlechip control system, which comprises the following components:
a memory for storing a computer program;
and the processor is used for realizing the steps of the firmware upgrading method applied to the multi-singlechip control system as disclosed in the foregoing when executing the computer program.
Correspondingly, the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the firmware upgrading method applied to the multi-singlechip control system are realized as disclosed in the foregoing.
It can be seen that in the firmware upgrading method provided by the present invention, a firmware start module for guiding the single chip microcomputer to start, an application program module for storing the application program, an information storage module for storing the attribute information of the application program module, and a backup module for backing up and storing the application program are previously set for each single chip microcomputer in the multiple single chip microcomputer control system; when a main singlechip in the multi-singlechip control system receives a firmware upgrading instruction of an upper computer, the main singlechip searches a target singlechip corresponding to the firmware upgrading instruction and sets an upgrading mark for an information storage module of the target singlechip; when the target single chip microcomputer operates the firmware starting module of the target single chip microcomputer and detects that the upgrading mark is set, the current application program of the target single chip microcomputer is backed up to the backup module of the target single chip microcomputer, and the target upgrading program is obtained from the upper computer through the main single chip microcomputer; when the target single chip acquires the target upgrading program, the target upgrading program is stored in an application program module of the target single chip, an upgrading mark in an information storage module is cleared, and the target single chip resets and restarts the target single chip; and after the target single chip microcomputer is reset and restarted, if the upgrading mark in the information storage module is detected to be cleared, reading the target upgrading program from the application program module, verifying the target upgrading program, and if the target upgrading program passes the verification, operating the target upgrading program. Compared with the prior art, the method can be used for upgrading any single chip microcomputer in the multi-single-chip microcomputer control system, and is not limited by the type and the set attribute of the single chip microcomputer, so that the difficulty in upgrading the firmware of the single chip microcomputer can be obviously reduced through the method, and meanwhile, the upgrading and maintenance of the multi-single-chip microcomputer control system by workers are facilitated. Correspondingly, the firmware upgrading device, the equipment and the medium applied to the multi-singlechip control system also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a firmware upgrading method applied to a multi-mcu control system according to an embodiment of the present invention;
FIG. 2 is a block diagram of a multi-SCM control system in the prior art;
FIG. 3 is a schematic diagram of the allocation of flash memory in a single chip microcomputer;
FIG. 4 is an overall flow chart of firmware upgrade of a multi-SCM control system;
FIG. 5 is a flow chart of firmware upgrade performed by a target single chip microcomputer;
fig. 6 is a structural diagram of a firmware upgrading apparatus applied to a multi-mcu control system according to an embodiment of the present invention;
fig. 7 is a structural diagram of a firmware upgrading device applied to a multi-mcu control system according to an embodiment of 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.
Referring to fig. 1, fig. 1 is a flowchart of a firmware upgrading method applied to a multiple-single-chip microcomputer control system according to an embodiment of the present invention, where the multiple-single-chip microcomputer control system includes: the system comprises a main singlechip and a plurality of sub-singlechips connected with the main singlechip; each single chip microcomputer is provided with a firmware starting module for guiding the single chip microcomputer to start, an application program module for storing an application program, an information storage module for storing attribute information of the application program module and a backup module for backing up and storing the application program; the method comprises the following steps:
step S11: when the main singlechip receives a firmware upgrading instruction of the upper computer, searching a target singlechip corresponding to the firmware upgrading instruction, setting an upgrading mark for an information storage module of the target singlechip, and resetting and restarting the target singlechip;
step S12: when the target single chip microcomputer operates a firmware starting module of the target single chip microcomputer and detects that an upgrading mark is set, backing up a current application program of the target single chip microcomputer to a backup module of the target single chip microcomputer, and acquiring a target upgrading program from an upper computer;
step S13: when the target single chip microcomputer obtains the target upgrading program, the target upgrading program is stored to an application program module of the target single chip microcomputer, the upgrading mark is cleared, and the target single chip microcomputer is reset and restarted;
step S14: when the target single chip microcomputer runs a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is removed, verifying a target upgrading program;
step S15: and if the target upgrading program passes the verification, operating the target upgrading program.
In this embodiment, a firmware upgrading method applied to a multi-mcu control system is provided, by which not only the difficulty in upgrading the firmware of a single chip microcomputer can be reduced, but also the upgrading and maintenance of the multi-mcu control system by a worker can be facilitated.
Referring to fig. 2, fig. 2 is a structural diagram of a multi-mcu control system in the prior art, which mainly includes: the device comprises a data acquisition processing module, a sub-single chip microcomputer, a main single chip microcomputer, a communication interface module, a power supply module and an upper computer. The data acquisition and processing module is used for converting measured information detected by the sensor into an electric signal or other required information formats according to a certain rule and outputting the electric signal or other required information formats; the sub-single-chip microcomputer is used for being in charge of data acquisition and processing which are respectively connected with the data acquisition and processing module, and communicating with the main single-chip microcomputer, wherein the modes of communication between the sub-single-chip microcomputer and the main single-chip microcomputer comprise a Serial port, a Serial Peripheral Interface (SPI), an Inter Integrated Circuit (IIC) and the like. The main singlechip is used for controlling data acquisition and processing of input and output modules such as the sub singlechip, the control keys, the display module and the like; the communication interface module is used for communicating with an upper computer, and the communication mode comprises the following steps: communication modes such as USB (Universal Serial Bus), 2G (mobile phone communication technology, mobile phone communication specification)/3G/4G/5G, WIFI (wireless communication technology), and bluetooth; the power supply module is used for supplying power to each device in the multi-singlechip control system; the upper computer is used for carrying out instruction communication and issuing and reading of firmware programs with each single chip microcomputer.
Compared with the prior art, in the multi-singlechip control system provided in this embodiment, a main singlechip and a plurality of sub-singlechips connected to the main singlechip are provided, and each singlechip is provided with a firmware starting module for guiding itself to start, an application program module for storing an application program, an information storage module for storing attribute information of the application program module, and a backup module for backing up and storing the application program.
Specifically, in the actual operation process, different addresses in the flash memory inside each single chip microcomputer can be allocated to different program modules. Referring to fig. 3, fig. 3 is a schematic diagram illustrating allocation of flash memories in a single chip microcomputer. In fig. 3, the firmware start module is used to guide the single chip to start, including jumping to an application program for operation, updating the application program, backing up the application program, reading and writing program information, and the like; the application program module is used for storing application programs of the system; the information storage module is used for storing the version information, upgrading state and other marks of the application program, verification information and other contents; the backup module is used for backing up the application program, and the firmware starting module is used for backing up the original application program to the area before the new application program is upgraded so as to ensure that the system can normally run after the application program is damaged.
In this embodiment, when a main single chip in the multi-chip microcomputer control system receives a firmware upgrade instruction of an upper computer, the main single chip searches for a target single chip corresponding to the firmware upgrade instruction, where the target single chip includes both the main single chip and the sub-single chip. That is, the firmware upgrading instruction sent by the upper computer can be used for upgrading the firmware of the main singlechip and can also be used for upgrading the firmware of the sub singlechip. In other words, the firmware upgrading methods of all the single-chip microcomputers in the multi-chip microcomputer control system are kept consistent.
And when the main singlechip finds the target singlechip corresponding to the firmware upgrading instruction, setting an upgrading mark in an information storage module of the target singlechip, and resetting and restarting the target singlechip. When the target single chip microcomputer is reset and restarted and runs a firmware starting module, if the condition that an upgrading mark is set in an information storage module of the target single chip microcomputer is detected, the target single chip microcomputer firstly backs up a current application program of the target single chip microcomputer to a backup module of the target single chip microcomputer and acquires a target upgrading program from an upper computer; when the target single chip microcomputer obtains the target upgrading program sent by the upper computer, the target single chip microcomputer stores the target upgrading program into the application program module of the target single chip microcomputer, meanwhile, the upgrading mark in the information storage module of the target single chip microcomputer is cleared, and the target single chip microcomputer resets and restarts the target single chip microcomputer.
After the target single chip microcomputer is reset and restarted, corresponding program skipping is carried out under the guidance of the firmware starting module, and if the target single chip microcomputer detects that the upgrading mark in the information storage module is cleared, the latest upgrading program of the application program is stored in the application program module of the target single chip microcomputer, namely the target upgrading program. In this case, the target single chip microcomputer verifies the target upgrading program, and if the target upgrading program passes the verification, the target upgrading program is not tampered, and the information stored in the target upgrading program is not lost, so that the target single chip microcomputer runs the target upgrading program.
It can be understood that, because the method can upgrade any single chip microcomputer in the multi-single chip microcomputer control system, and is not limited by the type and the set attribute of the single chip microcomputer, the difficulty in upgrading the firmware of the single chip microcomputer can be obviously reduced by the method, and meanwhile, the method is more convenient for the upgrade maintenance of the multi-single chip microcomputer control system by the staff.
It can be seen that, in the firmware upgrading method provided in this embodiment, a firmware starting module for guiding each single chip in the multiple single chip control systems to start itself, an application program module for storing an application program, an information storage module for storing attribute information of the application program module, and a backup module for backing up and storing the application program are preset for each single chip; when a main singlechip in the multi-singlechip control system receives a firmware upgrading instruction of an upper computer, the main singlechip searches a target singlechip corresponding to the firmware upgrading instruction and sets an upgrading mark for an information storage module of the target singlechip; when the target single chip microcomputer operates the firmware starting module of the target single chip microcomputer and detects that the upgrading mark is set, the current application program of the target single chip microcomputer is backed up to the backup module of the target single chip microcomputer, and the target upgrading program is obtained from the upper computer through the main single chip microcomputer; when the target single chip acquires the target upgrading program, the target upgrading program is stored in an application program module of the target single chip, an upgrading mark in an information storage module is cleared, and the target single chip resets and restarts the target single chip; and after the target single chip microcomputer is reset and restarted, if the upgrading mark in the information storage module is detected to be cleared, reading the target upgrading program from the application program module, verifying the target upgrading program, and if the target upgrading program passes the verification, operating the target upgrading program. Compared with the prior art, the method can be used for upgrading any single chip microcomputer in the multi-single-chip microcomputer control system, and is not limited by the type and the set attribute of the single chip microcomputer, so that the difficulty in upgrading the firmware of the single chip microcomputer can be obviously reduced through the method, and meanwhile, the upgrading and maintenance of the multi-single-chip microcomputer control system by workers are facilitated.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: after the process of verifying the target upgrading program, the method further comprises the following steps:
and if the target upgrading program does not pass the verification, reading the current application program of the target single chip microcomputer from the backup module of the target single chip microcomputer, storing the current application program of the target single chip microcomputer into the information storage module of the target single chip microcomputer, and resetting and restarting the target single chip microcomputer.
It can be understood that, if the target single chip microcomputer does not pass the verification in the process of verifying the target upgrading program, it indicates that the target upgrading program is tampered or has other problems, and at this time, in order to ensure the safe and stable operation of the multi-chip microcomputer control system, the target single chip microcomputer reads the current application program of the target single chip microcomputer from its own backup module, stores the current application program of the target single chip microcomputer into its own information storage module, and resets and restarts itself at the same time.
Therefore, the technical scheme provided by the embodiment can further ensure the overall reliability of the multi-singlechip control system in the operation process.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: after the process of running the target upgrading program, the method further comprises the following steps:
and if the target single chip receives a new firmware upgrading instruction, setting an upgrading mark for the information storage module of the target single chip, and resetting and restarting the target single chip.
If the target single chip microcomputer receives a new firmware upgrading instruction sent by the upper computer in the process of running the target upgrading program, the target single chip microcomputer indicates that the upper computer needs to continuously upgrade the target upgrading program, and at the moment, the target single chip microcomputer sets an upgrading mark in an information storage module of the target single chip microcomputer and resets and restarts the target single chip microcomputer.
It can be thought that when the target single chip microcomputer sets the upgrade flag in the information storage module of the target single chip microcomputer itself, the target single chip microcomputer re-enters the step S12 after reset and restart, so that the target single chip microcomputer can be guaranteed to be able to upgrade itself accurately and reliably, and upgrade the firmware of the target single chip microcomputer to the latest version.
Based on the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the firmware upgrading method further includes:
when the upper computer needs to update the firmware of the target singlechip, downloading a target updating program and verifying the target updating program;
and if the target upgrading program passes the verification, sending the target upgrading program to the main single chip computer.
In practical application, if a user needs to upgrade the firmware of a target singlechip in a multi-singlechip control system, firstly, a target upgrading program for upgrading the firmware of the target singlechip is downloaded to an upper computer; then, in order to ensure the safety and reliability of the target upgrading program, the upper computer checks the target upgrading program; and if the target upgrading program passes the verification of the upper computer, the target upgrading program is not tampered and is not lost. Under the condition, the upper computer sends the target upgrading program to the main single chip microcomputer and the main single chip microcomputer sends the target upgrading program to the target single chip microcomputer.
As a preferred embodiment, the above steps: the process of downloading the target upgrading program comprises the following steps:
and downloading the target upgrading program by using a Ymodem protocol.
It can be understood that, compared with other transmission protocols, the Ymodem protocol not only has the advantages of stable and reliable data transmission, but also has faster data transmission, so that when an upper computer downloads a target upgrading program by using the Ymodem protocol, the downloading experience of a user can be relatively improved. Or, in practical application, the upper computer may also download the target upgrade program of the target single chip microcomputer by using other transmission protocols, which is not described in detail herein.
In order to enable those skilled in the art to better understand the implementation principle of the multi-mcu firmware upgrade method provided in the present invention, the foregoing disclosure is specifically illustrated by an application scenario embodiment.
Referring to fig. 4 and 5, fig. 4 is a flowchart illustrating an overall firmware upgrade of a multiple-mcu control system; fig. 5 is a flowchart of firmware upgrade performed by the target one-chip microcomputer. When a user wants to upgrade the firmware of a target singlechip in the multi-singlechip control system, the multi-singlechip control system is connected with an upper computer through a communication interface, and after the upper computer establishes communication connection with the multi-singlechip control system, the upper computer detects the communication connection state between the upper computer and a main singlechip in the multi-singlechip control system; if the upper computer does not establish communication connection with the main singlechip, the upper computer always detects the connection state of the upper computer and the main singlechip; if the upper computer is successfully communicated with the main singlechip, the upper computer selects a target singlechip to be upgraded according to an instruction of a user, reads a current application program of the target singlechip and judges whether the target singlechip needs to be upgraded or not; and when the upper computer judges that the target single chip microcomputer needs to be upgraded, downloading a target upgrading program of the target single chip microcomputer by using a Ymodem protocol, and verifying the target upgrading program. And if the target upgrading program passes the verification of the upper computer, the upper computer sends the target upgrading program to the main single chip microcomputer.
When the main single chip computer receives a firmware upgrading instruction sent by the upper computer, whether the main single chip computer needs to be upgraded or not is judged according to the target upgrading instruction, if the upper computer is judged to be used for upgrading the firmware of the main single chip computer according to the firmware upgrading instruction, an upgrading mark is set in an information storage module of the main single chip computer, and the main single chip computer resets and restarts the main single chip computer; and if the upper computer is judged to be upgrading the sub-single-chip microcomputer according to the firmware upgrading instruction, setting an upgrading mark for the information storage module of the corresponding sub-single-chip microcomputer, and resetting and restarting the information storage module.
After the target single chip microcomputer is reset and restarted, the target single chip microcomputer judges whether an information storage module in the target single chip microcomputer is provided with an upgrading mark or not under the guidance of a firmware starting module of the target single chip microcomputer; if the upgrading mark is set, backing up the current application program of the target single chip microcomputer to a self backup module; and then, the target single chip microcomputer acquires the target upgrading program from the upper computer, and when the target single chip microcomputer acquires the target upgrading program, the upgrading mark in the information storage module of the target single chip microcomputer is cleared, the related information of the target upgrading program is stored in the information storage module, and the target single chip microcomputer resets and restarts the target single chip microcomputer to upgrade the firmware in the next starting process.
If the target single chip microcomputer finds that the upgrade flag is not set, the application program of the latest version stored in the target single chip microcomputer is verified, and if the application program of the latest version passes the verification, the application program of the latest version is operated. If the target single chip microcomputer receives a new firmware upgrading instruction sent by an upper computer in the process of running the application program with the latest version, an upgrading mark is set on an information storage module of the target single chip microcomputer, and the target single chip microcomputer is reset and restarted; if the application program does not pass the verification, the target single chip microcomputer reads the backup application program of the target single chip microcomputer from the backup module, stores the backup application program into the application program module, and resets and restarts the target single chip microcomputer.
Therefore, by the method, any single chip microcomputer in the multi-single-chip microcomputer control system can be upgraded, and the method is not limited by the type and the set attribute of the single chip microcomputer, so that the difficulty in upgrading the firmware of the single chip microcomputer can be remarkably reduced, and meanwhile, the upgrading and maintenance of the multi-single-chip microcomputer control system by workers are facilitated.
Referring to fig. 6, fig. 6 is a structural diagram of a firmware upgrading apparatus applied to a multi-mcu control system according to an embodiment of the present invention. Wherein, many single chip microcomputer control system includes: the system comprises a main singlechip and a plurality of sub-singlechips connected with the main singlechip; each single chip microcomputer is provided with a firmware starting module for guiding the single chip microcomputer to start, an application program module for storing an application program, an information storage module for storing attribute information of the application program module and a backup module for backing up and storing the application program; the device includes:
the mark setting module 21 is used for searching a target singlechip corresponding to a firmware upgrading instruction when the main singlechip receives the firmware upgrading instruction of the upper computer, setting an upgrading mark for an information storage module of the target singlechip, and resetting and restarting the target singlechip;
the program acquisition module 22 is used for backing up the current application program of the target single chip microcomputer to a backup module of the target single chip microcomputer when the target single chip microcomputer operates a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is set, and acquiring the target upgrading program from an upper computer;
the mark clearing module 23 is used for storing the target upgrading program to an application program module of the target singlechip when the target singlechip acquires the target upgrading program, clearing the upgrading mark and resetting and restarting the target singlechip;
the program checking module 24 is used for checking the target upgrading program when the target single chip microcomputer runs the firmware starting module of the target single chip microcomputer and detects that the upgrading mark is cleared;
and the program running module 25 is used for running the target upgrading program if the target upgrading program passes the verification.
The firmware upgrading device applied to the multi-singlechip control system has the beneficial effects of the firmware upgrading method applied to the multi-singlechip control system.
Referring to fig. 7, fig. 7 is a structural diagram of a firmware upgrading device applied to a multiple-monolithic-chip-computer control system according to an embodiment of the present invention, where the device includes:
a memory 31 for storing a computer program;
and a processor 32, configured to implement the steps of the firmware upgrading method applied to the multiple-single-chip control system as disclosed in the foregoing when executing the computer program.
The firmware upgrading device applied to the multi-singlechip control system has the beneficial effects of the firmware upgrading method applied to the multi-singlechip control system.
Correspondingly, the embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the firmware upgrading method applied to the multi-singlechip control system are realized as disclosed in the foregoing.
The computer-readable storage medium provided by the embodiment of the invention has the beneficial effects of the firmware upgrading method applied to the multi-singlechip control system.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for the firmware upgrading method, apparatus, device and medium applied to a multi-chip microcomputer control system, and a specific example is applied in this document to explain the principle and implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (9)
1. A firmware upgrading method applied to a multi-single-chip control system is characterized in that the multi-single-chip control system comprises the following steps: the system comprises a main singlechip and a plurality of sub-singlechips connected with the main singlechip; each single chip microcomputer is provided with a firmware starting module for guiding the single chip microcomputer to start, an application program module for storing an application program, an information storage module for storing attribute information of the application program module and a backup module for backing up and storing the application program; the method comprises the following steps:
when the main singlechip receives a firmware upgrading instruction of an upper computer, searching a target singlechip corresponding to the firmware upgrading instruction, setting an upgrading mark for an information storage module of the target singlechip, and resetting and restarting the target singlechip;
when the target single chip microcomputer runs a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is set, backing up a current application program of the target single chip microcomputer to a backup module of the target single chip microcomputer, and acquiring a target upgrading program from the upper computer;
when the target single chip microcomputer obtains the target upgrading program, the target upgrading program is stored to an application program module of the target single chip microcomputer, the upgrading mark is cleared, and the target single chip microcomputer is reset and restarted;
when the target single chip microcomputer runs a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is removed, verifying the target upgrading program;
and if the target upgrading program passes the verification, operating the target upgrading program.
2. The firmware upgrade method according to claim 1, wherein the target one-chip microcomputer includes the main one-chip microcomputer and the sub one-chip microcomputer.
3. The firmware upgrade method according to claim 1, wherein the process of verifying the target upgrade program is followed by:
and if the target upgrading program does not pass the verification, reading the current application program of the target single chip microcomputer from the backup module of the target single chip microcomputer, storing the current application program of the target single chip microcomputer to the information storage module of the target single chip microcomputer, and resetting and restarting the target single chip microcomputer.
4. The firmware upgrade method according to claim 1, further comprising, after the process of running the target upgrade program:
and if the target single chip receives a new firmware upgrading instruction, setting the upgrading mark for the information storage module of the target single chip, and resetting and restarting the target single chip.
5. The firmware upgrade method according to any one of claims 1 to 4, further comprising:
when the upper computer needs to update the firmware of the target single chip microcomputer, downloading the target updating program and verifying the target updating program;
and if the target upgrading program passes the verification, sending the target upgrading program to the main singlechip.
6. The firmware upgrade method according to claim 5, wherein the downloading of the target upgrade program includes:
and downloading the target upgrading program by using a Ymodem protocol.
7. A firmware upgrading device applied to a multi-SCM control system is characterized in that the multi-SCM control system comprises: the system comprises a main singlechip and a plurality of sub-singlechips connected with the main singlechip; each single chip microcomputer is provided with a firmware starting module for guiding the single chip microcomputer to start, an application program module for storing an application program, an information storage module for storing attribute information of the application program module and a backup module for backing up and storing the application program; the method comprises the following steps:
the mark setting module is used for searching a target singlechip corresponding to a firmware upgrading instruction when the main singlechip receives the firmware upgrading instruction of the upper computer, setting an upgrading mark for an information storage module of the target singlechip and resetting and restarting the target singlechip;
the program acquisition module is used for backing up the current application program of the target single chip microcomputer to the backup module of the target single chip microcomputer when the target single chip microcomputer runs the firmware starting module of the target single chip microcomputer and detects that the upgrading mark is set, and acquiring the target upgrading program from the upper computer;
the mark clearing module is used for storing the target upgrading program to an application program module of the target single chip microcomputer when the target single chip microcomputer obtains the target upgrading program, clearing the upgrading mark and resetting and restarting the target single chip microcomputer;
the program checking module is used for checking the target upgrading program when the target single chip microcomputer runs a firmware starting module of the target single chip microcomputer and detects that the upgrading mark is removed;
and the program running module is used for running the target upgrading program if the target upgrading program passes the verification.
8. A firmware upgrading device applied to a multi-singlechip control system is characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the firmware upgrading method applied to the multi-singlechip control system according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the firmware upgrading method applied to a multi-singlechip control system are realized according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111413721.1A CN114090045A (en) | 2021-11-25 | 2021-11-25 | Firmware upgrading method applied to multi-singlechip control system and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111413721.1A CN114090045A (en) | 2021-11-25 | 2021-11-25 | Firmware upgrading method applied to multi-singlechip control system and related equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114090045A true CN114090045A (en) | 2022-02-25 |
Family
ID=80304480
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111413721.1A Pending CN114090045A (en) | 2021-11-25 | 2021-11-25 | Firmware upgrading method applied to multi-singlechip control system and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114090045A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016197883A1 (en) * | 2015-06-11 | 2016-12-15 | 中兴通讯股份有限公司 | Method and system for updating program of microcontroller online |
CN108021381A (en) * | 2017-12-06 | 2018-05-11 | 锐捷网络股份有限公司 | The upgrading method for one-chip computer and device of equipment |
CN112988465A (en) * | 2021-03-26 | 2021-06-18 | 东莞市峰谷科技有限公司 | Method for automatically recovering operation of single chip microcomputer in upgrading failure |
-
2021
- 2021-11-25 CN CN202111413721.1A patent/CN114090045A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016197883A1 (en) * | 2015-06-11 | 2016-12-15 | 中兴通讯股份有限公司 | Method and system for updating program of microcontroller online |
CN108021381A (en) * | 2017-12-06 | 2018-05-11 | 锐捷网络股份有限公司 | The upgrading method for one-chip computer and device of equipment |
CN112988465A (en) * | 2021-03-26 | 2021-06-18 | 东莞市峰谷科技有限公司 | Method for automatically recovering operation of single chip microcomputer in upgrading failure |
Non-Patent Citations (1)
Title |
---|
姚晓光;: "基于GPRS的单片机固件升级系统设计", 单片机与嵌入式系统应用, no. 06, 1 June 2010 (2010-06-01) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106257417B (en) | Boot program upgrading method, embedded equipment, control equipment and embedded system | |
CN105183515B (en) | The method and device of holder firmware upgrade | |
US8332840B2 (en) | Method of computer based data card software downloading and updating | |
CN112910714B (en) | Remote firmware upgrading method for Internet of things terminal equipment with master-slave machine structure | |
CN106020875B (en) | Firmware update management method and device of embedded terminal | |
CN104102518B (en) | double-CPU system and program upgrading method thereof | |
EP3879399B1 (en) | Method and apparatus for upgrading vehicle-mounted tbox, device, and storage medium | |
WO2019140656A1 (en) | Firmware upgrade method and apparatus, electronic device and control device | |
CN112152846B (en) | Metering instrument remote upgrading method based on Internet of things | |
CN106648768B (en) | Method and system for upgrading equipment | |
EP2664988B1 (en) | Method, device and system for installing terminal software | |
CN109416629A (en) | Firmware upgrade method, electronic equipment, camera system and unmanned vehicle | |
CN104991805B (en) | Smart machine and its system calamity are for control method | |
CN107396185B (en) | Upgrading method and system | |
CN114138295A (en) | Method, device and system for upgrading application program firmware of electronic equipment | |
CN113535202A (en) | Charging pile upgrading method and device and charging pile system | |
CN110908733B (en) | Working mode determining method and device, and control method and device | |
CN112612498A (en) | Embedded equipment upgrading method and embedded equipment | |
CN114090045A (en) | Firmware upgrading method applied to multi-singlechip control system and related equipment | |
CN115437674B (en) | Firmware upgrading method, device, medium and electronic equipment | |
KR100832269B1 (en) | Program update method and system for wireless communication terminal | |
CN114237722B (en) | System starting method, device, equipment and engineering vehicle | |
CN113656051A (en) | Automatic upgrading method for android system equipment | |
CN111787378B (en) | Software upgrading method applied to remote control device and remote control device | |
CN113721959A (en) | Information processing method and device and electronic equipment |
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 |