CN114422356B - Method for switching firmware of Tiantong module - Google Patents
Method for switching firmware of Tiantong module Download PDFInfo
- Publication number
- CN114422356B CN114422356B CN202210057197.7A CN202210057197A CN114422356B CN 114422356 B CN114422356 B CN 114422356B CN 202210057197 A CN202210057197 A CN 202210057197A CN 114422356 B CN114422356 B CN 114422356B
- Authority
- CN
- China
- Prior art keywords
- tiantong
- module
- firmware
- file
- firmware file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
- H04L41/082—Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/76—Adapting program code to run in a different environment; Porting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/004—Arrangements for detecting or preventing errors in the information received by using forward error control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0078—Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
- H04L1/0083—Formatting with frames or packets; Protocol or part of protocol for error control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/1607—Details of the supervisory signal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0823—Errors, e.g. transmission errors
- H04L43/0829—Packet loss
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
- H04L9/3239—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Environmental & Geological Engineering (AREA)
- Stored Programmes (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及卫星移动通信领域,特别是指一种天通模块固件切换的方法。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
天通卫星属于GEO(地球同步轨道)卫星,相对地球静止,定点于赤道上空,天通卫星通过多个点波束的方式对地面进行覆盖。天通卫星通信系统能够在野外、沙漠、海洋甚至高空等无地面基站覆盖的区域实现话音、短信和数据等业务。随着天通一号卫星业务的功能日趋完善,天通二号、天通三号的积极部署,天通卫星业务覆盖的领域和地域将越来越广。同时天通终端的形态也发生了多种变化,比如催生了物联网天通终端,数据采集天通终端,低轨卫星天通终端等等,天通模块广泛集成在各种平台中,应用在各种场景下。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. The 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 terminals has also undergone many changes, such as the birth of Tiantong terminals for the Internet of Things, Tiantong terminals for data collection, Tiantong terminals for low-orbit satellites, etc. Tiantong modules are widely integrated in various platforms and used in various scenarios.
天通模块具有丰富的对外接口,其中包括电源接口,通信信号接口,控制信号接口和调试接口,而通信信号接口中又包括USIM卡接口,PCM接口,SDMMC接口,USB口和串口。其中,USIM卡接口用于与SIM卡通信,PCM接口用于与主机控制器音频通信,SDMMC接口支持SD、SDIO或MMC数据卡通信。USB口和串口都可以用来与主机控制器进行数据通信,不过使用USB接口时需要主机控制器平台为windows或android,并安装专用驱动和专用软件,因此使用USB接口的使用存在一些局限性。面对形态繁多的天通终端解决方案,主机控制器的种类不仅有windows和android平台,还有linux/UNIX系统、单片机、FPGA、arm等,主机控制器与天通模块之间通常可以通过串口进行通信。而天通模块作为天通体制的基带芯片,对用户提供标准的AT命令和自定义的AT命令,使用AT命令对天通模块发起各种操作是最常见的行为。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 need to 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 customized AT commands. Using AT commands to initiate various operations on the Tiantong module is the most common behavior.
由于天通终端的使用场景不仅仅是手持机或便携机,还有无人工参与的物联网终端,数据采集终端,卫星载荷终端等等;即便同一使用场景下,天通模块也可能存在不同的体制,比如专网体制和公网体制等等。那么想要天通模块灵活切换不同的固件版本,常规的依赖专用软件的固件切换方案变得捉襟见肘。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.
为了实现天通终端固件版本的灵活切换,在任何平台中和任何环境下,通过AT命令就能自动完成对天通模块的固件文件传输和固件版本的加载变得十分重要。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
本发明的目的在于避免背景中提到的不足,提出一种天通模块固件切换的方法,其通过自定义AT命令完成主机控制器和天通模块之间的数据交互,可将多个固件文件发送到天通模块存储器中,并提供了查询和加载某一固件文件的方法,方便了随时按需切换天通模块的固件版本,扩宽了天通模块的功能范围。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.
为了实现上述目的,本发明采用的技术方案为:In order to achieve the above object, the technical solution adopted by the present invention is:
一种天通模块固件切换的方法,包括以下步骤:A method for switching firmware of a Tiantong module comprises the following steps:
(1)主机控制器将数据承载在AT命令上与天通模块进行通信;(1) The host controller carries data on AT commands to communicate with the Tiantong module;
(2)主机控制器向天通模块发送固件文件,天通模块接收固件文件;(2) The host controller sends the firmware file to the Tiantong module, and the Tiantong module receives the firmware file;
(3)天通模块收到完整的固件文件后,对固件文件进行校验,若校验通过则将其保存到天通模块存储器中,否则将该固件文件删除;(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;
(4)主机控制器通过AT命令查询和选择天通模块存储器中已保存的固件文件,并根据不同使用场景选择加载其中某一固件文件以完成天通模块固件切换的功能。(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.
进一步的,步骤(1)中,主机控制器与天通模块之间收发数据均采用的AT命令形式,且承载的数据采用base64进行编码。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.
进一步的,步骤(2)的具体方式为:Furthermore, the specific method of step (2) is:
(201)主机控制器获取待发送固件文件的大小,将固件文件进行分包,然后将固件文件相关信息发送到天通模块;所述固件文件相关信息包括固件文件的文件大小、分包后每包的数据大小、分包的包数、文件名称长度、文件名称、MD5校验值长度和固件文件的MD5校验值;(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 of the packetization, the file name length, the file name, the MD5 check value length and the MD5 check value of the firmware file;
(202)天通模块收到固件文件相关信息后向主机控制器回复ACK数据帧,主机控制器收到天通模块的ACK数据帧后开始传输固件文件数据;(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)主机控制器周期性地向天通模块发送固件文件分包数据,并在发送完成后向天通模块发送传输完成指令;(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)天通模块接收固件文件分包数据,并在收到传输完成指令后,检查是否有丢包;(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)如果出现丢包,天通模块向主机控制器请求重传对应的丢包数据,主机控制器收到重传请求后跳转到步骤(203)并重传丢包数据;如果没有丢包,天通模块向主机控制器发送传输完成指令,主机控制器收到传输完成指令后,结束传输。(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.
进一步的,步骤(3)的具体方式为:Furthermore, the specific method of step (3) is:
(301)天通模块收到完整的固件文件后,首先计算接收固件文件的MD5校验值,如果该值与步骤(201)中的MD5校验值一致,则天通模块将固件文件存储到存储器中,否则将该固件文件删除;(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)天通模块将完整的固件文件存储到模块存储器后,如果固件文件为压缩包文件,则将其解压恢复出原始固件文件。(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.
进一步的,步骤(4)的具体方式为:Furthermore, the specific method of step (4) is:
(401)主机控制器通过AT命令查询天通模块存储器中已存储的固件文件,并根据使用场景通过AT命令选择天通模块将要加载的固件版本;(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)天通模块对选中的固件文件进行完整性校验和合法性校验,校验通过后天通模块自动软重启,若校验失败则继续运行现有固件版本程序;(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)天通模块软重启后,通过引导程序,从存储器中加载选中的固件文件,替换原固件,完成固件切换。(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.
本发明的有益效果在于:The beneficial effects of the present invention are:
1、本发明将天通模块固件传输的方式进行了简化和统一,各种类型的单片机、FPGA、arm、linux/UNIX主机或没有安装专用软件的windows主机和安卓机,只要能够向天通模块发送AT命令,都可以通过自定义AT命令完成主机控制器向天通模块发送多个固件文件的功能,具有通用性。1. The present invention simplifies and unifies the way of firmware transmission of Tiantong module. Various types of single-chip microcomputers, FPGA, arm, linux/UNIX hosts or windows hosts and Android machines without special software installed, as long as they can send AT commands to the Tiantong module, can complete the function of the host controller sending multiple firmware files to the Tiantong module through custom AT commands, which is universal.
2、本发明中,主机控制器可以随时通过自定义的AT命令查询天通模块存储器中的固件文件,主机控制器可以根据当前使用场景选择其中一个固件文件,天通模块将自动完成向该指定固件版本的切换。本发明在完成固件版本的切换方面更加灵活方便快捷。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
图1为天通模块固件切换装置的结构示意图。FIG1 is a schematic diagram of the structure of the firmware switching device of the Tiantong module.
图2为主机控制器与天通终端数据交互结构示意图。Figure 2 is a schematic diagram of the data interaction structure between the host controller and the Tiantong terminal.
图3为主机控制器与天通终端数据交互流程示意图。Figure 3 is a schematic diagram of the data interaction process between the host controller and the Tiantong terminal.
图4为天通模块切换固件版本流程示意图。Figure 4 is a schematic diagram of the process of switching firmware versions of the Tiantong module.
具体实施方式DETAILED DESCRIPTION
为了使本发明的目的、技术方案及优点更加清楚明白,并使权利要求书的保护范围更加明确,下面结合附图和实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用于解释本发明,并不用于限定本发明。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.
如图1所示,一种天通模块固件切换的方法,包括以下步骤:As shown in FIG1 , a method for switching firmware of a Tiantong module includes the following steps:
(1)主机控制器将数据承载在AT命令上与天通模块进行通信;(1) The host controller carries data on AT commands to communicate with the Tiantong module;
如图1所示,本实施例中的主机控制器为运行在linux上的应用程序,天通模块安装在天通模块调试底板上,天通模块调试底板作为天通模块的外围电路,对天通模块供电,并提供串口输出接口,USB调试口等外围器件。主机控制器可通过USB或串口使用AT命令与天通模块进行通信。As shown in Figure 1, the host controller in this embodiment is an application running on Linux. 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.
本实施例中天通模块与主机控制器交互数据采用自定义AT命令的方式,即主机控制器通过AT^DOTA=”DATA”向天通模块发送数据,而天通模块通过^DOTA=”DATA_ACK”向主机控制器返回数据。DATA和DATA_ACK采用原始数据的base64编码格式,以降低出错误的概率。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.
(2)主机控制器向天通模块发送固件文件,天通模块接收固件文件;(2) The host controller sends the firmware file to the Tiantong module, and the Tiantong module receives the firmware file;
本实施例中主机控制器需要将固件文件准确无误地传输到天通模块,主机控制器和天通模块数据传输协议采用重传请求协议,主机控制器与天通模块数据交互结构和流程示意图如图2,图3所示。具体过程包括以下步骤: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 Figures 2 and 3. The specific process includes the following steps:
A.主机控制器向天通模块发送开始发送请求,开始发送请求帧包括固件文件的文件大小,分包后每包的数据大小,分包的包数,文件名称长度和文件名称,MD5校验值长度和固件文件的MD5校验值。这里固件文件可以是原始固件文件或者固件文件的压缩文件,采用压缩包进行传输可以加快传输速度,缩短向天通模块固件传输的时间。其中开始发送请求帧格式为: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:
B.天通模块收到主机控制器的开始发送请求帧后,向主机控制器回复开始发送确认帧,提示主机控制器可以发送数据。其中开始发送确认帧格式为: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:
C.主机控制器收到天通模块的开始发送确认帧后,将周期性向天通模块发送固件文件分包数据,发送数据帧包括当前分包的标记,数据总长度,数据内容长度,数据内容和CRC校验。其中发送数据帧格式为:C. After receiving the start transmission 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:
D.主机控制器发送完成固件文件分包数据后,向天通模块发送结束发送请求帧,其中结束发送请求帧格式为: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:
E.天通模块收到主机控制器的结束发送请求帧后,根据开始发送请求帧中的包数和发送数据帧中的分包的标记判断是否收到完整固件文件,如果因为丢包或者CRC校验失败导致没有收到完整固件文件,天通模块将向主机控制器发送数据重传请求帧以请求主机控制器重新发送丢失的固件文件分包,数据重传请求帧的数据内容里指明了需要重传的分包的标记。其中数据重传请求帧格式为: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:
F.主机控制器收到数据重传请求帧后,解析该帧的数据内容中的包标记,并按照发送数据帧格式向天通模块重新发送对应的固件文件分包数据。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.
G.天通模块收到主机控制器的结束发送请求帧后,根据开始发送请求帧中的包数和发送数据帧中的分包的标记判断是否收到完整固件文件,如果收到完整固件文件,则向主机控制器发送传输完成数据帧以结束数据传输过程。其中传输完成数据帧格式为:G. After receiving the end transmission request frame from the host controller, the Tiantong module 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:
(3)天通模块收到完整的固件文件后,对固件文件进行校验,若校验通过则将其保存到天通模块存储器中,否则将该固件文件删除。(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.
本实施例中,通过计算固件文件的MD5值,与步骤(2)中开始发送请求帧中的MD5值进行对比,来判断是否校验通过该文件,如果通过校验则将其保存到天通模块存储器中,否则将丢弃该文件。如果保存在存储器中的固件文件为压缩文件,还需要将其解压恢复出原始固件文件。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.
(4)主机控制器通过AT命令查询和选择天通模块存储器中已保存的固件文件,并根据不同使用场景选择加载其中某一固件文件以完成天通模块固件切换的功能。(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.
本实施例中,天通模块存储器中可以保存多个完整的固件文件,主机控制器根据使用场景的不同选择其中一个固件版本,天通模块将自动完成向固件版本切换过程,该过程的软件流程示意图如图4所示,具体包括以下步骤:In this embodiment, multiple complete firmware files can be stored in the Tiantong module memory. 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 shown in Figure 4, which specifically includes the following steps:
A.主机控制器通过AT命令AT^DOTA?查询天通模块存储器中保存的固件版本。如在某一场景下,主机控制器通过AT命令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
AT^SELECT=”/usr/version_xxx.bins”,1选择该固件版本。AT^SELECT="/usr/version_xxx.bins",1 select the firmware version.
B.天通模块对名为version_xxx.bins的固件文件的完整性与合法性进行校验,如果校验通过,则将nvram中特定地址的切换标识置位,并进行天通模块软重启。如果校验未通过,则天通模块将退出固件切换过程,继续运行原固件程序。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.
C.天通模块软重启后,首先BOOTROM启动,并搬移第一级BOOTLOADER_A到片内RAM,BOOTLOADER_A对系统初始化,并搬移第二级BOOTLOADER_B到SDRAM,BOOTLOADER_B根据烧录时规定的分区管理信息,搜索烧录表,并根据烧录表将各个烧录的BIN文件数据,通过NFTL接口搬移到SDRAM相应的位置。本实施中将加载UPDATE BIN分区文件数据,UPDATE BIN分区的作用是作为一个迷你booter,在这里读取nvram中特定地址切换标识位的值,如果该切换标识置位,则将天通模块存储器中的固件文件搬移到SDRAM,最后将程序跳转到更新后的BIN文件,运行新固件程序。如果切换标识未置位,则退出固件切换过程,运行常规的booter,并加载原始BIN文件,运行原固件程序。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.
总之,本发明仅通过向天通模块发送AT命令的方式,实现了向天通模块传输固件文件,查询和选择天通模块存储器中存储的固件版本,使天通模块完成固件版本切换的功能。本发明的天通模块固件切换的过程不再局限于特定平台和专用软件,固件切换过程更加灵活方便,使一个天通模块具备多个版本功能的能力,扩宽了天通模块的能力范围。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.
应当理解的是,本发明的上述具体实施方式仅仅用于示例性说明或解释本发明的原因,而不构成对本发明的限制。因此在不偏离本发明的精神和范围的情况下所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。此外,本发明所附权利要求旨在涵盖落入所附权利要求范围和边界、或者这种范围和边界的等同形式内的全部变化和修改例。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 (5)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210057197.7A CN114422356B (en) | 2022-01-19 | 2022-01-19 | Method for switching firmware of Tiantong module |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210057197.7A CN114422356B (en) | 2022-01-19 | 2022-01-19 | Method for switching firmware of Tiantong module |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114422356A CN114422356A (en) | 2022-04-29 |
| CN114422356B true CN114422356B (en) | 2024-08-23 |
Family
ID=81272496
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210057197.7A Active CN114422356B (en) | 2022-01-19 | 2022-01-19 | Method for switching firmware of Tiantong module |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114422356B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114745470A (en) * | 2022-06-13 | 2022-07-12 | 成都星联芯通科技有限公司 | Communication method, device, terminal and storage medium based on skynet module |
| CN115080502A (en) * | 2022-06-24 | 2022-09-20 | 深圳市帝晶光电科技有限公司 | A method and system for quickly selecting multiple firmware for FPGA |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105094916A (en) * | 2015-08-10 | 2015-11-25 | 深圳市中兴物联科技有限公司 | Method and device for wireless firmware upgrading expansion based on module |
| CN111953726A (en) * | 2019-05-16 | 2020-11-17 | 横河电机株式会社 | Device, communication module, application module and method |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1672938A1 (en) * | 2004-12-14 | 2006-06-21 | Sony Ericsson Mobile Communications AB | Portable radio communication equipment enabling a firmware update of a connected accesory over the air |
| CN102339227A (en) * | 2010-07-28 | 2012-02-01 | 环旭电子股份有限公司 | Multi-firmware embedded system and firmware update method thereof |
| CN110908701B (en) * | 2018-09-14 | 2024-01-30 | 北京小米松果电子有限公司 | Firmware version switching method and device, storage medium and electronic equipment |
| CN111416878A (en) * | 2020-05-14 | 2020-07-14 | 深圳市友恺通信技术有限公司 | Upgrading method through hardware encryption and satellite mobile phone |
-
2022
- 2022-01-19 CN CN202210057197.7A patent/CN114422356B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105094916A (en) * | 2015-08-10 | 2015-11-25 | 深圳市中兴物联科技有限公司 | Method and device for wireless firmware upgrading expansion based on module |
| CN111953726A (en) * | 2019-05-16 | 2020-11-17 | 横河电机株式会社 | Device, communication module, application module and method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114422356A (en) | 2022-04-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN114422356B (en) | Method for switching firmware of Tiantong module | |
| KR100663538B1 (en) | Wireless (OTA) software upgrade system and method according to delta file in wireless terminal | |
| US5699275A (en) | System and method for remote patching of operating code located in a mobile unit | |
| CN110704077A (en) | Firmware remote upgrading method and device, terminal, mobile device and storage medium | |
| WO2021083244A1 (en) | Multi-device batch firmware upgrade method for mesh network device | |
| CN113721966A (en) | Node upgrading method and device, storage medium and electronic device | |
| CN109906631B (en) | Adaptive transmission method and device | |
| CN112491511B (en) | Communication method and device | |
| CN113918202B (en) | Method and equipment for supporting IAP function for remotely upgrading firmware by singlechip | |
| WO2023103830A1 (en) | Satellite short message multicast method and related apparatus | |
| CN112737847B (en) | Node upgrading method and device, storage medium and electronic device | |
| US20110090889A1 (en) | Communication system | |
| CN109688208B (en) | Data loading method based on FC-AE-ASM message | |
| CN116321015A (en) | Method and related device for satellite multicast short message | |
| CN114301576A (en) | Method and communication device for generating and transmitting acknowledgement frame in IEEE 802.15.4 network | |
| BRPI0616482A2 (en) | Method for setting up the connection between first and second counterparts in a wireless telecommunications network, wireless telecommunications network, and mobile terminal | |
| CN114285460B (en) | Satellite measurement and control method, device, electronic equipment, storage medium and program product | |
| CN110224745B (en) | Satellite broadband data uploading system and method | |
| CN116795404A (en) | Upgrading method and system of server power firmware and WiFi assembly | |
| CN116582826A (en) | Message transmission method, electronic equipment and storage medium | |
| CN112039801B (en) | Method, system and proxy server for setting IP information | |
| CN110928562B (en) | Software upgrading method for Android box | |
| JP2002300071A (en) | Software radio receiver, its control method, server, its control method, and information recording medium | |
| CN112214425A (en) | Data transmission method, apparatus, computer equipment, and storage medium | |
| CN118733344A (en) | Firmware upgrade package backup method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |