Firmware upgrading method and device for system-on-chip, equipment and medium

Through the multi-channel data allocation and retransmission mechanism between the system-level chip and the host computer, the channel rate is used to balance the transmission time of each channel, and the problem of slow download of firmware offline upgrade packages is solved, and efficient firmware upgrade is achieved.

CN120234029APending Publication Date: 2025-07-01SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510360491.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The existing offline firmware upgrade method causes slow download of firmware upgrade packages on low-speed simulation platforms, affecting R&D efficiency.

Method used

By performing data allocation and retransmission mechanisms between multiple available communication peripherals between the system-level chip and the host computer, the channel rate is used to equalize the transmission time of each channel and dynamically update the channel state, multi-channel parallel transmission is achieved.

Benefits of technology

It improves the efficiency and data transmission rate of firmware upgrades, ensures high-quality transmission of firmware offline upgrade packages, and solves the problem of slow communication rates of complex system-level chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234029A_ABST
    Figure CN120234029A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware upgrading method, device and equipment for a system-on-chip and a medium, relates to the technical field of chips, is applied to an upper computer, and comprises the following steps: carrying out data distribution on current firmware upgrading data according to a current available channel and a data transmission rate of each sub-channel of the current available channel to determine data to be transmitted; respectively sending the data to be transmitted to a system-level chip through each sub-channel; if a first acknowledgement frame is received, updating a retransmission matrix according to a target sub-channel corresponding to the first acknowledgement frame, and retransmitting target to-be-transmitted data corresponding to the first acknowledgement frame according to a target available sub-channel determined based on the updated retransmission matrix during next data transmission until all to-be-transmitted data are transmitted; and if the second acknowledgement frame is received, firmware upgrading is carried out according to all to-be-transmitted data when the to-be-transmitted data transmission ends and all the to-be-transmitted data are successfully transmitted in the previous round of data transmission of each sub-channel. And the firmware upgrading efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip technology, and particularly to a method, device, equipment and medium for firmware upgrade of a system-on-chip. Background Art

[0002] Before chip tape-out, various forms of simulation verification are often required for the target SoC (System on Chip). For different simulation environments, the firmware upgrade methods of the SoC also vary, generally divided into online upgrade and offline upgrade. Online upgrade is often used after product commercialization. An online upgrade package is sent from the cloud to perform a seamless upgrade on the system. However, in the middle and late stages of the R & D project of a highly integrated SoC, the firmware version iterates relatively frequently, and at this time, the hardware constraints are often relatively fixed, making it difficult to disassemble the Flash (Flash memory, also known as flash mermory. As a kind of flash memory, it is a non-volatile memory (i.e., data will not be lost when the power is off). Flash is often used as a device to store the system startup firmware in embedded development) to complete the upgrade of the firmware program. If the system has not yet developed an online upgrade function or using online upgrade occupies a large amount of R & D resources, R & D personnel usually use the firmware offline upgrade method, that is, burn the firmware program to be upgraded of the target SoC into the Flash it mounts.

[0003] Generally speaking, the offline upgrade of the firmware is divided into three stages: the first is to download the program to be burned from the host computer to the target SoC memory for temporary storage; the second is to verify the downloaded program; the third is to burn the program with successful verification into the Flash through the Flash burning algorithm. On a high-speed simulation platform, its clock frequency is relatively high, and the firmware offline upgrade time is also relatively short; but on some low-speed simulation platforms, as the integration degree of the subsystem increases, the clock frequency will gradually decrease, thereby reducing the transmission rate of some communication buses, such as UART (Universal Asynchronous Receiver / Transmitter) and I2C (Inter-Integrated Circuit, an integrated circuit interconnection bus). Such peripherals are commonly found in various embedded systems. The existing firmware offline upgrade methods often use such peripherals for firmware download, which leads to the problem of slow firmware upgrade package download, thereby affecting the R & D efficiency. Taking a certain project as an example, at a very low system clock frequency (1.2MHz), it takes about 90 minutes to complete the offline upgrade of a firmware upgrade package (about 1.7MB in size). In the R & D stage, this will greatly slow down the R & D progress. It can be seen that how to improve the efficiency of firmware upgrade is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] The object of the embodiments of the present invention is to provide a method, device, equipment and medium for firmware upgrade of a system-on-chip, which can improve the firmware upgrade efficiency and enhance the data transmission rate. The specific solution is as follows:

[0005] In a first aspect, the present invention provides a method for firmware upgrade of a system-on-chip, which is applied to a host computer and includes:

[0006] Allocate the current firmware upgrade data according to the current available channels of the system-on-chip and the data transmission rates of the sub-channels of the current available channels to determine the data to be transmitted on each sub-channel;

[0007] Send the corresponding data to be transmitted on each sub-channel to the system-on-chip through each sub-channel;

[0008] If the first acknowledgment frame returned by the system-on-chip is received, update the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame, and retransmit the target data to be transmitted corresponding to the first acknowledgment frame according to the target available sub-channel determined based on the updated retransmission matrix in the next round of data transmission until all the data to be transmitted is transmitted; the first acknowledgment frame is used to indicate that the transmission of the target data to be transmitted on the target sub-channel fails; the retransmission matrix is used to record the information indicating whether the data transmission on each sub-channel in the previous round is successful;

[0009] If the second acknowledgment frame returned by the system-on-chip is received, perform firmware upgrade according to all the data to be transmitted when all the data to be transmitted is transmitted and the data to be transmitted on each sub-channel in the previous round of data transmission is all successfully transmitted; the second acknowledgment frame is used to indicate that the transmission of the data to be transmitted on the sub-channel is successful.

[0010] Optionally, before allocating the current firmware upgrade data according to the current available channels of the system-on-chip and the data transmission rates of the sub-channels of the current available channels, it further includes:

[0011] Send probe frames to the system-on-chip through the channels of the universal asynchronous receiver / transmitter and / or the integrated circuit bus respectively, and determine each available channel according to the system-on-chip and the probe frames sent by each channel; the probe frame is used to detect the available channels between the host computer and the system-on-chip;

[0012] If the system-on-chip returns a corresponding third acknowledgment frame after receiving the probe frame sent by the channel, determine that the current channel is an available channel; the third acknowledgment frame is used to indicate that the system-on-chip successfully receives the probe frame;

[0013] Otherwise, determine that the current channel is an unavailable channel;

[0014] Determine the current available channels according to each available channel;

[0015] Send rate frames to the system-on-chip in sequence according to the currently available channels, and determine the data transmission rates of the sub-channels of the currently available channels based on the fourth acknowledgment frame returned by the system-on-chip after receiving the rate frame; the rate frame is used to test the data transmission rates of the sub-channels of the available channels between the host computer and the system-on-chip; the fourth acknowledgment frame is used to indicate that the system-on-chip has successfully received the rate frame; wherein the data transmission rates of the sub-channels of the same available channel are the same.

[0016] Optionally, before updating the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame, it further includes:

[0017] Initialize the retransmission matrix and set all the values in the retransmission matrix to the same value; in the retransmission matrix, the first value indicates that the data transmission of the sub-channel was successful in the previous round; the second value indicates that the data transmission of the sub-channel failed in the previous round.

[0018] Optionally, before updating the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame, it further includes:

[0019] Determine the magnitude relationship between the retransmission times of the target sub-channel corresponding to the first acknowledgment frame and the preset maximum retransmission times;

[0020] If the retransmission times of the target sub-channel are equal to the preset maximum retransmission times, mark the target sub-channel as an unavailable channel, update the currently available channels according to the target sub-channel, and trigger the step of updating the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame;

[0021] If the retransmission times of the target sub-channel are less than the preset maximum retransmission times, directly trigger the step of updating the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame.

[0022] Optionally, when retransmitting the target data to be transmitted corresponding to the first acknowledgment frame according to the target available sub-channel determined based on the updated retransmission matrix in the next round of data transmission, it includes:

[0023] Determine the first target available sub-channel that successfully transmitted the data to be transmitted during the previous round of data transmission according to the updated retransmission matrix;

[0024] In the next round of data transmission, use the first available sub-channel randomly selected from the first target available sub-channels to retransmit the target data to be transmitted corresponding to the first acknowledgment frame.

[0025] Optionally, the firmware upgrade method of the system-on-chip further includes:

[0026] If the data to be transmitted has not been completely transmitted, determine the target data that has not been successfully transmitted, determine the target data that has not been successfully transmitted as the current firmware upgrade data, and re-jump to the step of allocating the current firmware upgrade data according to the current available channels of the system-on-chip and the data transmission rates of the sub-channels of the current available channels.

[0027] Optionally, the firmware upgrade method of the system-on-chip further includes:

[0028] If the data to be transmitted on each sub-channel has not been completely successfully transmitted in the previous round of data transmission, determine the second target available sub-channels that successfully transmitted the data to be transmitted during the previous round of data transmission according to the retransmission matrix;

[0029] During the next round of data transmission, re-transmit the data to be transmitted that has not been successfully transmitted using the second available sub-channel randomly selected from the second target available sub-channels.

[0030] In a second aspect, the present invention provides a firmware upgrade device for a system-on-chip, which is applied to a host computer and includes:

[0031] A data allocation module, configured to allocate the current firmware upgrade data according to the current available channels of the system-on-chip and the data transmission rates of the sub-channels of the current available channels to determine the data to be transmitted on each sub-channel;

[0032] A data sending module, configured to send the corresponding data to be transmitted to the system-on-chip through each sub-channel respectively;

[0033] A data retransmission module, configured to, if a first acknowledgment frame returned by the system-on-chip is received, update the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame, and during the next round of data transmission, re-transmit the target data to be transmitted corresponding to the first acknowledgment frame using the target available sub-channels determined based on the updated retransmission matrix until all the data to be transmitted is transmitted; the first acknowledgment frame is used to indicate that the target sub-channel fails to transmit the target data to be transmitted; the retransmission matrix is used to record information indicating whether the previous round of data transmission on each sub-channel is successful;

[0034] A firmware upgrade module, configured to, if a second acknowledgment frame returned by the system-on-chip is received, perform firmware upgrade according to all the data to be transmitted when all the data to be transmitted is transmitted and the data to be transmitted on each sub-channel has been completely successfully transmitted in the previous round of data transmission; the second acknowledgment frame is used to indicate that the sub-channel successfully transmits the data to be transmitted.

[0035] In a third aspect, the present invention provides an electronic device, including:

[0036] A memory, configured to store a computer program;

[0037] A processor for executing a computer program to implement the steps of the firmware upgrade method for the aforementioned system-on-chip.

[0038] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the firmware upgrade method for the aforementioned system-on-chip are implemented.

[0039] In the present invention, the host computer first allocates the current firmware upgrade data according to the current available channels of the system-on-chip and the data transmission rates of the sub-channels of the current available channels to determine the data to be transmitted on each sub-channel; sends the corresponding data to be transmitted to the system-on-chip through each sub-channel; if a first acknowledgment frame returned by the system-on-chip is received, updates the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame, and re-transmits the target data to be transmitted corresponding to the first acknowledgment frame according to the target available sub-channel determined based on the updated retransmission matrix in the next round of data transmission until all the data to be transmitted is transmitted; the first acknowledgment frame is used to indicate that the transmission of the target data on the target sub-channel fails; the retransmission matrix is used to record information indicating whether the data transmission on each sub-channel in the previous round was successful; if a second acknowledgment frame returned by the system-on-chip is received, when all the data to be transmitted is transmitted and all the data to be transmitted on each sub-channel was successfully transmitted in the previous round of data transmission, performs firmware upgrade according to all the data to be transmitted; the second acknowledgment frame is used to indicate that the sub-channel successfully transmits the data to be transmitted.

[0040] Advantageous effects: The present invention determines the data to be transmitted on each sub-channel according to the available channels and the data transmission rates of the sub-channels, and then uses all the available communication peripherals of the system-on-chip to transmit the offline upgrade package to solve the problem of slow communication rate of complex system-on-chips, and balances the transmission time of each channel based on the channel rate. At the same time, a retransmission mechanism and a dynamic update channel state mechanism are set up to ensure the high quality of the firmware offline upgrade package transmission from two aspects of reliability and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] To more clearly illustrate the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0042] Figure 1 It is a flowchart of a firmware upgrade method for a system-on-chip provided by an embodiment of the present invention;

[0043] Figure 2 It is a schematic structural diagram of a firmware upgrade system for a system-on-chip provided by an embodiment of the present invention;

[0044] Figure 3 Schematic diagram of single-channel data download provided by an embodiment of the present invention;

[0045] Figure 4 Schematic diagram of multi-channel analog parallel data download provided by an embodiment of the present invention;

[0046] Figure 5 Flowchart of a firmware upgrade method for a specific system-on-chip provided by an embodiment of the present invention;

[0047] Figure 6 Schematic diagram of the structure of a firmware upgrade device for a system-on-chip provided by an embodiment of the present invention;

[0048] Figure 7 Structural diagram of an electronic device provided by an embodiment of the present invention. Specific implementation manners

[0049] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.

[0050] The terms "including" and "having" in the specification of the present invention and any deformations related to "including" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units not listed.

[0051] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0052] Currently, when some research is carried out to improve the efficiency of firmware offline upgrade, it is often an ideal way to increase multiple transmission channels and expect to achieve multi-channel true parallel reception. However, for a single-core low-speed SoC simulation platform, such solutions are not applicable. There are also some methods that rely on an external programmer to complete the programming of the FLash. However, in the context of a single-core low-speed SoC simulation platform, the programming tool needs to be self-contained and relieve the dependence on external tools, and such methods are also difficult to solve the current problem. To solve the above technical problems, this application discloses a firmware upgrade method, device, equipment, and medium for a system-on-chip, which can improve the firmware upgrade efficiency and enhance the data transmission rate.

[0053] See Figure 1As shown in the figure, an embodiment of the present invention provides a method for firmware upgrade of a system-on-chip, which is applied to a host computer and includes:

[0054] Step S11: Allocate the current firmware upgrade data according to the current available channels of the system-on-chip and the data transmission rates of the sub-channels of the current available channels to determine the data to be transmitted on each sub-channel.

[0055] In an embodiment of the present invention, in a low-speed complex SoC simulation platform, the system integration degree is high, but its low-speed clock limits the communication rate with the host computer. For some projects, the to-be-delivered SoC and its supporting tools are often self-contained, which means that the product needs to be independent of external devices. Such SoC projects often have multiple communication peripherals, such as UART and I2C, to interact with other systems, and in the offline upgrade scenario, such peripherals are often idle. To solve the problem of low communication efficiency, especially the slow firmware download in the offline upgrade scenario, it is feasible to use multiple available and idle communication peripherals for offline firmware upgrade in the present invention.

[0056] Specifically, first, the host computer sends probe frames to the system-on-chip through the channels of the universal asynchronous receiver / transmitter and / or the integrated circuit bus respectively, and determines each available channel according to the system-on-chip and the probe frames sent by each channel; the probe frame is used to detect the available channels between the host computer and the system-on-chip; if the system-on-chip returns a corresponding third confirmation frame after receiving the probe frame sent by the channel, it is determined that the current channel is an available channel; the third confirmation frame is used to indicate that the system-on-chip successfully receives the probe frame; otherwise, it is determined that the current channel is an unavailable channel; determine the current available channels according to each available channel; send rate frames to the system-on-chip in sequence according to the current available channels, and determine the data transmission rates of the sub-channels of the current available channels based on the fourth confirmation frame returned by the system-on-chip after receiving the rate frame; the rate frame is used to test the data transmission rates of the sub-channels of the available channels between the host computer and the system-on-chip; the fourth confirmation frame is used to indicate that the system-on-chip successfully receives the rate frame; the data transmission rates of the sub-channels of the same available channel are the same. In a specific embodiment, the available channels can be represented by a channel matrix, and the data transmission rates can be represented by a rate matrix. First, number the available channels of UART and I2C to generate a channel matrix C. If there are m available channels, and the number of sub-channels of each available channel is , then the channel matrix is defined as follows:

[0057] ;

[0058] Secondly, it is necessary to evaluate the rates of each channel. Generally speaking, in the same system, the same type of channels are generally the same. Therefore, define a rate matrix .

[0059] After determining the currently available channels of the system-on-chip and the data transmission rates of the sub-channels of the currently available channels, the current firmware upgrade data can be allocated according to the currently available channels of the system-on-chip and the data transmission rates of the sub-channels of the currently available channels. The task formula for a single channel can be expressed by the following formula:

[0060] ;

[0061] where, is the proportion of tasks that should be allocated to the th sub-channel in the mth channel; is the data transmission rate of the th sub-channel in the mth channel; is the sum of the rates of all sub-channels included in all m channels.

[0062] Finally, the data to be transmitted on each sub-channel is determined, that is, the complete transmission data is sliced and then distributed to different sub-channels for transmission. In this way, it is ensured that the data size transmitted by each channel meets its transmission capacity, and the transmission times of each channel are avoided from being uneven.

[0063] Step S12: Send the corresponding data to be transmitted to the system-on-chip through each sub-channel.

[0064] In the embodiment of the present invention, after slicing the complete transmission data and then distributing it to different sub-channels for transmission, each sub-channel respectively sends the corresponding data to be transmitted to the system-on-chip. That is, in the data transmission stage, each available sub-channel packets and sends the data to be transmitted divided by the task allocation module, and then waits for the SoC to reply with an acknowledgment frame.

[0065] In the process of each sub-channel respectively sending the corresponding data to be transmitted to the system-on-chip, in order to ensure the security of data transmission, a security domain can be divided inside the system-on-chip, the sub-channel interface is deployed in an independent secure enclave, and is isolated from non-security modules by a hardware firewall. Sensitive data is stored in a memory protected by PUF (Physical Unclonable Functions) to prevent physical probing attacks. A dedicated encryption engine can also be integrated to implement encryption / decryption operations through hardware acceleration to avoid the risk of timing side-channel leakage caused by software implementation. At the same time, the hardware counter detects abnormal transmission behaviors (such as high-frequency retries, excessive data packets) in real time and triggers a fusing mechanism to interrupt suspicious connections. The above methods are all hardware-level protection mechanisms, including but not limited to the above two methods. Of course, security control can also be implemented at the protocol layer, which will not be specifically described here.

[0066] Step S13: If a first acknowledgment frame is received from the system-on-chip, update the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame, and retransmit the target data to be transmitted corresponding to the first acknowledgment frame on the target available sub-channel determined based on the updated retransmission matrix in the next round of data transmission until all the data to be transmitted is transmitted; the first acknowledgment frame is used to indicate that the transmission of the target data to be transmitted on the target sub-channel fails; the retransmission matrix is used to record information indicating whether the data transmission on each sub-channel in the previous round was successful.

[0067] In the embodiment of the present invention, the retransmission matrix is used to record information indicating whether the data transmission on each sub-channel in the previous round was successful, with 1 indicating success and 0 indicating failure. If a first acknowledgment frame indicating that the transmission of the target data to be transmitted on the target sub-channel fails is received from the system-on-chip within the timeout period, the host computer considers that the transmission of this data packet fails.

[0068] Before updating the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame, first initialize the retransmission matrix and set all the values in the retransmission matrix to the same value; in the retransmission matrix, the first value indicates that the data transmission on the sub-channel in the previous round was successful; the second value indicates that the data transmission on the sub-channel in the previous round failed. At the same time, determine the magnitude relationship between the retransmission times of the target sub-channel corresponding to the first acknowledgment frame and the preset maximum retransmission times; if the retransmission times of the target sub-channel are equal to the preset maximum retransmission times, mark the target sub-channel as an unavailable channel, update the currently available channels according to the target sub-channel, and trigger the step of updating the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame; if the retransmission times of the target sub-channel are less than the preset maximum retransmission times, directly trigger the step of updating the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame. In other words, determine whether the maximum retransmission times have been reached. If the maximum retransmission times have been reached, it is considered that this channel link is disconnected, and the host computer will discard this channel and update the retransmission matrix; if the maximum retransmission times have not been reached, update the retransmission matrix R, record the current channel retransmission times, and organize a retransmission of this packet in the next round of data transmission.

[0069] In the embodiment of the present invention, the first acknowledgment frame is used to indicate that the transmission of the target data to be transmitted on the target sub-channel fails, so that after receiving the first acknowledgment frame, the state of the target sub-channel corresponding to the first acknowledgment frame in the retransmission matrix can be updated. In a specific embodiment, the value of the target sub-channel corresponding to the first acknowledgment frame in the retransmission matrix can be set to 0 to update the retransmission matrix.

[0070] Then, data retransmission is performed during the next round of data transmission, that is, the first target available sub-channel that successfully transmitted the data to be transmitted during the previous round of data transmission is determined according to the updated retransmission matrix; during the next round of data transmission, the target data to be transmitted corresponding to the first acknowledgment frame is retransmitted using the first available sub-channel randomly selected from the first target available sub-channels until all the data to be transmitted is transmitted. In this way, compared with the general retransmission mechanism, the retransmission mechanism in the present invention is different in that this mechanism takes into account the firmware download task, focuses on the overall download time, but is not sensitive to the delay of a single slice of data. Therefore, when retransmitting the failed data during the next round of data transmission, it is organized to avoid other channels being idle during the retransmission of the failed data, further improving the utilization rate of the channel.

[0071] Step S14: If the second acknowledgment frame returned by the system-on-chip is received, then when all the data to be transmitted is transmitted and all the data to be transmitted on each sub-channel was successfully transmitted during the previous round of data transmission, firmware upgrade is performed according to all the data to be transmitted; the second acknowledgment frame is used to indicate that the sub-channel successfully transmitted the data to be transmitted.

[0072] In the embodiment of the present invention, if the first acknowledgment frame indicating that the target sub-channel successfully transmitted the target data to be transmitted is received from the system-on-chip within the timeout period, the host computer considers that this data packet is successfully transmitted. Then it is judged whether the transmission of the complete data is completed. If all the data to be transmitted is transmitted, it is judged whether the retransmission matrix is all 1, that is, whether all the data to be transmitted on each sub-channel was successfully transmitted during the previous round of data transmission. If all the data to be transmitted on each sub-channel was successfully transmitted during the previous round of data transmission, it is judged that the data transmission is completed, and then firmware upgrade can be performed according to all the data to be transmitted. Specifically, if a reply acknowledgment frame is received within the timeout period, it is determined that the data packet transmission, verification, and burning are successful. When all the data packets are successfully transmitted and the values of all elements of the retransmission matrix are 0, the complete firmware offline upgrade package has been successfully burned into the Flash, and the process ends.

[0073] However, if all the data to be transmitted is not transmitted, the target data that was not successfully transmitted is determined, and the target data that was not successfully transmitted is determined as the current firmware upgrade data, and then it jumps back to the step of allocating the current firmware upgrade data according to the current available channels of the system-on-chip and the data transmission rates of the sub-channels of the current available channels.

[0074] In addition, if all the data to be transmitted on each sub-channel was not successfully transmitted during the previous round of data transmission, the second target available sub-channel that successfully transmitted the data to be transmitted during the previous round of data transmission is determined according to the retransmission matrix; during the next round of data transmission, the data to be transmitted that was not successfully transmitted is retransmitted using the second available sub-channel randomly selected from the second target available sub-channels.

[0075] Beneficial effects: The present invention determines the data to be transmitted on each sub-channel based on the available channels and the data transmission rate of the sub-channels, and then uses all available communication peripherals of the system-on-chip to transmit the offline upgrade package, so as to solve the problem of slow communication rate of complex system-on-chips, and balance the transmission time of each channel based on the channel rate. At the same time, a retransmission mechanism and a dynamic update channel state mechanism are set up to ensure the high quality of the firmware offline upgrade package transmission from two aspects of reliability and efficiency.

[0076] The specific firmware upgrade process is as Figure 2 shown. When the SoC downloads single-channel data, the usage time of its CPU (Central Processing Unit) is as Figure 3 shown. In a complete data slice download cycle, the time when the CPU actually receives, verifies, and burns data only accounts for a part, and the rest of the time is idle. Among them, the verification algorithm can adopt the general verification algorithm sha256 (Secure Hash Algorithm). To improve this situation, the present invention is designed to use multiple channels for reception. As Figure 4 shown, using serial multi-channel reception does not actually improve the download rate, and the bottleneck is still limited to the single-channel rate transmission. However, for a single-core system, enabling thread parallel reception will increase the CPU processing time, resulting in a reduction in the proportion of the actual channel data reception time, and reducing the number of channels that can be used to receive data simultaneously without packet loss. To solve this problem, taking advantage of the time interval between the transmission symbols of each channel, the CPU polls other channels to receive data and then uniformly processes and burns the data. This method simulates multi-channel parallel reception, broadens the total channel transmission bandwidth, and thus improves the total download rate. In addition, polling and receiving each channel avoids the problem of packet loss caused by too long waiting time for some channels.

[0077] Next, the process of the firmware upgrade method for the system-on-chip in the present invention will be described in detail.

[0078] First of all, it should be noted that the channel matrix: used to identify the available channels of the current SoC and record the names of the available channels; the rate matrix: used to record the transmission rates of each sub-channel in C, with the unit of KB / s; the retransmission matrix: used to record the data transmission situation of each sub-channel in C in the previous round, with success being 1 and failure being 0. The probe frame: used to probe the channels available between the host computer and the SoC, sent by the host computer; the rate frame: used to test the communication rates of the available channels between the host computer and the SoC, sent by the host computer; the data frame: used to transmit sub-slices of the firmware upgrade package, sent by the host computer; the confirmation frame: used to reply to the received confirmation information, including function confirmation options, sent by the SoC.

[0079] AsFigure 5 As shown in Figure 5 , during the matrix control phase, the host computer first sends a detection frame to detect all channels that can establish a connection with the SoC. After receiving the detection frame, the SoC will reply with an acknowledgment frame. At this time, it is considered that a connection is established with this channel, and the channel matrix C is updated. Otherwise, this channel is considered unavailable. Secondly, according to the channel matrix C, the host computer sequentially sends rate frames to detect the communication rate of each channel at the protocol layer. When the SoC receives the rate frame, it will reply with an acknowledgment frame. At this time, the host computer updates the calculated rate of the corresponding channel to the rate matrix V. Finally, a retransmission matrix R is maintained at the host end. When the SoC fails to receive a data packet, fails to successfully receive a data packet, or fails to successfully burn a data packet to the Flash, it will reply with an acknowledgment frame carrying the corresponding reply information. The host updates the retransmission matrix according to the reply information and sets the data retransmission.

[0080] In the task allocation phase, to ensure that the data of each channel can be transmitted simultaneously, it is necessary to complete the data slicing of each sub-channel according to the channel matrix C and the rate matrix V, and based on the task allocation algorithm, to ensure that the data size transmitted by each channel meets its transmission capacity and avoid uneven transmission times of each channel.

[0081] In the data transmission phase, each available sub-channel packets and sends the data to be transmitted divided by the task allocation module, and then waits for the SoC to reply with an acknowledgment frame. If an acknowledgment frame indicating failure is received within the timeout period, the host computer considers this data packet to have failed and determines whether the maximum number of retransmissions has been reached. If the maximum number of retransmissions is reached, it is considered that the channel link is disconnected, and the host computer will discard this channel; if the maximum number of retransmissions is not reached, the retransmission matrix R is updated to record the current channel retransmission times, and this packet is retransmitted in the next round of data transmission. The difference between this retransmission mechanism and the general retransmission mechanism is that this mechanism takes into account the firmware download task, pays attention to the overall download time, but is not sensitive to the delay of a single sliced data. Therefore, when retransmitting the failed data in the next round of data transmission, it avoids other channels being idle during the retransmission of the failed data, further improving the channel utilization rate. If an acknowledgment frame is received within the timeout period, it is determined that the data packet transmission, verification, and burning are successful. When all data packets are successfully transmitted and the values of all elements in the retransmission matrix are 0, the complete firmware offline upgrade package has been successfully burned to the Flash, and the process ends.

[0082] In addition, it should be noted that although the embodiments described in the present invention are as above, the above description content and definitions are only for facilitating the understanding of the embodiments of the present invention, and are not intended to limit the present invention. Any modifications and changes made without departing from the spirit and scope of the present invention, especially the multi-channel offline upgrade method based on time slices, the firmware offline upgrade communication protocol based on task allocation, the rate detection mechanism in firmware offline upgrade, and the timeout retransmission mechanism applicable to offline upgrade; are all within the protection scope of the present invention.

[0083] Beneficial effects: In the present invention, all available communication peripherals of the SoC are used to transmit the offline upgrade package to solve the problem of slow communication rate of complex SoCs. In the dimension of longitudinal single-channel data transmission, the time resources of the channel are fully utilized. The time interval between transmission symbols of a single channel is used to transmit other channels, and the effect of pseudo-parallel reception of the bare-metal SoC is simulated. At the same time, the problem of slow download of the firmware offline upgrade package by complex SoCs under low-speed clocks is solved. Based on the channel rate, the transmission time of each channel is balanced, and a timeout retransmission mechanism and a dynamic update channel status mechanism suitable for embedded R & D are added to ensure the high quality of the firmware offline upgrade package transmission in terms of both reliability and efficiency.

