[go: up one dir, main page]

CN114090045B - A firmware upgrade method and related equipment applied to multi-chip microcomputer control system - Google Patents

A firmware upgrade method and related equipment applied to multi-chip microcomputer control system Download PDF

Info

Publication number
CN114090045B
CN114090045B CN202111413721.1A CN202111413721A CN114090045B CN 114090045 B CN114090045 B CN 114090045B CN 202111413721 A CN202111413721 A CN 202111413721A CN 114090045 B CN114090045 B CN 114090045B
Authority
CN
China
Prior art keywords
target
upgrade
program
chip microcomputer
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111413721.1A
Other languages
Chinese (zh)
Other versions
CN114090045A (en
Inventor
冉亮
胡人友
白良德
杨小平
刘江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Jinshan Medical Technology Research Institute Co Ltd
Original Assignee
Chongqing Jinshan Medical Technology Research Institute 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 Chongqing Jinshan Medical Technology Research Institute Co Ltd filed Critical Chongqing Jinshan Medical Technology Research Institute Co Ltd
Priority to CN202111413721.1A priority Critical patent/CN114090045B/en
Publication of CN114090045A publication Critical patent/CN114090045A/en
Application granted granted Critical
Publication of CN114090045B publication Critical patent/CN114090045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F9/4405Initialisation of multiprocessor systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F9/4406Loading of operating system
    • G06F9/441Multiboot arrangements, i.e. selecting an operating system to be loaded
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/445Program loading or initiating
    • G06F9/44505Configuring 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 present application discloses a firmware upgrade method for a multi-chip microcomputer control system, comprising: when the main single-chip microcomputer receives a firmware upgrade instruction from a host computer, the corresponding target single-chip microcomputer is searched, an upgrade mark is set for it, and it is restarted; when the target single-chip microcomputer runs its own firmware startup module and detects that the upgrade mark is set, the current application of the target single-chip microcomputer is backed up to the backup module, and the target upgrade program is obtained from the host computer; the target upgrade program is stored in the application program module, the upgrade mark is cleared, and it is restarted; when the target single-chip microcomputer runs its own firmware startup module and detects that the upgrade mark is cleared, the target upgrade program is verified; if it passes the verification, the target upgrade program is run. The method can significantly reduce the difficulty of firmware upgrade of the single-chip microcomputer, and it is also more convenient for the staff to upgrade and maintain the multi-chip microcomputer control system.

Description

Firmware upgrading method applied to multi-singlechip control system and related equipment
Technical Field
The present invention relates to the field of server technologies, and in particular, to a firmware upgrade method, apparatus, device, and medium applied to a multi-singlechip control system.
Background
With the rapid development of embedded technology, embedded devices have more and more functions. Under the technical background, a plurality of singlechips are generally integrated in a control system to meet the actual situation requirement, so as to form a control system with a plurality of singlechips.
In the use process of the multi-singlechip control system, firmware upgrading is generally required for one singlechip or a plurality of singlechips in the multi-singlechip control system in order to adapt to the continuously developed application requirements. Because the single-chip microcomputer types and structures integrated in the multi-single-chip microcomputer control system are different, the firmware upgrading methods of the single-chip microcomputer are also greatly different. Such as: when the single-chip microcomputer with the program downloading interface is used for firmware upgrading, the multi-single-chip microcomputer control system is required to be disassembled, and then a special burning tool is used for burning and upgrading; when the single chip microcomputer without the program downloading interface is used for upgrading the firmware, a chip with the latest application program needs to be replaced by the single chip microcomputer; even some singlechips need to design a special jump program circuit to upgrade the firmware. In addition, as the communication protocols of factory single-chip microcomputer of each manufacturer are different, the firmware upgrading difficulty of the multi-single-chip microcomputer control system is increased, and the upgrading maintenance of the multi-single-chip microcomputer control system by workers is inconvenient. Currently, there is no more effective solution to this technical problem.
Disclosure of Invention
Therefore, the invention aims to provide a firmware upgrading method, device, equipment and medium applied to a multi-singlechip control system, so as to reduce the difficulty in upgrading the firmware of the singlechip and facilitate the upgrading and maintenance of the multi-singlechip control system by staff. The specific scheme is as follows:
a firmware upgrading method applied to a multi-singlechip control system, wherein the multi-singlechip control system comprises the following steps: the system comprises a main singlechip and a plurality of sub singlechips connected with the main singlechip; each singlechip is provided with a firmware starting module for guiding the singlechip 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; comprising 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 singlechip runs a firmware starting module of the target singlechip and detects that the target singlechip is provided with the upgrading mark, backing up the current application program of the target singlechip to a backup module of the target singlechip, and acquiring a target upgrading program from the upper computer;
when the target singlechip acquires the target upgrading program, storing the target upgrading program into an application program module of the target singlechip, clearing the upgrading mark, and resetting and restarting the target singlechip;
When the target singlechip runs a firmware starting module of the target singlechip and the upgrading mark is detected to be cleared, verifying the target upgrading program;
And if the target upgrading program passes the verification, the target upgrading program is operated.
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:
If the target upgrading program does not pass the verification, the current application program of the target singlechip is read from the backup module of the target singlechip, and is stored into the information storage module of the target singlechip, and reset and restarted.
Preferably, after the process of running the target upgrade program, the method further includes:
if the target singlechip receives a new firmware upgrading instruction, setting the upgrading mark for an information storage module of the target singlechip, and resetting and restarting the target singlechip.
Preferably, the method further comprises;
when the upper computer needs to upgrade the firmware of the target singlechip, downloading the target upgrade program and checking the target upgrade program;
And if the target upgrading program passes the verification, the target upgrading program is sent to the main singlechip.
Preferably, the process of downloading 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, wherein the multi-singlechip control system comprises: the system comprises a main singlechip and a plurality of sub singlechips connected with the main singlechip; each singlechip is provided with a firmware starting module for guiding the singlechip 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; comprising the following steps:
the mark setting module is used for searching a target singlechip corresponding to the firmware upgrading instruction when the main singlechip receives the firmware upgrading instruction of the upper computer, setting an upgrading mark for the 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 singlechip to the backup module of the target singlechip when the target singlechip runs the firmware starting module of the target singlechip and the target singlechip is detected to be set with the upgrading mark, and acquiring the target upgrading program from the upper computer;
the mark clearing module is used for storing the target upgrading program into 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 verification module is used for verifying the target upgrading program when the target singlechip runs a firmware starting module of the target singlechip and the upgrading mark is detected to be cleared;
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:
a memory for storing a computer program;
and the processor is used for realizing the steps of a firmware upgrading method applied to the multi-singlechip control system when executing the computer program.
Correspondingly, the invention also discloses a computer readable storage medium, wherein the computer readable storage medium is stored with a computer program, and the computer program realizes the steps of the firmware upgrading method applied to the multi-singlechip control system when being executed by a processor.
Therefore, in the firmware upgrading method provided by the invention, a firmware starting module for guiding the starting of each single chip microcomputer in the multi-single chip microcomputer control system, 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; 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 singlechip runs the firmware starting module of the target singlechip and detects that the target singlechip is provided with the upgrading mark, the current application program of the target singlechip is backed up to the backup module of the target singlechip, and the target upgrading program is acquired from the upper computer through the main singlechip; when the target singlechip acquires the target upgrading program, the target upgrading program is stored in an application program module of the target singlechip, and meanwhile, an upgrading mark in the information storage module is cleared, and the target singlechip resets and restarts the target singlechip; after the target singlechip is reset and restarted, if the upgrading mark in the information storage module is detected to be cleared, the target upgrading program is read from the application program module, the target upgrading program is checked, and if the target upgrading program passes the check, the target upgrading program is operated. Compared with the prior art, 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, 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. Correspondingly, the firmware upgrading device, the firmware upgrading equipment and the firmware upgrading medium applied to the multi-singlechip control system have the same 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 that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a firmware upgrade method applied to a multi-SCM 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 a flowchart of a firmware upgrade of a multiple single-chip microcomputer control system;
FIG. 5 is a flow chart of firmware upgrade performed by the target SCM;
FIG. 6 is a block diagram of a firmware upgrade apparatus for a multi-SCM control system according to an embodiment of the present invention;
fig. 7 is a block diagram of firmware upgrading equipment applied to a multi-singlechip control system according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of a firmware upgrading method applied to a multi-singlechip control system according to an embodiment of the present invention, where the multi-singlechip control system includes: a main singlechip and a plurality of sub-singlechips connected with the main singlechip; each singlechip is provided with a firmware starting module for guiding the singlechip 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 singlechip runs the firmware starting module of the target singlechip and detects that the target singlechip is provided with the upgrading mark, the current application program of the target singlechip is backed up to the backup module of the target singlechip, and the target upgrading program is obtained from the upper computer;
Step S13: when the target singlechip acquires the target upgrading program, the target upgrading program is stored in an application program module of the target singlechip, an upgrading mark is cleared, and the target singlechip resets and restarts the target singlechip;
Step S14: when the target singlechip runs a firmware starting module of the target singlechip and detects that the upgrading mark is cleared, verifying the target upgrading program;
Step S15: and if the target upgrading program passes the verification, the target upgrading program is operated.
In the embodiment, the firmware upgrading method applied to the multi-singlechip control system is provided, and not only can the difficulty in upgrading the firmware of the singlechip be reduced, but also the upgrading maintenance of the multi-singlechip control system by workers is facilitated.
Referring to fig. 2, fig. 2 is a block diagram of a multi-singlechip control system in the prior art, in the multi-singlechip control system, the multi-singlechip control system mainly includes: the system comprises a data acquisition processing module, a sub-singlechip, a main singlechip, a communication interface module, a power module and an upper computer. The data acquisition 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 respectively connecting data acquisition and processing of the data acquisition and processing module and communicating with the main single-chip microcomputer, wherein the mode of communicating the sub-single-chip microcomputer with the main single-chip microcomputer comprises serial ports, SPI (SERIAL PERIPHERAL INTERFACE ), IIC (INTER INTEGRATED Circuit, integrated Circuit bus) and the like. The main singlechip is used for controlling data acquisition and processing of the 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 the upper computer, and the communication mode comprises the following steps: communication modes such as USB (Universal Serial Bus ), 2G (Generation wireless telephone technology, mobile phone communication specification)/3G/4G/5G, WIFI (wireless communication technology), bluetooth and the like; 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 with each singlechip and issuing and reading firmware programs.
Compared with the prior art, in the multi-singlechip control system provided by the embodiment, the main singlechip and the plurality of sub-singlechips connected with the main singlechip are arranged, and each singlechip is provided with a firmware starting module for guiding the singlechip 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 singlechip can be allocated to different program modules. Referring to fig. 3, fig. 3 is a schematic diagram of allocating flash memory in a single chip microcomputer. In fig. 3, the firmware start module is used for guiding the singlechip to start, including jumping to the application program operation, updating the application program, backing up the application program, reading and writing the 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, checking information and other contents; the backup module is used for backing up the application program, and before the new application program is upgraded, the original application program is backed up to the area by the firmware starting module, so that the system can be operated normally after the application program is damaged.
In this embodiment, when a main singlechip in the multi-singlechip control system receives a firmware upgrade instruction of an upper computer, the main singlechip searches a target singlechip corresponding to the firmware upgrade instruction, where the target singlechip includes both the main singlechip and a sub-singlechip. That is, the firmware upgrade instruction sent by the upper computer can upgrade the firmware of the main singlechip or upgrade the firmware of the sub singlechip. In other words, the firmware upgrading methods of all singlechips in the multi-singlechip control system are consistent.
When the main singlechip finds a target singlechip corresponding to the firmware upgrading instruction, an upgrading mark is set in an information storage module of the target singlechip, and the target singlechip is reset and restarted. When the target singlechip is reset and restarted, and the self firmware starting module is operated, if the upgrade mark is detected to be arranged in the self information storage module, the target singlechip firstly backs up the current application program of the target singlechip to the backup module of the target singlechip, and acquires the target upgrade program from the upper computer; when the target singlechip acquires the target upgrading program sent by the upper computer, the target singlechip stores the target upgrading program into the application program module of the target singlechip, and meanwhile, clears the upgrading mark in the information storage module of the target singlechip and resets and restarts the target singlechip.
When the target singlechip is reset and restarted, corresponding program jump is carried out under the guidance of the firmware starting module of the target singlechip, and if the target singlechip detects that the upgrading mark in the information storage module of the target singlechip is cleared, the latest upgrading program of the application program, namely the target upgrading program, is stored in the application program module of the target singlechip. Under the condition, the target singlechip checks the target upgrading program, if the target upgrading program passes the check, the target upgrading program is not tampered, the stored information is not lost, and the target singlechip 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 upgrading and maintenance of the multi-single-chip microcomputer control system by workers are facilitated.
It can be seen that, in the firmware upgrading method provided in this embodiment, a firmware starting module for guiding 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 set in advance for each single-chip microcomputer in the multi-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 singlechip runs the firmware starting module of the target singlechip and detects that the target singlechip is provided with the upgrading mark, the current application program of the target singlechip is backed up to the backup module of the target singlechip, and the target upgrading program is acquired from the upper computer through the main singlechip; when the target singlechip acquires the target upgrading program, the target upgrading program is stored in an application program module of the target singlechip, and meanwhile, an upgrading mark in the information storage module is cleared, and the target singlechip resets and restarts the target singlechip; after the target singlechip is reset and restarted, if the upgrading mark in the information storage module is detected to be cleared, the target upgrading program is read from the application program module, the target upgrading program is checked, and if the target upgrading program passes the check, the target upgrading program is operated. Compared with the prior art, 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, 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.
Based on the above embodiment, this embodiment further describes and optimizes the technical solution, as a preferred implementation manner, the steps are as follows: after the process of verifying the target upgrade program, the method further comprises the following steps:
If the target upgrading program does not pass the verification, the current application program of the target singlechip is read from the backup module of the target singlechip, the current application program of the target singlechip is stored in the information storage module of the target singlechip, and the target singlechip is reset and restarted.
It can be understood that if the target upgrade program is not checked in the process of checking the target upgrade program by the target single-chip microcomputer, it indicates that the target upgrade program is tampered or has other problems, and at this time, in order to ensure safe and stable operation of the multi-single-chip microcomputer control system, the target single-chip microcomputer will read the current application program of the target single-chip microcomputer from its own backup module, store the current application program of the target single-chip microcomputer into its own information storage module, and reset and restart itself.
Therefore, through the technical scheme provided by the embodiment, the overall reliability of the multi-singlechip control system in the operation process can be further ensured.
Based on the above embodiment, this embodiment further describes and optimizes the technical solution, as a preferred implementation manner, the steps are as follows: after the process of running the target upgrade program, the method further comprises:
If the target singlechip receives a new firmware upgrading instruction, an upgrading mark is set for an information storage module of the target singlechip, and the target singlechip resets and restarts the target singlechip.
If the target singlechip receives a new firmware upgrading instruction sent by the upper computer in the process of running the target upgrading program, the upper computer is required to continuously upgrade the target upgrading program, and at the moment, the target singlechip sets an upgrading mark in an information storage module of the target singlechip and resets and restarts the target singlechip.
It can be thought that when the target singlechip sets an upgrade flag in the own information storage module, the target singlechip reenters the step S12 after reset and restart, so that the target singlechip can be ensured to upgrade the target singlechip accurately and reliably and upgrade the firmware of the target singlechip to the latest version.
Based on the above embodiment, this embodiment further describes and optimizes a technical solution, and as a preferred implementation manner, the firmware upgrading method further includes:
when the upper computer needs to upgrade the firmware of the target singlechip, downloading a target upgrade program and checking the target upgrade program;
and if the target upgrading program passes the verification, the target upgrading program is sent to the main singlechip.
In practical application, if a user needs to upgrade the firmware of a target singlechip in a multi-singlechip control system, firstly, downloading a target upgrade program for upgrading the firmware of the target singlechip into 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; if the target upgrading program passes the verification of the upper computer, the target upgrading program is not tampered, and no deletion occurs. Under the condition, the upper computer sends the target upgrading program to the main singlechip, and the main singlechip sends the target upgrading program to the target singlechip.
As a preferred embodiment, the steps are as follows: the process of downloading the target upgrade program comprises the following steps:
and downloading the target upgrading program by using the YModem protocol.
It can be appreciated that, compared with other transmission protocols, the yomodem protocol not only has the advantage of stable and reliable data transmission, but also has faster data transmission, so that when the host computer utilizes the yomodem protocol to download the target upgrade program, the downloading experience of the user can be relatively improved. Or in practical application, the upper computer may also utilize other transmission protocols to download the target upgrade program of the target singlechip, which is not described in detail herein.
In order to enable those skilled in the art to better understand the implementation principle of the firmware upgrading method of the multi-singlechip control system provided by the invention, the foregoing disclosure is specifically described by an application scenario embodiment.
Referring to fig. 4 and 5, fig. 4 is a flowchart of firmware upgrade of the multi-singlechip control system; FIG. 5 is a flow chart of firmware upgrade performed by the target SCM. When a user wants to upgrade the firmware of a target single-chip microcomputer in the multi-single-chip microcomputer control system, the multi-single-chip microcomputer control system is connected with an upper computer through a communication interface, and after the upper computer is in communication connection with the multi-single-chip microcomputer control system, the upper computer can detect the communication connection state between the upper computer and a main single-chip microcomputer in the multi-single-chip microcomputer 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 and the main singlechip are successfully connected, the upper computer selects a target singlechip to be upgraded according to a user instruction, and then reads the current application program of the target singlechip and judges whether the target singlechip needs to be upgraded; when the upper computer judges that the target singlechip is to be upgraded, the Ymodem protocol is used for downloading a target upgrading program of the target singlechip and checking the target upgrading program. If the target upgrading program passes the verification of the upper computer, the upper computer sends the target upgrading program to the main singlechip.
When the main singlechip receives a firmware upgrading instruction sent by the upper computer, judging whether the main singlechip is to be upgraded according to the target upgrading instruction, if the upper computer is judged to be used for upgrading the firmware of the main singlechip according to the firmware upgrading instruction, setting an upgrading mark in an information storage module of the main singlechip, and resetting and restarting the main singlechip; if the upper computer is judged to upgrade the sub-single-chip microcomputer according to the firmware upgrade instruction, an upgrade mark is set for the information storage module of the corresponding sub-single-chip microcomputer, and reset and restart are carried out on the information storage module.
After the target singlechip is reset and restarted, the target singlechip can judge whether an information storage module in the target singlechip is provided with an upgrade mark under the guidance of a firmware starting module of the target singlechip; if the upgrading mark is set, the current application program of the target singlechip is backed up to a backup module of the current application program; and then, the target singlechip acquires the target upgrading program from the upper computer, when the target singlechip acquires the target upgrading program, the upgrading mark in the information storage module is cleared, the related information of the target upgrading program is stored in the information storage module, and the target singlechip resets and restarts the target singlechip to upgrade the firmware in the next starting process.
If the target singlechip finds that the target singlechip is not provided with the upgrade mark, the latest version of the application program stored in the target singlechip is checked, and if the latest version of the application program passes the check, the latest version of the application program is operated. If the target singlechip also receives a new firmware upgrading instruction sent by the upper computer in the process of running the latest version application program, an upgrading mark is set in an information storage module of the target singlechip, and the target singlechip is reset and restarted; if the application program does not pass the verification, the target singlechip reads the backup application program of the target singlechip from the backup module, stores the backup application program into the application program module, and resets and restarts the target singlechip.
According to the method, any single-chip microcomputer in the multi-single-chip microcomputer control system can be upgraded, and the single-chip microcomputer type and the set attribute are not limited, so that difficulty in upgrading firmware of the single-chip microcomputer can be remarkably reduced, and meanwhile upgrading and maintenance of the multi-single-chip microcomputer control system by workers are facilitated.
Referring to fig. 6, fig. 6 is a block diagram of a firmware upgrading apparatus applied to a multi-singlechip control system according to an embodiment of the present invention. Wherein, many singlechip control system includes: a main singlechip and a plurality of sub-singlechips connected with the main singlechip; each singlechip is provided with a firmware starting module for guiding the singlechip 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 comprises:
The mark setting module 21 is used for searching a target singlechip corresponding to the 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 configured to backup a current application program of the target singlechip to a backup module of the target singlechip and acquire a target upgrade program from the upper computer when the target singlechip runs a firmware starting module of the target singlechip and detects that the target singlechip is provided with an upgrade mark;
The mark removing module 23 is configured to store the target upgrade program to an application program module of the target singlechip when the target singlechip acquires the target upgrade program, remove the upgrade mark, and reset the target singlechip;
the program verification module 24 is configured to verify the target upgrade program when the target singlechip runs its firmware start module and it is detected that the upgrade flag is cleared;
and a program running module 25, configured to run the target upgrade program if the target upgrade 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 block diagram of a firmware upgrade apparatus applied to a multi-singlechip control system according to an embodiment of the present invention, where the apparatus includes:
A memory 31 for storing a computer program;
The processor 32 is configured to execute the computer program to implement the steps of a firmware upgrade method for a multi-singlechip control system as disclosed above.
The firmware upgrading equipment 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 the computer readable storage medium is stored with a computer program, and the steps of the firmware upgrading method applied to the multi-singlechip control system are realized when the computer program is executed by a processor.
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.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Finally, it is further noted that relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The firmware upgrading method, device, equipment and medium applied to the multi-singlechip control system provided by the invention are described in detail, and specific examples are applied to illustrate the principle and implementation of the invention, and the description of the above examples is only used for helping to understand the method and core ideas of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (7)

1.一种应用于多单片机控制系统的固件升级方法,其特征在于,所述多单片机控制系统包括:主单片机,以及与所述主单片机相连的多个子单片机;且每个单片机均具有用于引导自身进行启动的固件启动模块、用于存储应用程序的应用程序模块、用于存储所述应用程序模块的属性信息的信息存储模块以及用于对所述应用程序进行备份存储的备份模块;包括:1. A firmware upgrade method for a multi-single-chip microcomputer control system, characterized in that the multi-single-chip microcomputer control system comprises: a main single-chip microcomputer, and a plurality of sub-single-chip microcomputers connected to the main single-chip microcomputer; and each single-chip microcomputer has a firmware startup module for booting itself to start, an application module for storing application programs, an information storage module for storing attribute information of the application module, and a backup module for backing up and storing the application programs; comprising: 当所述主单片机接收到上位机的固件升级指令时,则查找与所述固件升级指令相对应的目标单片机,对所述目标单片机的信息存储模块设置升级标记,并对所述目标单片机进行复位重启;When the master single-chip microcomputer receives a firmware upgrade instruction from the host computer, it searches for a target single-chip microcomputer corresponding to the firmware upgrade instruction, sets an upgrade mark on the information storage module of the target single-chip microcomputer, and resets and restarts the target single-chip microcomputer; 当所述目标单片机运行自身的固件启动模块,且检测到自身被设置所述升级标记时,则将所述目标单片机的当前应用程序备份至自身的备份模块,并从所述上位机中获取目标升级程序;When the target single-chip computer runs its own firmware startup module and detects that the upgrade mark is set on itself, the current application program of the target single-chip computer is backed up to its own backup module, and the target upgrade program is obtained from the host computer; 当所述目标单片机获取到所述目标升级程序时,则将所述目标升级程序存储至自身的应用程序模块,清除所述升级标记,并对自身进行复位重启;When the target single chip microcomputer obtains the target upgrade program, it stores the target upgrade program in its own application program module, clears the upgrade mark, and resets and restarts itself; 当所述目标单片机运行自身的固件启动模块,且检测到所述升级标记被清除时,则对所述目标升级程序进行校验;When the target single chip microcomputer runs its own firmware startup module and detects that the upgrade mark is cleared, the target upgrade program is verified; 若所述目标升级程序通过校验,则运行所述目标升级程序;If the target upgrade program passes the verification, running the target upgrade program; 所述对所述目标升级程序进行校验的过程之后,还包括:After the process of verifying the target upgrade program, the process further includes: 若所述目标升级程序未通过校验,则从自身的备份模块读取所述目标单片机的当前应用程序,并将所述目标单片机的当前应用程序存储至自身的信息存储模块,并对自身进行复位重启;If the target upgrade program fails to pass the verification, the current application program of the target microcontroller is read from its own backup module, and the current application program of the target microcontroller is stored in its own information storage module, and the system is reset and restarted; 还包括:Also includes: 当所述上位机需要对所述目标单片机进行固件升级时,则下载所述目标升级程序,并对所述目标升级程序进行校验;When the host computer needs to upgrade the firmware of the target single-chip microcomputer, the target upgrade program is downloaded and verified; 若所述目标升级程序通过校验,则将所述目标升级程序发送至所述主单片机。If the target upgrade program passes the verification, the target upgrade program is sent to the main microcontroller. 2.根据权利要求1所述的固件升级方法,其特征在于,所述目标单片机包括所述主单片机和所述子单片机。2. The firmware upgrade method according to claim 1, characterized in that the target single-chip microcomputer includes the main single-chip microcomputer and the sub-single-chip microcomputer. 3.根据权利要求1所述的固件升级方法,其特征在于,所述运行所述目标升级程序的过程之后,还包括:3. The firmware upgrade method according to claim 1, characterized in that after the process of running the target upgrade program, it also includes: 若所述目标单片机接收到新的固件升级指令,则对自身的信息存储模块设置所述升级标记,并对自身进行复位重启。If the target single chip microcomputer receives a new firmware upgrade instruction, it sets the upgrade mark on its own information storage module and resets and restarts itself. 4.根据权利要求1所述的固件升级方法,其特征在于,所述下载所述目标升级程序的过程,包括:4. The firmware upgrade method according to claim 1, wherein the process of downloading the target upgrade program comprises: 利用Ymodem协议下载所述目标升级程序。The target upgrade program is downloaded using the Ymodem protocol. 5.一种应用于多单片机控制系统的固件升级装置,其特征在于,所述多单片机控制系统包括:主单片机,以及与所述主单片机相连的多个子单片机;且每个单片机均具有用于引导自身进行启动的固件启动模块、用于存储应用程序的应用程序模块、用于存储所述应用程序模块的属性信息的信息存储模块以及用于对所述应用程序进行备份存储的备份模块;包括:5. A firmware upgrade device for a multi-single-chip microcomputer control system, characterized in that the multi-single-chip microcomputer control system comprises: a main single-chip microcomputer, and a plurality of sub-single-chip microcomputers connected to the main single-chip microcomputer; and each single-chip microcomputer has a firmware startup module for booting itself to start, an application module for storing application programs, an information storage module for storing attribute information of the application module, and a backup module for backing up and storing the application programs; comprising: 标记设置模块,用于当所述主单片机接收到上位机的固件升级指令时,则查找与所述固件升级指令相对应的目标单片机,对所述目标单片机的信息存储模块设置升级标记,并对所述目标单片机进行复位重启;A mark setting module is used for, when the master single-chip microcomputer receives a firmware upgrade instruction from the host computer, searching for a target single-chip microcomputer corresponding to the firmware upgrade instruction, setting an upgrade mark on the information storage module of the target single-chip microcomputer, and resetting and restarting the target single-chip microcomputer; 程序获取模块,用于当所述目标单片机运行自身的固件启动模块,且检测到自身被设置所述升级标记时,则将所述目标单片机的当前应用程序备份至自身的备份模块,并从所述上位机中获取目标升级程序;A program acquisition module, used for backing up the current application program of the target single-chip microcomputer to its own backup module when the target single-chip microcomputer runs its own firmware startup module and detects that the upgrade mark is set on itself, and acquiring the target upgrade program from the host computer; 标记清除模块,用于当所述目标单片机获取到所述目标升级程序时,则将所述目标升级程序存储至自身的应用程序模块,清除所述升级标记,并对自身进行复位重启;A mark clearing module, used for storing the target upgrade program in its own application program module, clearing the upgrade mark, and resetting and restarting itself when the target single chip microcomputer obtains the target upgrade program; 程序校验模块,用于当所述目标单片机运行自身的固件启动模块,且检测到所述升级标记被清除时,则对所述目标升级程序进行校验;A program verification module, used for verifying the target upgrade program when the target single-chip computer runs its own firmware startup module and detects that the upgrade mark is cleared; 程序运行模块,用于若所述目标升级程序通过校验,则运行所述目标升级程序;A program running module, used for running the target upgrade program if the target upgrade program passes the verification; 所述对所述目标升级程序进行校验的过程之后,还包括:After the process of verifying the target upgrade program, the process further includes: 若所述目标升级程序未通过校验,则从自身的备份模块读取所述目标单片机的当前应用程序,并将所述目标单片机的当前应用程序存储至自身的信息存储模块,并对自身进行复位重启;If the target upgrade program fails to pass the verification, the current application program of the target microcontroller is read from its own backup module, and the current application program of the target microcontroller is stored in its own information storage module, and the system is reset and restarted; 还包括:Also includes: 当所述上位机需要对所述目标单片机进行固件升级时,则下载所述目标升级程序,并对所述目标升级程序进行校验;When the host computer needs to upgrade the firmware of the target single-chip microcomputer, the target upgrade program is downloaded and verified; 若所述目标升级程序通过校验,则将所述目标升级程序发送至所述主单片机。If the target upgrade program passes the verification, the target upgrade program is sent to the main microcontroller. 6.一种应用于多单片机控制系统的固件升级设备,其特征在于,包括:6. A firmware upgrade device applied to a multi-chip microcomputer control system, characterized by comprising: 存储器,用于存储计算机程序;Memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至4任一项所述的一种应用于多单片机控制系统的固件升级方法的步骤。A processor, used to implement the steps of a firmware upgrade method applied to a multi-single-chip microcomputer control system as described in any one of claims 1 to 4 when executing the computer program. 7.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述的一种应用于多单片机控制系统的固件升级方法的步骤。7. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of a firmware upgrade method applied to a multi-chip microcomputer control system as described in any one of claims 1 to 4 are implemented.
CN202111413721.1A 2021-11-25 2021-11-25 A firmware upgrade method and related equipment applied to multi-chip microcomputer control system Active CN114090045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111413721.1A CN114090045B (en) 2021-11-25 2021-11-25 A firmware upgrade method and related equipment applied to multi-chip microcomputer control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111413721.1A CN114090045B (en) 2021-11-25 2021-11-25 A firmware upgrade method and related equipment applied to multi-chip microcomputer control system

Publications (2)

Publication Number Publication Date
CN114090045A CN114090045A (en) 2022-02-25
CN114090045B true CN114090045B (en) 2024-11-15

Family

ID=80304480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111413721.1A Active CN114090045B (en) 2021-11-25 2021-11-25 A firmware upgrade method and related equipment applied to multi-chip microcomputer control system

Country Status (1)

Country Link
CN (1) CN114090045B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780112A (en) * 2022-04-02 2022-07-22 阳光电源股份有限公司 Chip program upgrading method and device
CN117908932A (en) * 2023-12-28 2024-04-19 湖南志奋领科技有限公司 Intelligent sensor upgrade method, device, intelligent sensor and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293797A (en) * 2015-06-11 2017-01-04 中兴通讯股份有限公司 A kind of method and system of online updating Single Chip Microcomputer (SCM) program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN114090045A (en) 2022-02-25

Similar Documents

Publication Publication Date Title
CN102232304B (en) Method, system and terminal for system upgrade between mobile communication terminals
CN103488498B (en) Computer booting method and computer
TWI363298B (en) Communication device and firmware update method thereof
US11995427B2 (en) Method, apparatus, device, and storage medium for upgrading vehicle-mounted Tbox
CN109240720B (en) Firmware upgrading method of android system and storage device
WO2014194865A1 (en) Firmware upgrade method and apparatus, and communication device
WO2019140656A1 (en) Firmware upgrade method and apparatus, electronic device and control device
CN114090045B (en) A firmware upgrade method and related equipment applied to multi-chip microcomputer control system
CN102436383A (en) Firmware program processing method and equipment
WO2015074435A1 (en) Method and apparatus for updating firmware of mobile terminal
WO2016078060A1 (en) Multi-system terminal system updating method, updating device and terminal
CN112433769A (en) BMC starting method and device, computer equipment and storage medium
CN106648768B (en) Method and system for upgrading equipment
CN101989920A (en) Distributed communication equipment version upgrading method and device and system thereof
CN114138295A (en) A method, device and system for upgrading application firmware of electronic equipment
JP2013513874A (en) Data card upgrade method and device
CN103716695A (en) System software upgrading method and smart television
CN102184115B (en) Method for updating system software and terminal device
CN116954658A (en) Dual MCU system upgrading method, electronic equipment and storage medium
CN107332589A (en) A kind of device for upgrading firmware based on bluetooth
CN103699412A (en) Quick start method and system of terminal
WO2013004175A1 (en) Software upgrading method and apparatus for electronic devices
CN113656051A (en) A method for automatic upgrade of Android system equipment
CN113190244A (en) Method and device for upgrading wireless module, computer equipment and storage medium
CN112286551B (en) Firmware upgrading error correction method and control device of touch 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
GR01 Patent grant
GR01 Patent grant