The invention relates to the development interface, and more particularly to a technology for a mass data transmission in a development interface.
When a product or an integrated circuit is still on the research or design phase, the designer would adopt a development board to program functions to be designed, wherein the data to be written need a debug transmission interface to transmit to the development board. The debug transmission interface generally is a SWD (Serial Wire Debug) interface or JTAG (Joint Test Action Group) interface. Taking the SWD interface as an example, when a mass data transmission is performed, the data rate is only 32/43.
An objective of the invention is to provide a system for development interface and a mass data transmission method for development interface to reduce the data transmission period and also to reduce the development time of integrated circuit or product.
In view of this, the invention provides a system for development interface. The a system for development interface includes a development board and a host PC. The development board includes a debug transmission interface. The host PC is used for being electrically connected to the debug transmission interface. A data form of the debug transmission interface includes a header field, an address field and a data field. The specific instruction is set in the header field when a mass data transmission is performed, such that a length limitation of the data field is removed, wherein a serial data transfer mode is switched when the development board receives the specific instruction, such that all of data in the data field can be received.
The system for development interface according to a preferred embodiment of the present invention, when the data are received in the serial data transfer mode, the development board switches to an original debug transmission mode.
The present invention further provides a system for development interface. The system for development interface includes a development board and a host PC. The development board includes a debug transmission interface. The host PC is used for being electrically connected to the debug transmission interface. The development board includes an in-system programming (ISP) function, wherein, when a host PC transmits a preset data to the development board, the host determines a specific compression encoding from a plurality of compression encodings according to a characteristic of the preset data and the host PC performs a data compression to the preset data to obtain a compressed data according to the specific compression encoding, wherein an ISP firmware and the compressed data are transmitted to the development board, wherein the development board decompresses the compressed data according to the ISP firmware.
The system for development interface according to a preferred embodiment of the present invention, the host PC edits the ISP firmware according to the specific compression encoding. In a preferred embodiment, the host PC divides the preset data into a plurality of sub-segment data and then compresses the plurality of sub-segment data.
The present invention further provides a mass data transmission method for development interface. The mass data transmission method for development interface includes: providing a host PC and a development board; providing a debug transmission interface, wherein a data form of the debug transmission interface comprising a header field, an address field and a data field; setting a specific instruction in the header field to remove a length limitation of the data field when the host PC performs a mass data transmission; and switching to a serial data transfer mode when the development board receives the specific instruction, such that all of data in the data field can be received.
The spirit of the invention is to set a specific instruction in header field of the debug transmission signal such that the limitation of the data length can be removed. Therefore, the data transmission rate of the development interface can be achieved to near 100%, and the data transmission period can be effectively shortened. Moreover, in the embodiment of the present invention, the ISP download method and adaptive compression encoding also are adopted such that the efficiency of the data compression is increased and the data transmission rate is greatly increased.
The above-mentioned and other objects, features and advantages of the present invention will become more apparent from the following detailed descriptions of preferred embodiments thereof taken in conjunction with the accompanying drawings.
In this embodiment, the development system of the embedded system is adapted for IC (integrated circuit) or product development, such as development phase, circuit research phase or circuit test phase. User need to perform firmware rewriting or transmitting data into the development board 210. Generally, when user want to transmits the data from the host PC 220 to the development board 210, it need to transmit through the debug transmission interface 230 to the development board 210. Generally, the debug transmission interface 230 may be a SWD interface or JTAG interface and so forth. Taking SWD interface as an example, in a general debug transmission mode, since every time the writing is performed, the signal should include header field and confirmation information according to SWD protocol, the data utilization of the SWD protocol is only 32/43, as shown in
In the preset embodiment, a preset data format is designed. The data format includes a header field 310, an address field 320 and a data field 330. Referring to
In addition, when the data transmission in the data field 330 is finished, and a next mass transmission data in the host PC 220 is to be transmitted, the host PC 220 would send the data as form in
In accordance with the abovementioned embodiment of the present invention, the instruction in header field can be used for switching the transmission mode between the transmitter and receiver, such that the mass data transmission can be achieved in the low speed transmission system.
In another preferred embodiment of the present invention, the development board 210 has an ISP (in-system programming) function, in this embodiment, the ISP function is adopted for optimizing the efficiency of data transmission. Generally speaking, when user needs to write data on the development board 210, because of the limitation of the capacity of the random access memory (RAM) in the development board 210, the preset data to be written in the development board 210 would be compressed by the host PC 220 first by a compression coding. Next, the host PC 220 transmits the compression coding of the IPS firmware and then the compressed data is written in the RAM of the development board 210. The development board 210 de-compresses the compressed data and writes the de-compressed data through the compression coding of the IPS firmware. In the prior art, since the preset compression method is fixed, it cannot efficiently compress data such that the written data period would be too long.
In the preferred embodiment, before the data is written, the host PC 220 would perform a firmware program to analyze the preset data to be written. At the same time, the firmware program can determine the compression encoding according to the characteristic of the preset data, the operation capability of the development board 210 and the type of the IC of the development board 210. In the present embodiment, the compression encoding may be RLE (Run Length Encoding), Huffman coding or GPZP encoding.
In the current application, the preset data to be transmitted by the host PC 220 includes program codes, pictures or videos, etc. For example, when the preset data to be transmitted is a picture, which the data is large and the data variation is small, the RLE can achieve very high compress ratio if the picture data has a lot of black or white portion. In addition, if the preset data to be transmitted is program code, which the data variation is large and the data size is small, it may not be adapted for the RLE, it is adapted for the Huffman coding.
Through the abovementioned analysis, the host PC 220 determines a preset compression encoding, the host PC 220 sets a specific ISP firmware and then compresses the preset data, and transmits the specific ISP firmware and the compressed data to the RAM of the development board 210. Further, in a preferred embodiment of the present invention, considering the size of the preset data and the data capability which the debug interface can be carried in ISP download, the host PC 220 may divide the preset data into multiple segment data and individually compresses the segment data and then performs the data transmission.
In the development board 210, the IC of the development board 210 would perform the received ISP firmware to enable the ISP download, and de-compresses the compressed segment data. Afterward, the IC of the development board 210 would verify the correctness of the de-compressed data. When the verification is complete, the de-compressed data would be written into the IC. The verification method may be the ISP flow, or the embedded algorithm in IC, such as CRC (Cyclical Redundancy Check).
According to the abovementioned embodiment, the mass data transmission method can be concluded.
In step S410, the method starts when the host PC 220 has a preset data to be written into the IC of the development board 210.
In step S420, a preset compression encoding is determined for compressing the preset data.
In step S430, the ISP firmware is edited according to the preset compression encoding and the preset data is compressed by the host PC 220 to obtain a compressed data.
In step S440, the host PC 220 transmits a signal with a specific instruction to start the serial transmission mode.
In step S450, the host PC 220 starts to transmit the specific ISP firmware and the compressed data through the serial transmission mode.
In step S460, the IC of the development board 210 reads the signal with the specific instruction and switches to the serial transmission mode.
In step S470, the development board 210 receives the specific ISP firmware and decompresses the compressed data and verifies it.
In step S480, it is determined whether another preset data is to be transmitted to the development board 210. If the determination is positive, return to step S420. In step S480, after the transmission ends, if the host PC 220 still has next data to be transmitted to the development board 210, the program in the host PC 220 would re-determine the compression encoding and generate new ISP firmware. If the determination is negative, go to step S490.
In step S490, the transmission ends, the development board 210 is switched to the general debug transmission mode.
In the embodiment of
In step S510, the method starts when the host PC 220 has a preset data to be written into the IC of the development board 210.
In step S520, the host PC 220 transmits a signal with a specific instruction to start the serial transmission mode and transmits the preset data.
In step S530, the IC of the development board 210 reads the signal with the specific instruction, the development board 210 is switched to the serial transmission mode and receives the preset data.
In step S540, it is determined whether another preset data is to be transmitted to the development board 210. If the determination is positive, return to step S520. If the determination is negative, perform the step S550.
In step S550, the transmission ends, the development board 210 is switched to the general debug transmission mode.
In summary, the spirit of the invention is to set a specific instruction in header field of the debug transmission signal such that the limitation of the data length can be removed. Therefore, the data transmission rate of the development interface can be achieved to near 100%, and the data transmission period can be effectively shortened. Moreover, in the embodiment of the present invention, the ISP download method and adaptive compression encoding also are adopted such that the efficiency of the data compression is increased and the data transmission rate is greatly increased.
While the invention has been described by way of examples and in terms of preferred embodiments, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications. Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications.