Upgrading system applied to multi-single-chip microcomputer product
Through the main IC chip of the main device communication and connection with multiple sub-IC chips, combined with UART serial port and wireless communication, the problem of multi-microcontroller products cannot be upgraded one-to-many, and the firmware upgrade across devices is achieved. The system is simple and easy to use, safe and reliable.
Patent Information
- Application Number
- CN202422154641.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2034-09-03
AI Technical Summary
The existing technology cannot realize one-to-many firmware upgrades for multi-microcontroller products, and the existing upgrade methods have the limitations of one-to-one or remote upgrades, which cannot meet the needs of simultaneous upgrades of multiple devices.
Design an upgrade system for multi-microcontroller products, which communicates with multiple sub-IC chips through the main IC chip of the main device to realize the transmission and forwarding of upgrade packets, and combines UART serial port and wireless communication to support cross-device upgrades.
It realizes cross-device firmware upgrade of multi-microcontroller products, the system is simple and easy to use, safe and reliable, and can meet the needs of simultaneous upgrade of multiple devices.
Smart Images

Figure CN223284606U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to the technical field of single-chip computers, in particular to an upgrading system applied to multiple single-chip computer products. Background Art
[0002] In the field of single-chip microcontrollers, firmware upgrades are a crucial feature. Currently, most products use a one-to-one firmware upgrade method, such as upgrading a remote control via a mobile phone, or upgrading a remote control via a television. These methods only occur in a master-slave communication relationship. Some products also use a remote upgrade method, downloading the upgrade package via the Wi-Fi module and then upgrading the chip. However, this method only works for the master device directly connected to the Wi-Fi module and cannot upgrade other slave devices not connected to the Wi-Fi module. Therefore, current firmware upgrade methods only allow one-to-one or remote upgrades, and cannot achieve one-to-many upgrades for multiple microcontrollers. Utility Model Content
[0003] Based on this, it is necessary to provide an upgrade system for multiple microcontroller products to address the problem that the current firmware upgrade method cannot achieve multi-microcontroller upgrades.
[0004] The utility model provides an upgrade system for multiple single-chip microcomputer products, comprising a cloud server, a master device and at least one slave device, wherein the master device comprises a communication module, a main IC chip and at least one sub-IC chip;
[0005] The master device is communicatively connected to the cloud server via the communication module, the communication module is communicatively connected to the master IC chip, and the master IC chip is also communicatively connected to the sub-IC chip; the slave device is communicatively connected to one of the sub-IC chips of the master device;
[0006] The cloud server stores a first upgrade package for the master device and a second upgrade package for the slave device; when the master device obtains the first upgrade package, the first upgrade package is transmitted to the master IC chip or the sub-IC chip; when the master device obtains the second upgrade package, the second upgrade package is forwarded to the slave device through one of the sub-IC chips.
[0007] In some embodiments, the communication module communicates with the main IC chip via a UART serial port, and the main IC chip communicates with the sub-IC chip via a UART serial port.
[0008] In some embodiments, the master device is an IAP upgrade.
[0009] In some embodiments, wireless communication is employed between the slave device and one of the sub-IC chips.
[0010] In some embodiments, the slave device is upgraded OTA.
[0011] In some embodiments, the main IC chip and the sub-IC chip are sequentially provided with a BootLoader area, an APP1 area, an APP2 area, a BootSetting area, and an APP_Custom area;
[0012] The BootLoader area is used to store the startup code;
[0013] The APP1 area is used to store application code;
[0014] The APP2 area is used to store temporary upgrade codes;
[0015] The BootSetting area is used to store upgrade information;
[0016] The APP_Custom area is used to store user-defined data.
[0017] In some embodiments, the communication packet format of the upgrade package information consists of a frame header, encryption bytes, entire packet length, IC chip source address, IC chip destination address, event type, event subcommand, data packet and end check code.
[0018] In some embodiments, the end check code is obtained by checking the data before the check code using the CRC-16 / XMODEM protocol.
[0019] In some embodiments, the data packet includes chip name information, chip address information, and software version information.
[0020] The utility model provides a single-chip microcomputer product, which is a main device in the above-mentioned upgrade system applied to multiple single-chip microcomputer products.
[0021] Compared with the prior art, the present invention has at least the following beneficial effects:
[0022] The utility model realizes cross-device upgrade by communicatively connecting the main IC chip of the main device with multiple sub-IC chips so that the upgrade package can be transmitted to the corresponding sub-IC chip through the main IC chip for firmware upgrade; and the sub-IC chip is communicatively connected with the slave device so that the upgrade package can be forwarded to the slave device through the sub-IC chip for firmware upgrade, thereby realizing cross-device upgrade and being applicable to multi-microcontroller scenarios for one-to-many firmware upgrade. The entire system is simple, easy to use, safe and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a schematic structural diagram of an upgrade system for multiple single-chip microcomputer products according to an embodiment of the present invention;
[0024] Figure 2 This is a structural diagram of an upgrade system for multiple single-chip microcomputer products according to another embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of chip Flash partitioning according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of specific embodiments of the present invention is provided in conjunction with the accompanying drawings. The following description sets forth many specific details to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art may make similar modifications without departing from the scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0027] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be an intermediate element at the same time. In contrast, when an element is referred to as being "directly on" another element, there is no intermediate element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only."
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used herein in the specification of this invention are intended only to describe specific embodiments and are not intended to limit this invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0029] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of an upgrade system for multiple single-chip microcomputer products according to an embodiment of the present invention. The upgrade system includes a cloud server 1, a master device 2, and at least one slave device 3. The master device 2 includes a communication module 21, a main IC chip 22, and at least one slave IC chip 23.
[0030] The master device 2 is communicatively connected to the cloud server 1 via the communication module 21, the communication module 21 is communicatively connected to the master IC chip 22, and the master IC chip 22 is also communicatively connected to the sub-IC chip 23; the slave device 3 is communicatively connected to one of the sub-IC chips 23 of the master device 2;
[0031] The cloud server 1 stores the first upgrade package of the master device 2 and the second upgrade package of the slave device 3; when the master device 2 obtains the first upgrade package, it transmits the first upgrade package to the main IC chip 22 or the sub-IC chip 23; when the master device 2 obtains the second upgrade package, it forwards the second upgrade package to the slave device 3 through one of the sub-IC chips 23.
[0032] In this embodiment, the main IC chip 22 is an IC chip that can directly obtain firmware data (upgrade package information), and the remaining IC chips are sub-IC chips. The communication module 21 can be a WiFi module that performs WiFi communication with the cloud server 1, allowing the master device 2 to obtain the latest firmware version (i.e., upgrade package information) from the cloud server 1 via the WiFi module. The master device 2 can upgrade itself via the main IC chip 22, transfer the latest firmware version to the sub-IC chip 23 for upgrade via the communication link between the main IC chip 22 and the sub-IC chip 23, and transfer the latest firmware version to the slave device 3 for upgrade via the communication link between the sub-IC chip 23 and the slave device 3.
[0033] Working principle: For example, Figure 2 As shown, if the IC chip at address 4 needs to be upgraded, the IC chip at address 1 needs to send the data packet to the IC chip at address 2, which then forwards it to the IC chip at address 4. At the same time, the response data from the IC chip at address 4 also needs to be forwarded to the IC chip at address 1 via the IC chip at address 2, completing the closed loop. Forwarding is performed using the IC source address and IC destination address in the packetization protocol. For example, if the initiator is address 1, the source address data is 1, and if the recipient is IC4, the destination address data is 4. Therefore, when the IC chip at address 1 sends a data packet to the IC chip at address 2, the IC chip at address 2 recognizes that the destination address of the data packet is 4, which does not match its own address 2. It then forwards the data packet intact to IC chip address 4. IC chip address 4 recognizes that the destination address in the data packet is 4, which is the same as its own, and uses the data packet for the upgrade. It is understandable that if there are other different IC chip addresses in between, forwarding will continue according to the above principle until the destination address in the data packet matches the received IC address.
[0034] In some embodiments, the communication module 21 and the main IC chip 22 communicate via a UART serial port, the main IC chip 22 and the sub-IC chip 23 communicate via a UART serial port, and the main device 2 is an IAP upgrade.
[0035] In this embodiment, IAP (In Application Programming) is an upgrade method that is programmed within the application. This upgrade method includes the following steps: a startup phase: the upgrade end (for example, the main IC chip 22 is the upgrade end, and the sub-IC chip 23 is the upgrade end) initiates the upgrade process; a handshake phase: both parties obtain version information and determine whether an upgrade is required; an upgrade phase: the upgrade end sends firmware data, and the upgrade end receives the data and responds with a write result (similar to an ACK); a verification phase: a verification code for the entire firmware data is sent, using commonly used encryption protocols such as MD5 and SHA256. After the receiving end receives all the data, it also performs the same type of encryption to obtain the verification code. If the two codes match, the firmware transmission is considered secure. The version information, including the IC address, MCU name, and version, is then read from a specified location in the received firmware data. If this information matches, the firmware data is considered to be the firmware data of the upgrade end. This embodiment uses serial communication between the main IC chip 22 and the sub-IC chip 23 to transmit upgraded firmware data, enabling firmware upgrades of other sub-ICs through the main IC, thus enabling upgrades of multiple microcontrollers within the device.
[0036] In some embodiments, wireless communication is adopted between the slave device 3 and one of the sub-IC chips 23 , and the slave device 3 is upgraded OTA.
[0037] In this embodiment, OTA (Over-The-Air) is an over-the-air upgrade method. The wireless communication can be based on a cellular mobile network, Wi-Fi, Bluetooth, Star Flash, UWB, etc. In this embodiment, the sub-IC chip 23 communicates wirelessly with the slave device 3 to establish a communication link between the sub-IC chip 23 and the slave device 3, thereby realizing firmware data forwarding and realizing over-the-air device.
[0038] In some embodiments, as Figure 3 As shown, the main IC chip 22 and the sub-IC chip 23 are both provided with a BootLoader area 221, an APP1 area 222, an APP2 area 223, a BootSetting area 224 and an APP_Custom area 225;
[0039] The BootLoader area 221 is used to store the boot code;
[0040] The APP1 area 222 is used to store application code;
[0041] The APP2 area 223 is used to store temporary upgrade codes;
[0042] The BootSetting area 224 is used to store upgrade information;
[0043] The APP_Custom area 225 is used to store user-defined data.
[0044] In this embodiment, the BootLoader area 221 starts the code, reads the IAP upgrade information in the BootSetting area 224, and determines whether there is an upgrade program. If there is an upgrade program, the data in the APP2 area is copied to the APP1 area.
[0045] Optionally, the communication packet format of the upgrade package information consists of a frame header, encryption bytes, entire packet length, IC chip source address, IC chip destination address, event type, event subcommand, data packet and end check code.
[0046] In this optional embodiment, the frame header is 2 bytes, representing the beginning of the data packet; the encryption byte is 1 byte, storing the encrypted data of the packet. Other data will be calculated with this data, and the receiving end will reverse the calculation to obtain the correct result; the total length of a single packet is 2 bytes, storing the total length of the current data packet; the IC chip source address is 1 byte, storing the IC address of the data initiator (defined by the user); the IC chip destination address is 1 byte, storing the IC address of the data receiver (defined by the user); the event type is 1 byte, storing the control instruction (event type); the event sub-command is 1 byte, storing the control instruction (sub-commands are used to distinguish different situations under the same event type); the data length is variable length, with a maximum length of 65524 bytes (65535 - 11); the trailing check code is 2 bytes, and the data before the check code is checked using the CRC-16 / XMODEM protocol to obtain the check code. The communication group packet incorporates a CRC-16 / XMODEM single-packet check method to ensure the security of single-packet data transmission and the correctness of each packet data.
[0047] Optionally, the data packet includes chip name information, chip address information, and software version information. Since the final firmware burned into the microcontroller is a BIN file, it only contains the original firmware information. If a product has firmware for multiple ICs, an operator might misplace the firmware for IC1 in the location of IC2. During the upgrade, IC2's original firmware becomes IC1's, causing the chip to freeze. Therefore, it is necessary to include some upgrade information in the firmware, such as the chip name, chip address, and software version. This ensures a one-to-one correspondence between the upgraded firmware and the chip to be upgraded, preventing the aforementioned issues.
[0048] The utility model provides a single-chip microcomputer product, which is a main device in the above-mentioned upgrade system applied to multiple single-chip microcomputer products.
[0049] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0050] The above-described embodiments merely represent several implementations of the present invention. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the utility model patent. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements fall within the scope of protection of the present invention. Therefore, the scope of protection of the present utility model patent shall be determined by the appended claims.
Claims
1. An upgrade system for multiple single-chip microcomputer products, characterized in that: It includes a cloud server, a master device and at least one slave device, wherein the master device includes a communication module, a main IC chip and at least one sub-IC chip; The master device is communicatively connected to the cloud server via the communication module, the communication module is communicatively connected to the master IC chip, and the master IC chip is also communicatively connected to the sub-IC chip; the slave device is communicatively connected to one of the sub-IC chips of the master device; The cloud server stores a first upgrade package for the master device and a second upgrade package for the slave device; when the master device obtains the first upgrade package, the first upgrade package is transmitted to the master IC chip or the sub-IC chip; when the master device obtains the second upgrade package, the second upgrade package is forwarded to the slave device through one of the sub-IC chips.
2. The upgrade system for multiple single-chip microcomputer products according to claim 1, characterized in that: The communication module communicates with the main IC chip using a UART serial port, and the main IC chip communicates with the sub-IC chip using a UART serial port.
3. The upgrade system for multiple single-chip microcomputer products according to claim 2, characterized in that: The master device is IAP upgraded.
4. The upgrade system for multiple single-chip microcomputer products according to claim 1, characterized in that: Wireless communication is adopted between the slave device and one of the sub-IC chips.
5. The upgrade system for multiple single-chip microcomputer products according to claim 4, characterized in that: The slave device is upgraded via OTA.
6. The upgrade system for multiple single-chip microcomputer products according to claim 1, characterized in that: The main IC chip and the sub-IC chip are both provided with a BootLoader area, an APP1 area, an APP2 area, a BootSetting area and an APP_Custom area; The BootLoader area is used to store the startup code; The APP1 area is used to store application code; The APP2 area is used to store temporary upgrade codes; The BootSetting area is used to store upgrade information; The APP_Custom area is used to store user-defined data.
7. The upgrade system for multiple single-chip microcomputer products according to claim 1, characterized in that: The communication packet format of the upgrade package information consists of a frame header, an encryption byte, a whole packet length, an IC chip source address, an IC chip destination address, an event type, an event subcommand, a data packet and an end check code.
8. The upgrade system for multiple single-chip microcomputer products according to claim 7, characterized in that: The end check code is obtained by checking the data before the check code using the CRC-16 / XMODEM protocol.
9. The upgrade system for multiple single-chip microcomputer products according to claim 7, characterized in that: The data packet contains chip name information, chip address information and software version information.
10. A single chip microcomputer product, characterized in that: The single-chip microcomputer product includes the main device used in the upgrade system of multiple single-chip microcomputer products according to any one of claims 1 to 9.