[0084] See Figure 6 As shown, an embodiment of the present invention provides a firmware upgrade device for a system-on-chip, which is applied to a host computer and includes:

[0085] A data distribution module 11, configured to distribute the current firmware upgrade data according to the current available channels of the system-on-chip and the data transmission rates of the sub-channels of the current available channels to determine the data to be transmitted on each sub-channel;

[0086] A data sending module 12, configured to send the corresponding data to be transmitted to the system-on-chip through each sub-channel respectively;

[0087] A data retransmission module 13, configured to, if a first acknowledgment frame returned by the system-on-chip is received, update the retransmission matrix according to the target sub-channel corresponding to the first acknowledgment frame, and retransmit the target data to be transmitted corresponding to the first acknowledgment frame according to the target available sub-channel determined based on the updated retransmission matrix in the next round of data transmission until all the data to be transmitted is transmitted; the first acknowledgment frame is used to indicate that the target sub-channel fails to transmit the target data to be transmitted; the retransmission matrix is used to record information indicating whether the data transmission on each sub-channel was successful in the previous round;

[0088] A firmware upgrade module 14, configured to, if a second acknowledgment frame returned by the system-on-chip is received, perform firmware upgrade according to all the data to be transmitted when all the data to be transmitted is transmitted and all the data to be transmitted on each sub-channel was successfully transmitted in the previous round of data transmission; the second acknowledgment frame is used to indicate that the sub-channel successfully transmits the data to be transmitted.

[0089] Since the embodiments of the device part correspond to the above-mentioned embodiments, the embodiments of the device part are described with reference to the embodiments of the method part above and will not be repeated here.

[0090] Beneficial effects: The present invention determines the data to be transmitted on each sub-channel based on the available channels and the data transmission rate of the sub-channels, and then uses all available communication peripherals of the system-on-chip to transmit the offline upgrade package, so as to solve the problem of slow communication rate of complex system-on-chips, and balance the transmission time of each channel based on the channel rate. At the same time, a retransmission mechanism and a dynamic update channel state mechanism are set up to ensure the high quality of the firmware offline upgrade package transmission from two aspects of reliability and efficiency.

[0091] Furthermore, the embodiment of the present application also discloses an electronic device. Figure 7 It is a structural diagram of an electronic device shown according to an exemplary embodiment. The content in the figure cannot be considered as any limitation to the scope of use of the present application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the firmware upgrade method of the system-on-chip disclosed in any of the foregoing embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0092] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0093] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a disk, or an optical disc, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be short-term storage or permanent storage.

[0094] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device, and it may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of implementing the firmware upgrade method of the system-on-chip executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0095] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program. When the computer program is executed by a processor, it implements the firmware upgrade method of the system-on-chip disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.

[0096] Furthermore, the present application also discloses a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, they implement the firmware upgrade method of the system-on-chip disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.

[0097] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0098] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0099] The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0100] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0101] The technical solutions provided in this application have been introduced in detail above. Specific examples are used in this text to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A method for upgrading firmware of a system-on-chip, characterized in that: Applied to the host computer, including: Allocating the current firmware upgrade data according to the current available channel of the system-level chip and the data transmission rate of each sub-channel of the current available channel to determine the data to be transmitted of each sub-channel; Sending corresponding data to be transmitted to the system-level chip through each of the sub-channels; If a first confirmation frame returned by the system-level chip is received, a retransmission matrix is ​​updated according to the target sub-channel corresponding to the first confirmation frame, and in the next round of data transmission, the target data to be transmitted corresponding to the first confirmation frame is retransmitted according to the target available sub-channel determined based on the updated retransmission matrix until all the data to be transmitted are transmitted; the first confirmation frame is used to indicate that the target sub-channel fails to transmit the target data to be transmitted; the retransmission matrix is ​​used to record information indicating whether the previous round of data transmission on each sub-channel is successful; If a second confirmation frame returned by the system-level chip is received, then when the transmission of all the data to be transmitted is completed and all the data to be transmitted in each sub-channel in the previous round of data transmission has been successfully transmitted, the firmware is upgraded based on all the data to be transmitted; the second confirmation frame is used to indicate that the sub-channel has successfully transmitted the data to be transmitted.

