A firmware upgrade method and related equipment applied to multi-chip microcomputer control system
By presetting the firmware startup and backup module in the multi-microcontroller control system, a unified firmware upgrade for any microcontroller is achieved, solving the problem of upgrading difficulty caused by type and protocol differences, significantly reducing the upgrade difficulty and facilitating maintenance.
Patent Information
- Application Number
- CN202111413721.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-11-25
AI Technical Summary
In multi-microcontroller control systems, the types and communication protocols of microcontrollers are different, making it difficult to upgrade firmware and inconvenient for maintenance.
In the multi-microcontroller control system, each microcontroller presets the firmware startup module, application module, information storage module and backup module. It receives upgrade instructions through the main microcontroller, backs up the current application, acquires and stores the upgrade program, performs verification and runs Upgrade the program, use the Ymodem protocol to download and verify.
It reduces the difficulty of upgrading the firmware of microcontrollers, simplifies the upgrade and maintenance process of multi-microcontroller control systems, and is suitable for any microcontroller type, avoiding the limitations of microcontroller types and setting attributes.
Smart Images

Figure CN114090045B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of server technology, and in particular to a firmware upgrade method, device, equipment and medium applied to a multi-single-chip microcomputer control system. Background Art
[0002] With the rapid development of embedded technology, embedded devices have more and more functions. Under this technical background, multiple single-chip microcomputers are usually integrated into the control system to meet the needs of actual conditions, so as to form a control system with multiple single-chip microcomputers.
[0003] In the process of using a multi-MCU control system, in order to adapt to the ever-changing application needs, it is usually necessary to upgrade the firmware of one or more MCUs in the multi-MCU control system. Since the models and structures of the MCUs integrated in the multi-MCU control system are different, the firmware upgrade methods of each MCU are also very different. For example, when upgrading the firmware of a MCU with a program download interface, it is necessary to disassemble the multi-MCU control system and then use a special burning tool to burn and upgrade itself; when upgrading the firmware of a MCU without a program download interface, it is necessary to replace the chip with the latest application program; even some MCUs need to design a special jump program circuit to upgrade their own firmware when upgrading the firmware. In addition, since the communication protocols of the MCUs shipped by different manufacturers are also different, this not only increases the difficulty of firmware upgrades in the multi-MCU control system, but also makes it inconvenient for staff to upgrade and maintain the multi-MCU control system. At present, there is no more effective solution to this technical problem. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a firmware upgrade method, device, equipment and medium applied to a multi-MCU control system, so as to reduce the difficulty of firmware upgrade of the MCU and facilitate the upgrade and maintenance of the multi-MCU control system by the staff. The specific scheme is as follows:
[0005] A firmware upgrade method for a multi-single-chip control system, the multi-single-chip control system comprising: a main single-chip, and a plurality of sub-single-chip connected to the main single-chip; each single-chip 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 the application program; comprising:
[0006] 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;
[0007] 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;
[0008] 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;
[0009] 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;
[0010] If the target upgrade program passes the verification, the target upgrade program is run.
[0011] Preferably, the target single-chip microcomputer includes the main single-chip microcomputer and the sub-single-chip microcomputer.
[0012] Preferably, after the process of verifying the target upgrade program, the process further includes:
[0013] 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.
[0014] Preferably, after the process of running the target upgrade program, the process further includes:
[0015] 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.
[0016] Preferably, it also includes:
[0017] When the host computer needs to upgrade the firmware of the target single-chip microcomputer, the target upgrade program is downloaded and verified;
[0018] If the target upgrade program passes the verification, the target upgrade program is sent to the main microcontroller.
[0019] Preferably, the process of downloading the target upgrade program includes:
[0020] The target upgrade program is downloaded using the Ymodem protocol.
[0021] Correspondingly, the present invention also discloses a firmware upgrade device applied to a multi-single-chip control system, wherein the multi-single-chip control system comprises: a main single-chip, and a plurality of sub-single-chips connected to the main single-chip; and each single-chip has a firmware startup module for guiding 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:
[0022] 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;
[0023] 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;
[0024] 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;
[0025] 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;
[0026] The program running module is used to run the target upgrade program if the target upgrade program passes the verification.
[0027] Correspondingly, the present invention also discloses a firmware upgrade device applied to a multi-single-chip microcomputer control system, comprising:
[0028] Memory for storing computer programs;
[0029] The processor is used to implement the steps of a firmware upgrade method applied to a multi-single-chip microcomputer control system as disclosed above when executing the computer program.
[0030] Correspondingly, the present invention also discloses a computer-readable storage medium, on which a computer program is stored. 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 disclosed above are implemented.
[0031] It can be seen that in the firmware upgrade method provided by the present invention, a firmware startup module for guiding itself to start up, 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 are pre-set for each single-chip microcomputer in the multi-single-chip microcomputer control system; when the main single-chip microcomputer in the multi-single-chip microcomputer control system receives a firmware upgrade instruction from the host computer, the main single-chip microcomputer searches for the target single-chip microcomputer corresponding to the firmware upgrade instruction, and sets an upgrade mark for the information storage module of the target single-chip microcomputer; when the target single-chip microcomputer runs its own firmware startup module and detects that its own When the target microcontroller is set with an upgrade mark, the current application of the target microcontroller will be backed up to its own backup module first, and the target upgrade program will be obtained from the host computer through the main microcontroller; when the target microcontroller obtains the target upgrade program, the target upgrade program will be stored in its own application module, and the upgrade mark in the information storage module will be cleared, and the target microcontroller will be reset and restarted; after the target microcontroller is reset and restarted, if it is detected that the upgrade mark in its own information storage module is cleared, the target upgrade program will be read from the application module, and the target upgrade program will be verified. If the target upgrade program passes the verification, the target upgrade program will be run. Compared with the prior art, since this method can upgrade any microcontroller in a multi-microcontroller control system, and is not limited by the type of microcontroller and the setting attributes, the method can significantly reduce the difficulty of firmware upgrade of the microcontroller, and it is also more convenient for the staff to upgrade and maintain the multi-microcontroller control system. Correspondingly, the firmware upgrade device, equipment and medium applied to a multi-microcontroller control system provided by the present invention also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0033] Figure 1 A flowchart of a firmware upgrade method applied to a multi-chip microcomputer control system provided by an embodiment of the present invention;
[0034] Figure 2 It is a structural diagram of a multi-chip microcomputer control system in the prior art;
[0035] Figure 3 A schematic diagram for allocating flash memory in a single-chip microcomputer;
[0036] Figure 4 The overall flow chart of firmware upgrade for multi-MCU control system;
[0037] Figure 5 Flowchart for firmware upgrade for target MCU;
[0038] Figure 6 A structural diagram of a firmware upgrade device applied to a multi-single-chip control system provided by an embodiment of the present invention;
[0039] Figure 7 This is a structural diagram of a firmware upgrade device applied to a multi-chip microcomputer control system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] See also Figure 1 , Figure 1 A flowchart of a firmware upgrade method for a multi-MCU control system provided by an embodiment of the present invention, wherein the multi-MCU control system includes: a main MCU, and a plurality of sub-MCUs connected to the main MCU; and each MCU 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; the method includes:
[0042] Step S11: When the master microcontroller receives a firmware upgrade instruction from the host computer, it searches for a target microcontroller corresponding to the firmware upgrade instruction, sets an upgrade mark on the information storage module of the target microcontroller, and resets and restarts the target microcontroller;
[0043] Step S12: when the target single-chip computer runs its own firmware startup module and detects that it is set with an upgrade mark, it backs up the current application program of the target single-chip computer to its own backup module, and obtains the target upgrade program from the host computer;
[0044] Step S13: 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;
[0045] Step S14: 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;
[0046] Step S15: If the target upgrade program passes the verification, the target upgrade program is run.
[0047] In this embodiment, a firmware upgrade method applied to a multi-MCU control system is provided. This method can not only reduce the difficulty of firmware upgrade for the MCU, but also make it easier for staff to upgrade and maintain the multi-MCU control system.
[0048] See also Figure 2 , Figure 2 The structure diagram of a multi-single-chip control system in the prior art mainly includes: a data acquisition and processing module, a sub-single-chip, a main single-chip, a communication interface module, a power module and a host computer. The data acquisition and processing module is used to convert the measured information detected by the sensor into an electrical signal or other required information format for output according to a certain rule; the sub-single-chip is responsible for data acquisition and processing of the data connected to the data acquisition and processing module, and communicates with the main single-chip, wherein the communication mode between the sub-single-chip and the main single-chip includes serial port, SPI (Serial Peripheral Interface), IIC (Inter Integrated Circuit), etc. The main microcontroller is responsible for controlling the data acquisition and processing of input and output modules such as the sub-microcontroller, control buttons and display module; the communication interface module is used to communicate with the host computer, and the communication methods include: USB (Universal Serial Bus), 2G (Generation wireless telephone technology, mobile phone communication technology specifications) / 3G / 4G / 5G, WIFI (wireless communication technology) and Bluetooth; the power module is used to power each device in the multi-microcontroller control system; the host computer is used to communicate instructions with each microcontroller and issue and read firmware programs.
[0049] Compared with the prior art, in the multi-MCU control system provided in this embodiment, a main MCU and multiple sub-MCUs connected to the main MCU are provided, and each MCU is provided with a firmware startup module for booting itself to start up, an application module for storing applications, an information storage module for storing attribute information of the application module, and a backup module for backing up and storing the application.
[0050] Specifically, in actual operation, different addresses in the internal flash memory of each microcontroller can be assigned to different program modules. Figure 3 , Figure 3 The following is a schematic diagram of how to allocate the flash memory in the microcontroller. Figure 3 The firmware startup module is used to boot the microcontroller, including jumping to application running, updating application, application backup, reading and writing program information, etc.; the application module is used to store the system's applications; the information storage module is used to store application version information, upgrade status and other flags, as well as verification information, etc.; the backup module is used to back up the application. Before upgrading the new application, the firmware startup module is used to back up the original application to this area to ensure that the system can operate normally after the application is damaged.
[0051] In this embodiment, when the main single-chip microcomputer in the multi-chip microcomputer control system receives the firmware upgrade instruction from the host computer, the main single-chip microcomputer will search for the target single-chip microcomputer corresponding to the firmware upgrade instruction, wherein the target single-chip microcomputer includes both the main single-chip microcomputer and the sub-single-chip microcomputer. That is, the firmware upgrade instruction sent by the host computer can be used to upgrade the firmware of the main single-chip microcomputer and the sub-single-chip microcomputer. In other words, the firmware upgrade method of all single-chip microcomputers in the multi-chip microcomputer control system is consistent.
[0052] When the main MCU finds the target MCU corresponding to the firmware upgrade instruction, it sets the upgrade mark in the information storage module of the target MCU and resets and restarts the target MCU. When the target MCU is reset and restarted, and in the process of running its own firmware startup module, if it detects that an upgrade mark is set in its own information storage module, the target MCU will first back up the current application program of the target MCU to its own backup module, and obtain the target upgrade program from the host computer; when the target MCU obtains the target upgrade program sent by the host computer, the target MCU will store the target upgrade program in its own application module, and at the same time, it will clear the upgrade mark in its own information storage module and reset and restart itself.
[0053] When the target MCU is reset and restarted, it will also perform corresponding program jumps under the guidance of its own firmware startup module. If the target MCU detects that the upgrade mark in its own information storage module has been cleared, it means that the latest upgrade program of the application has been stored in the application module of the target MCU, that is, the target upgrade program. In this case, the target MCU will verify the target upgrade program. If the target upgrade program passes the verification, it means that the target upgrade program has not been tampered with and the information stored therein has not been missing. At this time, the target MCU will run the target upgrade program.
[0054] It can be understood that since this method can upgrade any MCU in a multi-MCU control system and is not restricted by the MCU type and setting properties, this method can significantly reduce the difficulty of firmware upgrades for MCUs, and also make it easier for staff to upgrade and maintain multi-MCU control systems.
[0055] It can be seen that in the firmware upgrade method provided in this embodiment, a firmware startup module for guiding itself to start up, 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 are pre-set for each single-chip microcomputer in the multi-single-chip microcomputer control system; when the main single-chip microcomputer in the multi-single-chip microcomputer control system receives a firmware upgrade instruction from the host computer, the main single-chip microcomputer searches for the target single-chip microcomputer corresponding to the firmware upgrade instruction, and sets an upgrade mark for the information storage module of the target single-chip microcomputer; when the target single-chip microcomputer runs its own firmware startup module and detects that When the upgrade mark is set, the current application program of the target single-chip microcomputer will be backed up to its own backup module first, and the target upgrade program will be obtained from the host computer through the main single-chip microcomputer; when the target single-chip microcomputer obtains the target upgrade program, the target upgrade program will be stored in its own application module, and the upgrade mark in the information storage module will be cleared, and the target single-chip microcomputer will be reset and restarted; after the target single-chip microcomputer is reset and restarted, if it is detected that the upgrade mark in its own information storage module is cleared, the target upgrade program will be read from the application module, and the target upgrade program will be verified. If the target upgrade program passes the verification, the target upgrade program will be run. Compared with the prior art, since this method can upgrade any single-chip microcomputer in a multi-chip microcomputer control system, and is not limited by the type of single-chip microcomputer and the setting attributes, this 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.
[0056] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. As a preferred implementation, the above step: after verifying the target upgrade program, further includes:
[0057] 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.
[0058] It is understandable that if the target upgrade program fails to pass the verification during the verification of the target microcontroller, it means that the target upgrade program has been tampered with or there are other problems. At this time, in order to ensure the safe and stable operation of the multi-microcontroller control system, the target microcontroller will read the current application of the target microcontroller from its own backup module, and store the current application of the target microcontroller in its own information storage module, and reset and restart itself.
[0059] It can be seen that the technical solution provided by this embodiment can further ensure the overall reliability of the multi-chip microcomputer control system during operation.
[0060] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. As a preferred implementation, the above step: after running the target upgrade program, further includes:
[0061] If the target single chip microcomputer receives a new firmware upgrade instruction, it sets an upgrade mark on its own information storage module and resets itself.
[0062] If the target MCU receives a new firmware upgrade instruction sent by the host computer while running the target upgrade program, it means that the host computer still needs to continue upgrading the target upgrade program. At this time, the target MCU will set an upgrade mark in its own information storage module and reset itself.
[0063] It is conceivable that when the target microcontroller sets an upgrade mark in its own information storage module, the target microcontroller will re-enter step S12 after resetting and restarting, so as to ensure that the target microcontroller can accurately and reliably upgrade itself and upgrade its own firmware to the latest version.
[0064] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. As a preferred implementation, the above firmware upgrade method further includes:
[0065] When the host computer needs to upgrade the firmware of the target microcontroller, it downloads the target upgrade program and verifies the target upgrade program;
[0066] If the target upgrade program passes the verification, the target upgrade program is sent to the main microcontroller.
[0067] In actual applications, if the user needs to upgrade the firmware of the target MCU in a multi-MCU control system, the target upgrade program for upgrading the firmware of the target MCU will first be downloaded to the host computer; then, in order to ensure the security and reliability of the target upgrade program, the host computer will verify the target upgrade program; if the target upgrade program passes the verification of the host computer, it means that the target upgrade program has not been tampered with or missing. In this case, the host computer will send the target upgrade program to the main MCU, and the main MCU will send it to the target MCU.
[0068] As a preferred implementation, the above step: the process of downloading the target upgrade program includes:
[0069] Use Ymodem protocol to download the target upgrade program.
[0070] It is understandable that, compared with other transmission protocols, the Ymodem protocol not only has the advantages of stable and reliable data transmission, but also faster data transmission. Therefore, when the host computer uses the Ymodem protocol to download the target upgrade program, the user's download experience can be relatively improved. Alternatively, in actual applications, the host computer can also use other transmission protocols to download the target upgrade program of the target microcontroller, which will not be described in detail here.
[0071] In order to enable those skilled in the art to better understand the implementation principle of the multi-MCU control system firmware upgrade method provided by the present invention, the aforementioned disclosed content is specifically described herein through an application scenario embodiment.
[0072] See also Figure 4 and Figure 5 , Figure 4 The overall flow chart of firmware upgrade for multi-MCU control system; Figure 5Flowchart for firmware upgrade of target MCU. When the user wants to upgrade the firmware of the target MCU in the multi-MCU control system, the multi-MCU control system will first be connected to the host computer through the communication interface. After the host computer establishes a communication connection with the multi-MCU control system, the host computer will detect the communication connection status between itself and the main MCU in the multi-MCU control system; if the host computer does not establish a communication connection with the main MCU, the host computer will continue to detect the connection status between itself and the main MCU; if the host computer successfully establishes a communication connection with the main MCU, the host computer will select the target MCU to be upgraded according to the user's instructions, and then the host computer will read the current application of the target MCU and determine whether the target MCU needs to be upgraded; when the host computer determines that the target MCU needs to be upgraded, it will use the Ymodem protocol to download the target upgrade program of the target MCU and verify the target upgrade program. If the target upgrade program passes the verification of the host computer, the host computer will send the target upgrade program to the main MCU.
[0073] When the main microcontroller receives the firmware upgrade instruction sent by the host computer, it will determine whether to upgrade the main microcontroller itself based on the target upgrade instruction. If it is determined according to the firmware upgrade instruction that the host computer is going to upgrade the firmware of the main microcontroller, it will set an upgrade mark in its own information storage module and reset itself; if it is determined according to the firmware upgrade instruction that the host computer is going to upgrade the sub-microcontroller, it will set an upgrade mark for the information storage module of the corresponding sub-microcontroller and reset it.
[0074] When the target single-chip microcomputer is reset and restarted, the target single-chip microcomputer, under the guidance of its own firmware startup module, determines whether the information storage module in itself is set with an upgrade mark; if the upgrade mark is set, the current application program of the target single-chip microcomputer is backed up to its own backup module; then, the target single-chip microcomputer obtains the target upgrade program from the host computer. When the target single-chip microcomputer obtains the target upgrade program, the upgrade mark in its own information storage module is cleared, and the relevant information of the target upgrade program is stored in the information storage module, and the target single-chip microcomputer is reset and restarted to perform the firmware upgrade during the next startup process.
[0075] If the target MCU finds that it has not been marked for upgrade, it will verify the latest version of the application stored in the target MCU. If the latest version of the application passes the verification, it will run the latest version of the application. If the target MCU also receives a new firmware upgrade instruction sent by the host computer during the running of the latest version of the application, it will set an upgrade mark in its own information storage module and reset the target MCU; if the application does not pass the verification, the target MCU will read the backup application of the target MCU from the backup module, store the backup application in the application module, and reset the target MCU.
[0076] From the above, it can be seen that this method can not only upgrade any single-chip microcomputer in a multi-chip microcomputer control system, but also will not be restricted by the type of single-chip microcomputer and setting properties. Therefore, this method can significantly reduce the difficulty of firmware upgrade of the single-chip microcomputer, and it is also more convenient for staff to upgrade and maintain the multi-chip microcomputer control system.
[0077] See also Figure 6 , Figure 6 The structure diagram of a firmware upgrade device applied to a multi-MCU control system provided by an embodiment of the present invention. The multi-MCU control system includes: a main MCU, and multiple sub-MCUs connected to the main MCU; each MCU has a firmware startup module for booting itself, 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 program; the device includes:
[0078] The mark setting module 21 is used for searching the target single chip computer corresponding to the firmware upgrade instruction when the main single chip computer receives the firmware upgrade instruction from the host computer, setting the upgrade mark on the information storage module of the target single chip computer, and resetting and restarting the target single chip computer;
[0079] The program acquisition module 22 is used to back 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 it is set to an upgrade mark, and obtain the target upgrade program from the host computer;
[0080] The mark clearing module 23 is 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;
[0081] The program verification module 24 is used to verify the target upgrade program when the target microcontroller runs its own firmware startup module and detects that the upgrade mark is cleared;
[0082] The program running module 25 is used to run the target upgrade program if the target upgrade program passes the verification.
[0083] A firmware upgrade device for a multi-single-chip control system provided by an embodiment of the present invention has the beneficial effects of the aforementioned firmware upgrade method for a multi-single-chip control system disclosed above.
[0084] See also Figure 7 , Figure 7 A structural diagram of a firmware upgrade device applied to a multi-single-chip control system provided by an embodiment of the present invention, the device includes:
[0085] A memory 31, used for storing computer programs;
[0086] The processor 32 is used to implement the steps of the firmware upgrade method applied to a multi-single-chip microcomputer control system as disclosed above when executing a computer program.
[0087] A firmware upgrade device applied to a multi-single-chip control system provided by an embodiment of the present invention has the beneficial effects of the aforementioned firmware upgrade method applied to a multi-single-chip control system disclosed above.
[0088] Correspondingly, an embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. 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 disclosed above are implemented.
[0089] A computer-readable storage medium provided by an embodiment of the present invention has the beneficial effects of the aforementioned firmware upgrade method for a multi-single-chip microcomputer control system.
[0090] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be 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 parts can be referred to the method part.
[0091] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0092] The above is a detailed introduction to the firmware upgrade method, device, equipment and medium provided by the present invention for use in a multi-MCU control system. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A firmware upgrade method applied to a multi-chip microcomputer control system, characterized in that: The multi-MCU control system includes: a main MCU, and a plurality of sub-MCUs connected to the main MCU; each MCU has a firmware startup module for booting itself, 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 the application program; including: 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. 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. The firmware upgrade method according to claim 1, characterized in that: After the process of running the target upgrade program, the process further 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. The firmware upgrade method according to claim 1, characterized in that: The process of downloading the target upgrade program includes: The target upgrade program is downloaded using the Ymodem protocol.
5. A firmware upgrade device applied to a multi-chip microcomputer control system, characterized in that: The multi-MCU control system includes: a main MCU, and a plurality of sub-MCUs connected to the main MCU; each MCU has a firmware startup module for booting itself, 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 the application program; including: 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. A firmware upgrade device applied to a multi-chip microcomputer control system, characterized in that: include: Memory for storing computer programs; 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. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a firmware upgrade method applied to a multi-single-chip microcomputer control system as claimed in any one of claims 1 to 4 are implemented.
