Communication method and system between test board and optical module based on I3C protocol
By using the I3C protocol-based communication method in optical module testing, configuring the DMA channel and dynamically adjusting the FIFO threshold, the bandwidth and power consumption limitations of the I2C protocol and the interruption problems of the I3C protocol are solved, and efficient and stable optical module testing is achieved.
Patent Information
- Application Number
- CN202510558811.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-04-30
AI Technical Summary
The existing I2C protocol has limitations in bandwidth and power consumption in optical module testing, resulting in inefficiency in testing, and the I3C protocol may cause communication blockage when it encounters an I3C interruption of the target device shutdown, affecting system stability and efficiency.
Using the communication method between the test board and the optical module based on the I3C protocol, the FIFO threshold and communication rate are dynamically adjusted to achieve efficient data transmission, and the I3C controller is automatically re-initialized in error processing to resume communication.
It improves the data communication rate and stability of optical module tests, reduces test time and operation costs, and enhances the system's expansion capabilities and communication efficiency.
Smart Images

Figure CN120090699A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and particularly to a communication method and system between a test board and an optical module based on the I3C protocol. Background Art
[0002] As a key component in modern optical communication systems, the stability and reliability of the performance of optical modules are crucial for the operation of the entire system. Therefore, effective testing of optical modules has become one of the key steps to ensure system quality. Traditional optical module communication methods usually rely on the I2C (Inter-Integrated Circuit) communication protocol for the interaction of test data. However, with the growth of optical communication requirements and the development of technologies, the limitations of the I2C protocol in terms of bandwidth and power consumption have gradually emerged.
[0003] Firstly, in terms of bandwidth, the maximum communication rate of the I2C protocol is limited to Fast-Mode Plus (1Mbps). For application scenarios that require fast transmission of a large amount of data, such as firmware updates, when the host computer sends data and instructions to the optical module test board frame by frame via USB (Universal Serial Bus), and the optical module test board then performs firmware updates with the optical module based on the CDB (Command Data Block) format through I2C, the entire firmware will be divided into multiple data frames during the transmission process, forwarded to the test board via USB and then communicated with the module for update, resulting in a long update time and low update efficiency, which obviously cannot meet the requirements. The low data exchange efficiency severely restricts the data processing speed during the test, leading to an extended test time and low efficiency.
[0004] Secondly, from the perspective of power consumption, the relatively high power consumption of the I2C protocol has become a problem that cannot be ignored, especially in the case of large-scale device connections. This not only increases the operating cost of the system but also limits the expansion ability of the device. In addition, when traditional I2C controllers handle communication errors, they often require manual initialization to restore communication, which is a complex and time-consuming process and further reduces the test efficiency.
[0005] In response to the above challenges, the I3C (Improved Inter-Integrated Circuit) protocol, as an emerging communication standard, provides a higher communication rate than I2C, supports up to 12.5Mbps SDR mode (Single Data Rate), and even 25Mbps HDR-DDR mode (High Data Rate-Double Data Rate), and has lower power consumption and stronger device expansion capabilities. Despite this, when the existing I3C controller attempts to communicate during the I3C interrupt period when the I3C target device turns off the I3C interrupt, the target device will not respond to the I3C controller, resulting in the communication process being blocked. The I3C controller needs to be reinitialized to resume normal communication, which also affects the stability and efficiency of the system.
[0006] The so-called "I3C target device turns off I3C interrupts" can be understood as after the I3C target device correctly completes the communication process (such as receiving commands and data) according to the I3C MIPI protocol, the I3C target device cannot send an interrupt signal to the MCU core, so the MCU core cannot know the completion status of these communication operations. Furthermore, since the MCU core cannot receive the interrupt signal, it cannot trigger the corresponding interrupt service routine (ISR) to execute subsequent control logic based on the MIPI protocol (such as reading the actual length of received and sent data, pre-filling the data sent by the I3C target device to the I3C controller, etc.); this will cause the I3C controller to fail to obtain the expected response.
[0007] Therefore, we propose a communication method and system between a test board and an optical module based on the I3C protocol. Summary of the invention
[0008] The object of the present invention is to provide a communication method and system between a test board and an optical module based on an I3C protocol, which is used to solve the problems of low efficiency in optical module testing and poor stability of the I3C protocol in optical module testing.
[0009] The present invention is achieved through the following technical solutions: A communication method between a test board and an optical module based on an I3C protocol, comprising: S1. The test board receives the command sent by the host computer; S2. Configure the DMA (Direct Memory Access) channel of the test board and configure the I3C bus; S3. If the instruction is a write instruction, the test board selects based on the transmitter FIFO (First In First Out, a data storage and buffering mechanism that stores and buffers data in the order of arrival), adjusts the FIFO threshold according to the data volume of the instruction, and then sends a write command to the optical module via the I3C bus; S4. If the optical module receives the write command, it operates according to the command; S5. If the instruction is a read instruction, the test board selects based on the receiver FIFO, adjusts the FIFO threshold according to the data volume of the instruction, and then sends a read command to the optical module via the I3C bus; S6. If the optical module receives the read command, it returns data to the test board according to the command; S7. If the optical module does not receive the write command or the read command, or fails to receive or output correct data, the test board performs error handling operations.
[0010] Furthermore, the configuration steps of the DMA channel are specifically as follows: S21 Configure the DMA channel of the transmitter on the I3C bus of the test board; S211 Configure the transmitter DMA direction as memory to peripheral; S212 Configure the transmitter DMA source address mode as auto-increment mode; S213 Configure the transmitter DMA destination address mode as fixed mode; S22 Configure the DMA channel of the receiver on the I3C bus of the test board; S221 Configure the receiver DMA direction as peripheral to memory; S222 Configure the receiver DMA source address mode as fixed mode; S223 Configure the receiver DMA destination address mode as auto-increment mode; S23 Configure the control end of the test board DMA channel; S231 Configure the transmitter DMA direction as memory to peripheral; S232 Configure the transmitter DMA source address mode as auto-increment mode; S233 Configure the transmitter DMA destination address mode as fixed mode.
[0011] Furthermore, the I3C bus supports dynamic bandwidth and rate adjustment functions.
[0012] Furthermore, the configuration steps of the I3C bus are specifically as follows: S24 Configure the test board as an I3C controller; S25 Configure the I3C bus timing; S251 Set the communication bandwidth in the I3C Push-pull mode; S252 sets the communication bandwidth in the I3C Open-Drain mode (open-drain mode); S26 sets the high-impedance function of SDA (Serial Data Line).
[0013] Further, the step of adjusting the FIFO threshold based on the transmitter FIFO is specifically as follows: S31 The test board receives the write instruction sent by the host computer through USB; S32 Determine whether it is a small data volume write instruction for control or testing; S321 If it is a small data volume write instruction, the test board sets the transmitter FIFO threshold to 1 byte and initiates a small data volume write transfer; S3211 The hardware automatically determines whether the transmitter FIFO has at least one byte of empty slot. If so, it will initiate a DMA transfer of one byte from the source address to the transmitter FIFO; S3212 Determine whether the transmission is correct; S32121 If it is correct, determine whether the transmission is complete; S321211 If the transmission is not complete, return to S3211; S321212 If the transmission is complete, continue to wait for the next instruction; S32122 If it is incorrect, perform the error handling operation of S7; S322 If it is a large data volume write instruction for firmware update, the test board sets the transmitter FIFO threshold to 4 bytes and initiates a large data volume write instruction transfer; S3221 The hardware will automatically determine whether the transmitter FIFO has at least 4 bytes of empty slot. If so, it will initiate a DMA transfer of 4 bytes from the source address to the transmitter FIFO; S3222 Determine whether the transmission is correct; S32221 If it is correct, determine whether the transmission is complete; S322211 If the transmission is not complete, return to S3221; S322212 If the transmission is complete, continue to wait for the next instruction; S32222 If it is incorrect, perform the error handling operation of S7.
[0014] Further, the write instruction further includes a batch firmware update instruction.
[0015] Further, the specific steps of the batch firmware update instruction are as follows: a. The test board receives the batch firmware update instruction sent by the host computer through USB; b. Check whether the firmware to be downloaded already exists in the MCU Flash (Microcontroller Unit Flash) of the test board; b1. If it exists in the MCU Flash, then: b11. Each time, read at most the firmware frames with the maximum byte length of the extended payload page of the EPL (Extended Payload) in the CMIS protocol (Common Management Interface Specification) from the Flash; b12. Perform CDB firmware update based on the method that the FIFO threshold at the transmitting end is 4 bytes; b13. Repeat steps b11 and b12 based on the CDB protocol until the download is completed; b2. If it does not exist in the MCU Flash, then: b21. Prepare to receive the firmware sent by the host computer and store it in the MCU Flash; b22. Continue to monitor subsequent batch download firmware instructions.
[0016] Furthermore, the steps of adjusting the FIFO threshold based on the receiving - end FIFO are specifically as follows: S51 The test board receives a read instruction sent by the host computer through USB; S52 Determine whether it is a small - data - volume read instruction; S521 If it is a small - data - volume read instruction for control or testing, the test board sets the receiving - end FIFO threshold to 1 byte and initiates the transmission of the small - data - volume read instruction; S5211 The hardware automatically determines whether there is at least one - byte empty slot in the receiving - end FIFO. If so, it will initiate DMA to transfer one byte from the receiving - end FIFO to the DMA destination address; S5212 Determine whether the transmission is correct; S52121 If it is correct, determine whether the transmission is completed; S521211 If the transmission is not completed, return to S5211; S521212 If the transmission is completed, continue to wait for the next instruction; S52122 If it is incorrect, perform the error - handling operation of S7; S522 If it is a large - data - volume read instruction for firmware update, the test board sets the receiving - end FIFO threshold to 4 bytes and initiates the transmission of the large - data - volume read instruction; The S5221 hardware will automatically determine whether there are at least 4 - byte empty slots in the receiver FIFO. If so, it will initiate a DMA to transfer 4 bytes from the receiver FIFO to the DMA destination address. S5222 determines whether the transmission is correct. S52221 If it is correct, it determines whether the transmission is complete. S522211 If the transmission is not complete, it returns to S5221. S522212 If the transmission is complete, it continues to wait for the next instruction. S52222 If it is incorrect, it performs the error - handling operation of S7.
[0017] Furthermore, the steps of the error - handling operation are specifically as follows: Empty the transmitter FIFO of I3C, empty the receiver FIFO of I3C, clear the FIFO threshold adjustment, close the request of the DMA control terminal, close the transmitter DMA request, and close the receiver DMA request, and re - initialize I3C in sequence.
[0018] Furthermore, the I3C controller determines whether the trigger condition for the error - handling operation appears. If it appears, the MCU of the test board automatically executes the error - handling operation.
[0019] Furthermore, when the test board sends a write command or a read command to the optical module through the I3C bus, I3C generates communication frames for random write, random read, and current read, and the optical module receives or outputs data according to the corresponding communication - frame timing.
[0020] Furthermore, the frame format of the random write is: start bit + optical - module address + write flag + optical - module response bit + optical - module register address + check bit + data1 + check bit +...... dataN + check bit + stop bit.
[0021] Furthermore, the frame format of the random read is: start bit + optical - module address + write flag + optical - module response bit + optical - module register address + check bit + repeated start bit + optical - module address + read - flag bit + optical - module response bit + data1 + end - judgment bit +...... dataN + end - judgment bit + stop bit.
[0022] Furthermore, the frame format of the current read is: start bit + optical - module address + read - flag bit + optical - module response bit + data1 + end - judgment bit +...... dataN + end - judgment bit + stop bit.
[0023] The technical solution of the present invention has at least the following advantages and beneficial effects: The present invention discloses a communication method and system between a test board and an optical module based on the I3C protocol. By adopting the I3C protocol, the data communication rate between the test board and the optical module can be effectively improved, thereby solving the problem of low test efficiency of the optical module. In addition, by distinguishing the transmit and receive FIFOs and adjusting the FIFO threshold according to the data volume, the stability of data transmission between the test board and the optical module can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a schematic flowchart of a method of the present invention; Figure 2 It is a schematic flowchart of a batch firmware update instruction of the present invention; Figure 3 It is a schematic flowchart of a read / write instruction of the present invention; Figure 4 It is a schematic structural diagram of the system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.
[0026] Embodiment 1 As Figure 1 shown, a communication method between a test board and an optical module based on the I3C protocol includes: S1. The test board receives an instruction sent by the host computer; S2. Configure the DMA channel of the test board and configure the I3C bus; among them, using the I3C protocol provides a higher rate compared to the traditional I2C protocol, and the I3C protocol can reach up to 12.5 Mbps in the SDR mode and up to 25 Mbps in the HDR-DDR mode, significantly improving the data transmission speed; and through the DMA technology, direct data transmission is realized without the intervention of the CPU (Central Processing Unit), reducing the burden on the CPU and enabling the system to process other tasks more efficiently; When sending data on the test board through the DMA technology, the data is transferred from the RAM (Random Access Memory) in the test board MCU to the I3C peripheral. When receiving data, it is transferred from the I3C peripheral of the test board MCU to the RAM of the MCU and batch-parsed. And based on different test scenarios, different I3C peripheral FIFO threshold settings are used for transmission. When reading a small number of monitoring information of the DDM monitor, that is, control or test instructions, a FIFO threshold of 1 byte is used for DMA transmission. When performing a large amount of firmware update, a FIFO threshold of 4 bytes is used for DMA transmission; It should be noted that the data transfer and control between the test board memory data and the I3C peripheral adopt the DMA method. Using DMA can improve the throughput and reduce the CPU load. Among them, the configuration control DMA channel has a high priority, the sending DMA channel has a medium priority, and the receiving DMA channel has a medium priority; In addition, the I3C protocol supports dynamic bandwidth and rate adjustment. The test board can select different data transfer rates according to the test requirements and the communication capabilities of the test optical module to meet the needs of different test tasks. For low-speed test tasks, such as control instructions like collecting temperature data, a lower communication rate can be adopted. For high-speed tasks, such as optical module firmware update, read instructions and write instructions like IntL Deassert (Interrupt Low Deassert) status reporting, the rate can be increased to reduce latency.
[0027] The test board can obtain the communication capabilities of the optical module, including the maximum rate it supports, when allocating dynamic addresses to the optical module, and dynamically configure the communication rate according to the requirements.
[0028] The configuration supports the SDR mode, and its rate ranges from 100 Kbps to 12.5 Mbps; S3. If the instruction is a write instruction, the test board selects based on the transmitter FIFO. After adjusting the FIFO threshold according to the data volume of the instruction, it sends a write command to the optical module through the I3C bus; S4. If the optical module receives the write command, it works according to the command; S5. If the instruction is a read instruction, the test board selects based on the receiver FIFO. After adjusting the FIFO threshold according to the data volume of the instruction, it sends a read command to the optical module through the I3C bus; S6. If the optical module receives the read command, it returns data to the test board according to the command; it should be noted that after the test board receives the returned data, it will transfer it back to the host computer; S7. If the optical module does not receive the write command or the read command, or does not receive or output the correct data, the test board performs error handling operations.
[0029] In addition, the FIFO thresholds at the transmitting and receiving ends are dynamically adjusted according to different data volume requirements, improving the flexibility and performance of the system.
[0030] Embodiment 2 According to Embodiment 1, when the test board sends a write command or a read command to the optical module via the I3C bus, the I3C generates communication frames for random write, random read, and current read, and the optical module receives or outputs data according to the corresponding communication frame timing.
[0031] Among them, the communication frames for random write, random read, and current read are all designed based on the Management Memory map specified by the I3C protocol and the CMIS protocol. And the frame format for random write is: start bit + optical module address + write flag + optical module acknowledgment bit + optical module register address + check bit + data 1 + check bit +... + data N + check bit + stop bit; Among them, "data 1 + check bit +... + data N + check bit + stop bit" is optional data. If this optional data is not sent, it means that the I3C controller on the test board only sends the optical module register address to the optical module through a private write operation, and then a private read operation of the I3C controller will be performed. If this optional data is sent, it means that data 1 to data N will be written sequentially starting from the optical module register address. The frame format for random read is: start bit + optical module address + write flag + optical module acknowledgment bit + optical module register address + check bit + repeated start bit + optical module address + read flag bit + optical module acknowledgment bit + data 1 + end judgment bit +... + data N + end judgment bit + stop bit; Random read includes the optical module register address sent by the private write operation. The private read operation with the repeated start bit as the start signal means that the I3C controller will sequentially read data 1 to data N from the optical module register address.
[0032] The frame format for current read is: start bit + optical module address + read flag bit + optical module acknowledgment bit + data 1 + end judgment bit +... + data N + end judgment bit + stop bit; Current read starts with the start bit, and the timing is consistent with the second half of random read. It means that the I3C controller will read data 1 to data N at once from the current optical module register address. Through the above three frame formats of "random write", "random read", and "current read", the test board realizes the read and write access to the Management Memory map of the optical module, and further realizes the test of the dynamic address mapping and management of the CMIS protocol.
[0033] Note that the random read frame format is used as an example for illustration: The meaning of the start bit (START) is: The start condition on the I3C bus, which is used to initiate a communication. It is usually initiated by the master device and represents the start of a new transaction.
[0034] The meaning of the optical module address (Address) is: A 7-bit or dynamically allocated I3C device address, which is used to uniquely identify the location of the target slave device (optical module).
[0035] The meaning of the write flag (WriteBit) is: A value of 0 indicates that the master device will write data to the slave device (in this case, write the register address).
[0036] The meaning of the optical module acknowledgment bit (ACK) is: The response bit of the slave device to the address and direction bits. Pulling it low indicates that it has successfully received and is ready for communication.
[0037] The meaning of the optical module register address (RegisterAddress) is: Specifies the register address to be read inside the slave device. This address will be used in subsequent reads.
[0038] The meaning of the parity bit (Paritybit) is: After the master device writes the optical module register address, an odd parity bit is appended for odd parity checking of this address byte, that is, it is required that the number of "1"s among all bits including the parity bit is odd. If the odd parity check fails, the slave device may not respond or return an error flag, thus ensuring the reliability of communication.
[0039] The meaning of the repeated start bit (RepeatedSTART) is: Restarts a frame of communication without sending STOP, which is used to switch from a write operation to a read operation.
[0040] The meaning of the optical module address (Address) is: Resends the target device address to prepare for the upcoming read operation.
[0041] The meaning of the read flag bit (ReadBit) is: A value of 1 indicates that the master device will read data from the slave device.
[0042] The meaning of the optical module acknowledgment bit (ACK) is: The slave device confirms again that it is ready to send data to the master device.
[0043] The meaning of the data 1 (Data1) is: The first byte of data read from the register is sent by the slave device.
[0044] The meaning of the end judgment bit (Tbit) is as follows: The response bit sent by the slave device is used to notify the master device whether the slave device continues to transmit data itself; and when Tbit = 1, continue to transmit data, and the transmission is ended by the stop signal; when Tbit = 0, it means that the slave device ends the data transmission.
[0045] The meaning of the Nth data (DataN) is as follows: The last data byte.
[0046] The meaning of the stop bit (STOP) is as follows: Indicates that this communication is completed and the bus is released.
[0047] Embodiment 3 According to Embodiment 1, the configuration steps of the DMA channel are specifically as follows: S21 Configure the DMA channel of the I3C bus transmitter on the test board; S211 Configure the DMA direction of the transmitter as memory to peripheral; S212 Configure the DMA source address mode of the transmitter as the auto-increment mode; S213 Configure the DMA destination address mode of the transmitter as the fixed mode; S22 Configure the DMA channel of the I3C bus receiver on the test board; S221 Configure the DMA direction of the receiver as peripheral to memory; S222 Configure the DMA source address mode of the receiver as the fixed mode; S223 Configure the DMA destination address mode of the receiver as the auto-increment mode; S23 Configure the control end of the test board DMA channel; S231 Configure the DMA direction of the transmitter as memory to peripheral; S232 Configure the DMA source address mode of the transmitter as the auto-increment mode; S233 Configure the DMA destination address mode of the transmitter as the fixed mode.
[0048] When sending data on the test board through the DMA technology, the data is automatically transferred from the RAM (Random Access Memory) of the test board MCU to the I3C peripheral, and when receiving data, it is automatically transferred from the I3C peripheral of the test board MCU to the RAM of the MCU and batch-parsed, without the need for intermediate transfer by the CPU. When performing test tasks that require processing a large amount of data, such as firmware update, the efficiency and performance of the system are greatly improved.
[0049] Embodiment 4 According to Embodiment 3, the configuration steps of the I3C bus are specifically as follows: S24 Configure the test board as an I3C controller; S25 Configure the I3C bus timing; S251 Set the communication bandwidth in the I3C Pushpull mode; S252 Set the communication bandwidth in the I3C OpenDrain mode; S26 Set the SDA high-impedance function.
[0050] Among them, S251 and S252 are the dynamic bandwidth and rate adjustment functions of the I3C protocol. According to the requirements of the test task and the communication ability of the test optical module, different data transmission rates can be selected through these two steps to meet the requirements of different test tasks.
[0051] Embodiment 5 According to Embodiment 1 and Figure 3 , the steps of adjusting the FIFO threshold based on the transmitter FIFO (TX-FIFO, Transmit First-In-First-Out) are specifically as follows: S31 The test board receives the write instruction sent by the host computer through USB; S32 Determine whether it is a small data volume write instruction for control or testing; S321 If it is a small data volume write instruction, the test board sets the transmitter FIFO threshold to 1 byte and initiates a small data volume write transmission; S3211 The hardware automatically determines whether there is at least one byte of empty slot in the transmitter FIFO. If so, it will initiate a DMA to transfer one byte from the source address to the transmitter FIFO; S3212 Determine whether the transmission is correct; S32121 If it is correct, determine whether the transmission is completed; S321211 If the transmission is not completed, return to S3211; S321212 If the transmission is completed, continue to wait for the next instruction; S32122 If it is incorrect, perform the error handling operation of S7; S322 If it is a large data volume write instruction for firmware update, the test board sets the transmitter FIFO threshold to 4 bytes and initiates a large data volume write instruction transmission; S3221 The hardware will automatically determine whether there are at least 4 bytes of empty slots in the transmitter FIFO. If so, it will initiate a DMA to transfer 4 bytes from the source address to the transmitter FIFO; S3222 Determine whether the transmission is correct; S32221 If it is correct, determine whether the transmission is complete; S322211 If the transmission is not complete, return to S3221; S322212 If the transmission is complete, continue to wait for the next instruction; S32222 If it is incorrect, perform the error handling operation of S7.
[0052] In addition, the steps for adjusting the FIFO threshold based on the receiver FIFO (RX-FIFO, Receive First-In-First-Out buffer) are as follows: S51 The test board receives the read instruction sent by the host computer through USB; S52 Determine whether it is a small data volume read instruction; S521 If it is a small data volume read instruction for control or testing, the test board sets the receiver FIFO threshold to 1 byte and initiates the transmission of the small data volume read instruction; S5211 The hardware automatically determines whether there is at least one byte of empty slot in the receiver FIFO. If so, it will initiate a DMA to transfer one byte from the receiver FIFO to the DMA destination address; S5212 Determine whether the transmission is correct; S52121 If it is correct, determine whether the transmission is complete; S521211 If the transmission is not complete, return to S5211; S521212 If the transmission is complete, continue to wait for the next instruction; S52122 If it is incorrect, perform the error handling operation of S7; S522 If it is a large data volume read instruction for firmware update, the test board sets the receiver FIFO threshold to 4 bytes and initiates the transmission of the large data volume read instruction; S5221 The hardware will automatically determine whether there are at least 4 bytes of empty slots in the receiver FIFO. If so, it will initiate a DMA to transfer 4 bytes from the receiver FIFO to the DMA destination address; S5222 Determine whether the transmission is correct; S52221 If it is correct, determine whether the transmission is complete; S522211 If the transmission is not complete, return to S5221; S522212 If the transmission is complete, continue to wait for the next instruction; S52222 If it is incorrect, perform the error handling operation of S7.
[0053] The application of the FIFO management mechanism provides an efficient and flexible data sending mechanism, which is particularly suitable for the I3C optical module test board that needs to perform various tasks and communicate frequently.
[0054] Example 6 According to Example 5, the instructions include control instructions and test instructions. The control instructions are specifically instructions to start the optical module to perform work, and the test instructions include read instructions and write instructions. The read instructions and write instructions are respectively used to control the test board to read or write data into the optical module, and the write instructions also include a batch firmware update instruction.
[0055] Among them, the control instructions sent by the test board to the optical module through the I3C protocol include, for example, adjusting the optical power or collecting test data, and then receiving the data feedback from the optical module in real time, such as temperature and optical power. And the control instructions, as well as some read instructions and write instructions, are generally small data volume instructions, while the batch firmware update instruction in the write instructions involves firmware upgrade, and the IntLDeassert status report in the read instructions involves a large amount of data reading, so they are large data volume instructions.
[0056] In addition, the batch firmware update instruction is used to perform batch update on the optical module. The specific update process is as follows: The host computer sends the optical module firmware to the test board through USB. The test board saves the optical module firmware in the Flash of the MCU, then extracts the optical module firmware from the Flash through the CDB mechanism in the CMIS protocol, and uses the DMA method to send it to the optical module through the I3C bus to complete the firmware update. When batch-updating the firmware, this method can save the time for the host computer to transfer the firmware to the test board through USB, so as to save the time for batch-updating the firmware, and thus improve the production efficiency. Refer to Figure 2 , the specific steps are as follows: a The test board receives the batch download firmware instruction sent by the host computer through UB; b Check whether the firmware to be downloaded already exists in the MCU Flash of the test board; b1 If it exists in the MCU Flash, then: b11 Each time, read at most the firmware frame with the maximum byte length of the EPL extended payload page based on the CMIS protocol from the Flash; b12 Perform CDB firmware update based on the method with a FIFO threshold of 4 bytes at the sending end; b13 Repeat steps b11 and b12 based on the CDB protocol until the download is completed; b2 If it does not exist in the MCU Flash, then: b21 Prepare to receive the firmware sent by the host computer and store it in the MCU Flash; b22 continues to monitor subsequent batch download firmware instructions.
[0057] Embodiment 7 According to any one of Embodiments 1-6, the steps of the error handling operation are specifically as follows: Successively perform the closing of the I3C interrupt, empty the transmit FIFO of the I3C, empty the receive FIFO of the I3C, empty the FIFO threshold adjustment, close the request of the DMA control end, close the transmit DMA request, and close the receive DMA request, and re-initialize the I3C; in addition, the I3C controller determines whether the trigger condition for the error handling operation appears. If it appears, the MCU of the test board automatically executes the error handling operation, that is, when the I3C controller determines that a write command or a read command is not received, or the correct data is not received or output, the MCU of the test board automatically executes the specific error handling operation to solve the communication error. Compared with the traditional situation of manually re-initializing the I3C test board, the processing efficiency has been greatly improved; the I3C communication function of the test board is quickly and automatically restored after a communication error, the communication efficiency is improved, the system latency is reduced, and it is applicable to error recovery caused by, but not limited to, the I3C interrupt disabling scenario when the I3C optical module programs the Flash. In addition, the scenarios where the I3C peripheral terminal is disabled are as follows: for example, when the I3C optical module executes the code writing task and needs to erase and program the Flash, the I3C optical module needs to disable some interrupts including the I3C peripheral interrupt; and when the I3C peripheral interrupt of the I3C optical module is disabled and the test board performs I3C communication with the optical module, the I3C optical module does not respond to the I3C controller at this time, which will cause the test board I3C to enter an error interrupt.
[0058] Embodiment 8 According to any one of the above Embodiments 1-6, and Figure 4 , an I3C protocol-based optical module test system includes a host computer, an optical module test board, and multiple optical modules. The host computer is signal-connected to the test board through USB, and the test board is communicatively connected to multiple optical modules through the I3C bus.
[0059] Among them, the optical module can also be called an I3C optical module, and the test board is the optical module test board, which can also be called the I3C optical module test board, including an MCU, a DSP (Digital Signal Processor), an optical module electrical interface, and a USB interface. The MCU serves as the control center of the test board and is responsible for overall coordination to ensure the efficient operation of the test board; it mainly has the following functions: 1. Transceive instructions and data from the host computer through USB, 2. Communicate with the I3C optical module through the I3C bus of the electrical interface, 3. Control the control pins related to the optical module in the electrical interface, 4. Manage the test tasks. The DSP has the functions of 1. receiving the electrical signals generated during the optical module test process, and performing signal processing and analysis, and 2. sending the electrical signals required for the test to the optical module; The electrical interface of the optical module is the physical connection carrier between the test board and the optical module, including the following three types: 1. Multiple low-speed signal control pins, such as Modsel (Module Select, module selection signal) (optional), LPMode (Low Power Mode, low power mode), IntL (Interrupt Low, interrupt signal), ResetL (ResetLow, reset signal), and ModPrsL (Module Present Low, module presence detection signal (low level effective)), to achieve functions such as module selection, power consumption control, status indication, reset control, and presence status indication; 2. High-speed signal line data pins, divided into differential signal pairs at the transmitting end of Tx1, Tx2...Txn (representing multiple independent transmission channels of the optical module), and differential signal pairs at the receiving end of Rx1, Rx2...Rxn (representing multiple independent receiving channels of the optical module); 3. The SCL (Serial Clock Line, clock signal line) clock and SDA data signal line of the I3C bus are used for communication between the test board and the I3C optical module; The USB interface is used to connect to the USB cable of the host computer.
[0060] And before the system starts running, it is also necessary to initialize each module, that is: S01: Initialize the low-speed control pins of the electrical interface of the optical module; S02: Initialize the USB and configure the USB into the HID+CDC mode (Human Interface Device + Communication Device Class, a combination of two modes of the USB interface); S03: Initialize the Flash, which is used as a temporary storage area during the batch firmware download of the optical module, and will greatly improve the download speed; S04: By default, initialize the I3C, initialize the I3C peripheral of the test board as an I3C controller, and configure it into the DMA communication mode; S05: Initialize peripherals such as the ADC (Analog-to-Digital Converter) and DAC (Digital-to-Analog Converter), as well as chips such as the DSP and DC-DC (DC-DC converter); S06: Start the test task management, listen to the test instructions from the host computer through USB and transmit data.
[0061] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A communication method between a test board and an optical module based on the I3C protocol, characterized in that: include: S1. The test board receives the command sent by the host computer; S2. Configure the DMA channel of the test board and configure the I3C bus; S3. If the instruction is a write instruction, the test board selects the FIFO based on the transmitting end, adjusts the FIFO threshold according to the data size of the instruction, and sends a write command to the optical module through the I3C bus; S4. If the optical module receives a write command, it works according to the command; S5. If the instruction is a read instruction, the test board selects the receiving end FIFO, adjusts the FIFO threshold according to the data size of the instruction, and sends a read command to the optical module through the I3C bus; S6. If the optical module receives the read command, it returns data to the test board according to the command; S7. If the optical module does not receive a write command or a read command, or does not receive or output correct data, the test board performs an error handling operation.
2. The communication method between the test board and the optical module based on the I3C protocol according to claim 1, characterized in that: The configuration steps of the DMA channel are as follows: S21 configures the DMA channel at the I3C bus initiator on the test board; S211 configures the DMA direction of the sending end to be from memory to peripherals; S212 configures the DMA source address mode of the sending end to be a self-increment mode; S213 configures the DMA destination address mode of the sending end to be a fixed mode; S22 configures the DMA channel of the I3C bus receiving end on the test board; S221 configures the receiving end DMA direction from peripheral to memory; S222 configures the receiving end DMA source address mode to a fixed mode; S223 configures the receiving end DMA destination address mode to be a self-increment mode; S23 configures the control end of the DMA channel of the test board; S231 configures the DMA direction of the sending end to be from memory to peripherals; S232 configures the source address mode of the DMA at the sending end to be the self-increment mode; S233 configures the DMA destination address mode of the transmitting end to be a fixed mode.
3. The communication method between the test board and the optical module based on the I3C protocol according to claim 2, characterized in that: The configuration steps of the I3C bus are as follows: S24 configures the test board as an I3C controller; S25 configures I3C bus timing; S251 sets the communication bandwidth in I3C Pushpull mode; S252 sets the communication bandwidth in I3C OpenDrain mode; S26 sets the SDA high impedance function.
4. The communication method between the test board and the optical module based on the I3C protocol according to claim 1, characterized in that: The I3C bus supports dynamic bandwidth and rate adjustment functions.
5. The communication method between the test board and the optical module based on the I3C protocol according to claim 1, characterized in that: The steps of adjusting the FIFO threshold based on the transmitting end FIFO and according to the data volume of the instruction are as follows: The S31 test board receives the write command sent by the host computer via USB; S32 determines whether it is a small data write instruction for control or testing; If S321 is a small data write instruction, the test board sets the sender FIFO threshold to 1 byte and initiates a small data write transmission; The S3211 hardware automatically determines whether there is at least one byte empty slot in the sender FIFO. If so, it will initiate DMA to transfer a byte from the source address to the sender FIFO; S3212 determines whether the transmission is correct; If S32121 is correct, determine whether the transmission is complete; If S321211 is not transferred, it returns to S3211; S321212 If the transmission is completed, continue to wait for the next instruction; If S32122 is incorrect, the error handling operation of S7 is performed; If S322 is a large data volume write instruction for firmware update, the test board sets the transmitting end FIFO threshold to 4 bytes and initiates the transmission of the large data volume write instruction; The S3221 hardware will automatically determine whether the sender FIFO has at least 4 bytes of empty slots. If so, it will initiate DMA to transfer 4 bytes from the source address to the sender FIFO; S3222 determines whether the transmission is correct; If S32221 is correct, determine whether the transmission is complete; If S322211 is not transferred, it returns to S3221; S322212 If the transmission is completed, continue to wait for the next instruction; If S32222 is incorrect, perform error handling operation of S7.
6. The communication method between the test board and the optical module based on the I3C protocol according to claim 5, characterized in that: The write instructions also include batch firmware update instructions.
7. The communication method between the test board and the optical module based on the I3C protocol according to claim 6, characterized in that: The specific steps of the batch firmware update instruction are: a. The test board receives the batch firmware update command sent by the host computer via USB; b. Check whether the firmware to be downloaded already exists in the MCU Flash of the test board; b1. If it exists in MCU Flash, then: b11. Each time, a firmware frame of at most the maximum byte length of the EPL extended load page in the CMIS protocol is read from the Flash; b12. CDB firmware update based on the sending FIFO threshold of 4 bytes; b13. Repeat steps b11 and b12 based on the CDB protocol until the download is complete; b2. If it does not exist in the MCU Flash, then: b21. Prepare to receive the firmware sent by the host computer and store it in the MCU Flash; b22. Continue to monitor the subsequent batch firmware download instructions.
8. The communication method between the test board and the optical module based on the I3C protocol according to claim 1, characterized in that: The steps of adjusting the FIFO threshold based on the receiving end FIFO and according to the data volume of the instruction are as follows: The S51 test board receives the read command sent by the host computer via USB; S52 determines whether it is a small data read instruction; If S521 is a small data read instruction for control or test, the test board sets the receiving end FIFO threshold to 1 byte and initiates the transmission of the small data read instruction; The S5211 hardware automatically determines whether there is at least one byte empty slot in the receiving FIFO. If so, it will initiate DMA to transfer a byte from the receiving FIFO to the DMA destination address; S5212 determines whether the transmission is correct; If S52121 is correct, determine whether the transmission is completed; If S521211 is not transferred, then return to S5211; S521212 If the transmission is completed, continue to wait for the next instruction; If S52122 is incorrect, the error handling operation of S7 is performed; If it is a large data volume read instruction for firmware update, the test board sets the receiving end FIFO threshold to 4 bytes and initiates the transmission of the large data volume read instruction; The S5221 hardware will automatically determine whether the receiving FIFO has at least 4 bytes of empty slots. If so, it will initiate DMA to transfer 4 bytes from the receiving FIFO to the DMA destination address; S5222 determines whether the transmission is correct; If S52221 is correct, determine whether the transmission is completed; If S522211 is not transferred, return to S5221; S522212 If the transmission is completed, continue to wait for the next instruction; If S52222 is incorrect, perform error handling operation of S7.
9. The communication method between the test board and the optical module based on the I3C protocol according to any one of claims 1 to 8, characterized in that: The steps of the error handling operation are specifically: Clear the I3C sender FIFO, clear the I3C receiver FIFO, clear the FIFO threshold adjustment, turn off the DMA control end request, turn off the sender DMA request and turn off the receiver DMA request in sequence, and reinitialize I3C.
10. The communication method between the test board and the optical module based on the I3C protocol according to claim 9, characterized in that: The I3C controller determines whether a trigger condition for an error handling operation occurs. If so, the MCU of the test board automatically performs the error handling operation.
11. The communication method between the test board and the optical module based on the I3C protocol according to claim 1, characterized in that: When the test board sends a write command or a read command to the optical module through the I3C bus, the I3C generates random write, random read, and current read communication frames, and the optical module receives or outputs data according to the corresponding communication frame timing.
12. The communication method between the test board and the optical module based on the I3C protocol according to claim 11, characterized in that: The frame format of the random write is: start bit+optical module address+write flag+optical module response bit+optical module register address+check bit+data 1+check bit+...data N+check bit+stop bit.
13. The communication method between the test board and the optical module based on the I3C protocol according to claim 11, characterized in that: The frame format of the random read is: start bit + optical module address + write flag + optical module response bit + optical module register address + check bit + repeat start bit + optical module address + read flag bit + optical module response bit + data 1 + end judgment bit + ... data N + end judgment bit + stop bit.
14. The communication method between the test board and the optical module based on the I3C protocol according to claim 11, characterized in that: The currently read frame format is: start bit+optical module address+read flag bit+optical module response bit+data 1+end judgment bit+...data N+end judgment bit+stop bit.
15. A communication system between a test board and an optical module based on an I3C protocol, implementing the communication method between a test board and an optical module based on an I3C protocol as claimed in claim 1, characterized in that: The system comprises a host computer, a test board and a plurality of optical modules. The host computer is connected to the test board signal via a USB, and the test board is connected to the plurality of optical modules via an I3C bus.
Citation Information
Patent Citations
Method and device for transmitting and receiving data
CN102244552A
Module and method for quickly reading data of multiple MEMS sensors on basis of I2C interface
CN105677598A
Signal acquisition board card and automatic test system
CN114047724A
Communication method and system based on streaming DMA
CN117318811A
Bandwidth adjusting method and device
CN118075641A
Cited By
Optical path signal integrity control method and system
CN121283501A