2. The method for upgrading the firmware of the system-on-chip according to claim 1, characterized in that: Before allocating the current firmware upgrade data according to the current available channel of the system-level chip and the data transmission rate of each sub-channel of the current available channel, the method further includes: Sending detection frames to the system-on-chip respectively through the channels of the universal asynchronous receiver and / or the integrated circuit bus, and determining each available channel according to the system-on-chip and the detection frames sent by each channel; the detection frames are used to detect the available channels between the host computer and the system-on-chip; If the system-level chip returns a corresponding third confirmation frame after receiving the detection frame sent by the channel, it is determined that the current channel is an available channel; the third confirmation frame is used to indicate that the system-level chip successfully receives the detection frame; Otherwise, the current channel is determined to be an unavailable channel; Determine a current available channel according to each of the available channels; Send rate frames to the system-level chip in sequence according to the current available channels, and determine the data transmission rate of each sub-channel of the current available channel based on the fourth confirmation frame returned by the system-level chip after receiving the rate frame; the rate frame is used to test the data transmission rate of each sub-channel of the available channel between the host computer and the system-level chip; the fourth confirmation frame is used to indicate that the system-level chip has successfully received the rate frame; wherein the data transmission rate of each sub-channel of the same available channel is the same.

3. The method for upgrading the firmware of the system-on-chip according to claim 1, characterized in that: Before updating the retransmission matrix according to the target subchannel corresponding to the first confirmation frame, the method further includes: Initialize the retransmission matrix and set all values ​​in the retransmission matrix to the same value; in the retransmission matrix, the first value represents the success of the previous round of data transmission on the sub-channel; the second value represents the failure of the previous round of data transmission on the sub-channel.

4. The method for upgrading the firmware of the system-on-chip according to claim 1, characterized in that: Before updating the retransmission matrix according to the target subchannel corresponding to the first confirmation frame, the method further includes: Determine a magnitude relationship between the number of retransmissions of the target subchannel corresponding to the first confirmation frame and a preset maximum number of retransmissions; If the number of retransmissions of the target subchannel is equal to the preset maximum number of retransmissions, the target subchannel is marked as an unavailable channel, the current available channel is updated according to the target subchannel, and the step of updating the retransmission matrix according to the target subchannel corresponding to the first confirmation frame is triggered; If the number of retransmissions of the target sub-channel is less than the preset maximum number of retransmissions, the step of updating the retransmission matrix according to the target sub-channel corresponding to the first confirmation frame is directly triggered.

5. The method for upgrading the firmware of the system-on-chip according to claim 1, characterized in that: The retransmitting the target data to be transmitted corresponding to the first confirmation frame according to the target available subchannel determined based on the updated retransmission matrix in the next round of data transmission includes: Determine, according to the updated retransmission matrix, a first target available subchannel that successfully transmitted the data to be transmitted during the previous round of data transmission; In the next round of data transmission, the target data to be transmitted corresponding to the first confirmation frame is retransmitted using a first available sub-channel randomly selected from the first target available sub-channel.

6. The method for upgrading the firmware of the system-on-chip according to claim 1, characterized in that: Also includes: If the data to be transmitted has not been completely transmitted, the target data that has not been successfully transmitted is determined, and the target data that has not been successfully transmitted is determined as the current firmware upgrade data, and the process jumps again to the step of allocating the current firmware upgrade data according to the data transmission rate of the current available channel of the system-level chip and each sub-channel of the current available channel.

7. The method for upgrading the firmware of a system-on-chip according to any one of claims 1 to 6, characterized in that: Also includes: If all the data to be transmitted in the sub-channels in the previous round of data transmission were not successfully transmitted, determining a second target available sub-channel that successfully transmitted the data to be transmitted in the previous round of data transmission according to the retransmission matrix; In the next round of data transmission, the unsuccessfully transmitted data to be transmitted is retransmitted using the second available sub-channel randomly selected from the second target available sub-channel.

8. A system-on-chip firmware upgrade device, characterized in that: Applied to the host computer, including: A data allocation module, used to allocate the current firmware upgrade data according to the current available channel of the system-level chip and the data transmission rate of each sub-channel of the current available channel, so as to determine the data to be transmitted of each sub-channel; A data sending module, used for sending corresponding data to be transmitted to the system-level chip through each of the sub-channels; A data retransmission module, configured to update a retransmission matrix according to a target sub-channel corresponding to the first confirmation frame if a first confirmation frame returned by the system-level chip is received, and retransmit the target data to be transmitted corresponding to the first confirmation frame according to a target available sub-channel determined based on the updated retransmission matrix in the next round of data transmission until all the data to be transmitted are transmitted; the first confirmation frame is used to indicate that the target sub-channel fails to transmit the target data to be transmitted; the retransmission matrix is ​​used to record information indicating whether the previous round of data transmission on each sub-channel was successful; A firmware upgrade module is used to perform firmware upgrade based on all the data to be transmitted if a second confirmation frame returned by the system-level chip is received, when the transmission of all the data to be transmitted is completed and all the data to be transmitted in each sub-channel in the previous round of data transmission is successfully transmitted; the second confirmation frame is used to indicate that the sub-channel has successfully transmitted the data to be transmitted.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the firmware upgrade method of the system-on-chip according to any one of claims 1 to 7.

10. 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 the firmware upgrade method of the system-on-chip according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Security upgrading method and device oriented to chip matrix and device cluster

    CN120762711A

  • A security upgrade method and apparatus for chip matrix and device cluster

    CN120762711B