A method for switching firmware of Tiantong module

Flexible switching of Tiantong module firmware versions on various platforms and environments is achieved through customized AT commands, which solves the limitations of firmware switching solutions in the existing technology and realizes the flexibility and function expansion of Tiantong modules.

CN114422356BActive Publication Date: 2024-08-23THE 54TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210057197.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2024-08-23
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

It is difficult to flexibly switch firmware versions of Tiantong modules under various platforms and environments with existing technology, and conventional firmware switching solutions that rely on dedicated software have limitations.

Method used

Realize data interaction between the host controller and Tiantong module through customized AT commands, send and load multiple firmware files, provide methods for querying and loading firmware files, and allow automatic firmware version switching on any platform and environment.

Benefits of technology

It achieves the simplification and unification of Tiantong module firmware transmission, supports various types of host platforms, improves the flexibility and convenience of firmware version switching, and expands the functional scope of Tiantong modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114422356B
    Figure CN114422356B
Patent Text Reader

Abstract

The present invention discloses a method for switching the firmware of a Tiantong module, and relates to the field of communication technology. In the present invention, a host controller communicates with the Tiantong module through AT commands, and the host controller can transfer multiple firmware files to the memory of the Tiantong module completely and accurately, and can select a certain stored firmware file as required. After the Tiantong module performs a series of checks on the firmware file, it will automatically soft-restart and load the firmware version to complete the switching of the firmware version of the Tiantong module. The present invention completes the data interaction between the host controller and the Tiantong module through AT commands, and can send multiple firmware files with different functions to the Tiantong module memory, and provides a method for querying and loading a certain firmware file, which is convenient for switching the firmware version of the Tiantong module as required at any time, and broadens the capability range of the Tiantong module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of satellite mobile communications, and in particular to a method for switching firmware of a satellite communication module. Background Art

[0002] Tiantong satellite is a GEO (geosynchronous orbit) satellite, which is stationary relative to the earth and fixed above the equator. Tiantong satellite covers the ground through multiple spot beams. Tiantong satellite communication system can realize voice, SMS and data services in areas without ground base station coverage such as the wild, desert, ocean and even high altitude. With the increasingly perfect functions of Tiantong-1 satellite services and the active deployment of Tiantong-2 and Tiantong-3, the fields and regions covered by Tiantong satellite services will become wider and wider. At the same time, the form of Tiantong terminal has also undergone many changes, such as the birth of Tiantong terminal for the Internet of Things, Tiantong terminal for data collection, Tiantong terminal for low-orbit satellites, etc. Tiantong modules are widely integrated in various platforms and used in various scenarios.

[0003] The Tiantong module has a rich set of external interfaces, including power interface, communication signal interface, control signal interface and debugging interface, and the communication signal interface includes USIM card interface, PCM interface, SDMMC interface, USB port and serial port. Among them, the USIM card interface is used to communicate with the SIM card, the PCM interface is used for audio communication with the host controller, and the SDMMC interface supports SD, SDIO or MMC data card communication. Both the USB port and the serial port can be used to communicate data with the host controller, but when using the USB interface, the host controller platform needs to be Windows or Android, and special drivers and special software must be installed, so there are some limitations in using the USB interface. Faced with the various forms of Tiantong terminal solutions, the types of host controllers include not only Windows and Android platforms, but also Linux / UNIX systems, single-chip microcomputers, FPGAs, arm, etc. The host controller and the Tiantong module can usually communicate through the serial port. As a baseband chip of the Tiantong system, the Tiantong module provides users with standard AT commands and custom AT commands. Using AT commands to initiate various operations on the Tiantong module is the most common behavior.

[0004] Since the use scenarios of Tiantong terminals are not only handheld or portable devices, but also IoT terminals without human intervention, data acquisition terminals, satellite payload terminals, etc.; even in the same use scenario, Tiantong modules may have different systems, such as private network system and public network system, etc. If you want the Tiantong module to flexibly switch different firmware versions, the conventional firmware switching solution that relies on dedicated software becomes stretched.

[0005] In order to achieve flexible switching of Tiantong terminal firmware versions, it is very important to automatically complete the firmware file transmission and firmware version loading of Tiantong modules through AT commands in any platform and any environment. Summary of the invention

[0006] The purpose of the present invention is to avoid the shortcomings mentioned in the background, and propose a method for switching the firmware of the Tiantong module, which completes the data interaction between the host controller and the Tiantong module through custom AT commands, can send multiple firmware files to the Tiantong module memory, and provides a method for querying and loading a certain firmware file, which facilitates the switching of the firmware version of the Tiantong module on demand at any time and broadens the functional scope of the Tiantong module.

[0007] In order to achieve the above object, the technical solution adopted by the present invention is:

[0008] A method for switching firmware of a Tiantong module comprises the following steps:

[0009] (1) The host controller carries data on AT commands to communicate with the Tiantong module;

[0010] (2) The host controller sends the firmware file to the Tiantong module, and the Tiantong module receives the firmware file;

[0011] (3) After receiving the complete firmware file, the Tiantong module verifies the firmware file. If the verification passes, it is saved to the Tiantong module memory, otherwise the firmware file is deleted;

[0012] (4) The host controller queries and selects the firmware files saved in the Tiantong module memory through AT commands, and selects to load one of the firmware files according to different usage scenarios to complete the Tiantong module firmware switching function.

[0013] Furthermore, in step (1), the data sent and received between the host controller and the Tiantong module are in the form of AT commands, and the carried data is encoded using base64.

[0014] Furthermore, the specific method of step (2) is:

[0015] (201) The host controller obtains the size of the firmware file to be sent, divides the firmware file into packets, and then sends the firmware file related information to the Tiantong module; the firmware file related information includes the file size of the firmware file, the data size of each packet after the packetization, the number of packets divided, the file name length, the file name, the MD5 check value length and the MD5 check value of the firmware file;

[0016] (202) After receiving the firmware file related information, the Tiantong module replies an ACK data frame to the host controller, and the host controller starts to transmit the firmware file data after receiving the ACK data frame from the Tiantong module;

[0017] (203) The host controller periodically sends the firmware file sub-packet data to the Tiantong module, and after the sending is completed, sends a transmission completion instruction to the Tiantong module;

[0018] (204) The Tiantong module receives the firmware file sub-packet data and checks whether there is any packet loss after receiving the transmission completion instruction;

[0019] (205) If packet loss occurs, the Tiantong module requests the host controller to retransmit the corresponding packet loss data. After receiving the retransmission request, the host controller jumps to step (203) and retransmits the packet loss data; if no packet loss occurs, the Tiantong module sends a transmission completion instruction to the host controller. After receiving the transmission completion instruction, the host controller ends the transmission.

[0020] Furthermore, the specific method of step (3) is:

[0021] (301) After receiving the complete firmware file, the Tiantong module first calculates the MD5 checksum of the received firmware file. If the MD5 checksum is consistent with the MD5 checksum in step (201), the Tiantong module stores the firmware file in the memory, otherwise, deletes the firmware file.

[0022] (302) After the Tiantong module stores the complete firmware file into the module memory, if the firmware file is a compressed package file, it is decompressed and restored to the original firmware file.

[0023] Furthermore, the specific method of step (4) is:

[0024] (401) The host controller queries the firmware files stored in the memory of the Tiantong module through AT commands, and selects the firmware version to be loaded by the Tiantong module through AT commands according to the usage scenario;

[0025] (402) The Tiantong module performs integrity check and legality check on the selected firmware file. If the check passes, the Tiantong module automatically soft-restarts. If the check fails, the existing firmware version program continues to run;

[0026] (403) After the Tiantong module soft restarts, the boot program loads the selected firmware file from the memory to replace the original firmware, completing the firmware switch.

[0027] The beneficial effects of the present invention are:

[0028] 1. The present invention simplifies and unifies the way of transmitting the firmware of the Tiantong module. As long as various types of single-chip microcomputers, FPGA, arm, linux / UNIX hosts or windows hosts and Android machines without special software installed can send AT commands to the Tiantong module, the host controller can send multiple firmware files to the Tiantong module through custom AT commands, which is universal.

[0029] 2. In the present invention, the host controller can query the firmware files in the memory of the Tiantong module at any time through a custom AT command. The host controller can select one of the firmware files according to the current usage scenario, and the Tiantong module will automatically complete the switch to the specified firmware version. The present invention is more flexible, convenient and fast in completing the switching of firmware versions. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a structural diagram of the Tiantong module firmware switching device.

[0031] Figure 2 This is a schematic diagram of the data interaction structure between the host controller and the Tiantong terminal.

[0032] Figure 3 This is a schematic diagram of the data interaction process between the host controller and the Tiantong terminal.

[0033] Figure 4 Schematic diagram of the process of switching firmware versions for the Tiantong module. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the present invention more clear and understandable, and to make the protection scope of the claims more clear, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0035] like Figure 1 As shown, a method for switching the firmware of a Tiantong module comprises the following steps:

[0036] (1) The host controller carries data on AT commands to communicate with the Tiantong module;

[0037] like Figure 1 As shown, the host controller in this embodiment is an application running on Linux, and the Tiantong module is installed on the Tiantong module debugging baseboard. The Tiantong module debugging baseboard serves as the peripheral circuit of the Tiantong module, supplies power to the Tiantong module, and provides peripheral devices such as a serial port output interface and a USB debugging port. The host controller can communicate with the Tiantong module using AT commands via USB or serial port.

[0038] In this embodiment, the Tiantong module and the host controller exchange data using a custom AT command, that is, the host controller sends data to the Tiantong module via AT^DOTA="DATA", and the Tiantong module returns data to the host controller via ^DOTA="DATA_ACK". DATA and DATA_ACK use the base64 encoding format of the original data to reduce the probability of errors.

[0039] (2) The host controller sends the firmware file to the Tiantong module, and the Tiantong module receives the firmware file;

[0040] In this embodiment, the host controller needs to accurately transfer the firmware file to the Tiantong module. The data transmission protocol between the host controller and the Tiantong module adopts the retransmission request protocol. The data interaction structure and flow diagram between the host controller and the Tiantong module are shown in FIG. Figure 2 , Figure 3 The specific process includes the following steps:

[0041] A. The host controller sends a start request to the Tiantong module. The start request frame includes the file size of the firmware file, the data size of each packet after packetization, the number of packets, the file name length and file name, the MD5 checksum length and the MD5 checksum of the firmware file. The firmware file here can be the original firmware file or a compressed file of the firmware file. Using a compressed package for transmission can speed up the transmission speed and shorten the time of transmitting the firmware to the Tiantong module. The format of the start request frame is:

[0042]

[0043] B. After receiving the start sending request frame from the host controller, the Tiantong module replies with a start sending confirmation frame to the host controller, prompting the host controller to send data. The format of the start sending confirmation frame is:

[0044] Data Types Subtype 1byte 1byte 0xCE 0x02

[0045] C. After receiving the start sending confirmation frame from the Tiantong module, the host controller will periodically send the firmware file sub-packet data to the Tiantong module. The data frame includes the current sub-packet mark, total data length, data content length, data content and CRC check. The format of the data frame is:

[0046]

[0047] D. After the host controller sends the firmware file subpackaging data, it sends an end-send request frame to the Tiantong module, where the end-send request frame format is:

[0048] Data Types Subtype 1byte 1byte 0xCE 0x03

[0049] E. After the Tiantong module receives the end-sending request frame from the host controller, it determines whether the complete firmware file has been received based on the number of packets in the start-sending request frame and the sub-packet mark in the send data frame. If the complete firmware file is not received due to packet loss or CRC check failure, the Tiantong module will send a data retransmission request frame to the host controller to request the host controller to resend the lost firmware file sub-packet. The data content of the data retransmission request frame indicates the mark of the sub-packet that needs to be retransmitted. The format of the data retransmission request frame is:

[0050] Data Types Subtype Data content length Data content 1byte 1byte 2 bytes Nbytes 0xCE 0x01 Length ......

[0051] F. After receiving the data retransmission request frame, the host controller parses the packet mark in the data content of the frame, and resends the corresponding firmware file packet data to the Tiantong module according to the sending data frame format.

[0052] G. After the Tiantong module receives the end transmission request frame from the host controller, it determines whether the complete firmware file has been received based on the number of packets in the start transmission request frame and the sub-packet mark in the transmission data frame. If the complete firmware file has been received, it sends a transmission completion data frame to the host controller to end the data transmission process. The transmission completion data frame format is:

[0053] Data Types Subtype 1byte 1byte 0xCE 0x04

[0054] (3) After receiving the complete firmware file, the Tiantong module verifies the firmware file. If the verification passes, it is saved in the Tiantong module memory; otherwise, the firmware file is deleted.

[0055] In this embodiment, the MD5 value of the firmware file is calculated and compared with the MD5 value in the request frame sent in step (2) to determine whether the file is verified. If it passes the verification, it is saved in the Tiantong module memory, otherwise the file is discarded. If the firmware file stored in the memory is a compressed file, it is also necessary to decompress it to restore the original firmware file.

[0056] (4) The host controller queries and selects the firmware files saved in the Tiantong module memory through AT commands, and selects to load one of the firmware files according to different usage scenarios to complete the Tiantong module firmware switching function.

[0057] In this embodiment, multiple complete firmware files can be stored in the memory of the Tiantong module. The host controller selects one of the firmware versions according to different usage scenarios. The Tiantong module will automatically complete the process of switching to the firmware version. The software flow diagram of the process is as follows: Figure 4 As shown, the specific steps include:

[0058] A. The host controller uses the AT command AT^DOTA? to query the firmware version stored in the memory of the Tiantong module. For example, in a certain scenario, the host controller uses the AT command

[0059] AT^SELECT=" / usr / version_xxx.bins",1 select the firmware version.

[0060] B. The Tiantong module verifies the integrity and legality of the firmware file named version_xxx.bins. If the verification passes, the switch flag of the specific address in nvram is set and the Tiantong module is soft-restarted. If the verification fails, the Tiantong module will exit the firmware switching process and continue to run the original firmware program.

[0061] C. After the Tiantong module is soft-restarted, BOOTROM is started first, and the first-level BOOTLOADER_A is moved to the on-chip RAM. BOOTLOADER_A initializes the system and moves the second-level BOOTLOADER_B to SDRAM. BOOTLOADER_B searches for the burning table according to the partition management information specified during burning, and moves each burned BIN file data to the corresponding position of SDRAM through the NFTL interface according to the burning table. In this implementation, the UPDATE BIN partition file data will be loaded. The role of the UPDATE BIN partition is to act as a mini booter, where the value of the specific address switch flag in nvram is read. If the switch flag is set, the firmware file in the Tiantong module memory is moved to SDRAM, and finally the program jumps to the updated BIN file to run the new firmware program. If the switch flag is not set, exit the firmware switching process, run the regular booter, load the original BIN file, and run the original firmware program.

[0062] In summary, the present invention transmits firmware files to the Tiantong module, queries and selects the firmware version stored in the Tiantong module memory, and enables the Tiantong module to complete the firmware version switching function only by sending AT commands to the Tiantong module. The firmware switching process of the Tiantong module of the present invention is no longer limited to a specific platform and dedicated software. The firmware switching process is more flexible and convenient, enabling a Tiantong module to have the ability of multiple versions of functions, and broadening the capability range of the Tiantong module.

[0063] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the reasons of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.

Claims

1. A method for switching the firmware of a Tiantong module, characterized in that: The following steps are involved: (1) The host controller carries data on AT commands to communicate with the Tiantong module; (2) The host controller sends the firmware file to the Tiantong module, and the Tiantong module receives the firmware file; (3) After receiving the complete firmware file, the Tiantong module verifies the firmware file. If the verification passes, it is saved to the Tiantong module memory, otherwise the firmware file is deleted; (4) The host controller queries and selects the firmware files saved in the Tiantong module memory through AT commands, and selects to load one of the firmware files according to different usage scenarios to complete the Tiantong module firmware switching function.

2. A method for switching Tiantong module firmware according to claim 1, characterized in that: In step (1), the data sent and received between the host controller and the Tiantong module are in the form of AT commands, and the carried data is encoded using base64.

3. A method for switching Tiantong module firmware according to claim 2, characterized in that: The specific method of step (2) is: (201) The host controller obtains the size of the firmware file to be sent, divides the firmware file into packets, and then sends the firmware file related information to the Tiantong module; the firmware file related information includes the file size of the firmware file, the data size of each packet after the packetization, the number of packets divided, the file name length, the file name, the MD5 check value length and the MD5 check value of the firmware file; (202) After receiving the firmware file related information, the Tiantong module replies an ACK data frame to the host controller, and the host controller starts to transmit the firmware file data after receiving the ACK data frame from the Tiantong module; (203) The host controller periodically sends the firmware file sub-packet data to the Tiantong module, and after the sending is completed, sends a transmission completion instruction to the Tiantong module; (204) The Tiantong module receives the firmware file sub-packet data, and after receiving the transmission completion instruction, checks whether there is any packet loss; (205) If packet loss occurs, the Tiantong module requests the host controller to retransmit the corresponding packet loss data. After receiving the retransmission request, the host controller jumps to step (203) and retransmits the packet loss data; If there is no packet loss, the Tiantong module sends a transmission completion command to the host controller. After receiving the transmission completion command, the host controller ends the transmission.

4. A method for switching Tiantong module firmware according to claim 3, characterized in that: The specific method of step (3) is: (301) After receiving the complete firmware file, the Tiantong module first calculates the MD5 checksum of the received firmware file. If the MD5 checksum is consistent with the MD5 checksum in step (201), the Tiantong module stores the firmware file in the memory, otherwise, deletes the firmware file. (302) After the Tiantong module stores the complete firmware file into the module memory, if the firmware file is a compressed package file, it is decompressed and restored to the original firmware file.

5. A method for switching Tiantong module firmware according to claim 4, characterized in that: The specific method of step (4) is: (401) The host controller queries the firmware files stored in the memory of the Tiantong module through AT commands, and selects the firmware version to be loaded by the Tiantong module through AT commands according to the usage scenario; (402) The Tiantong module performs integrity check and legality check on the selected firmware file. If the check passes, the Tiantong module automatically soft-restarts. If the check fails, the existing firmware version program continues to run; (403) After the Tiantong module soft restarts, the boot program loads the selected firmware file from the memory to replace the original firmware, completing the firmware switch.