Part Number:AM3352
Tool/software: Linux
hi all:
I have some problems with the am3352 and ch340G,a USB to serial port chip。
Am3352 has used kernel versions of 4.4.113 and 4.1.6 respectively, and USB serial interface chips are driven by ch340G manufacturer's official network, such as accessories.
The test method is as follows. Two serial ports of devices A and B are connected to each other. First, A sends 2K data with counting flag to B. When B receives the data, it checks the integrity of the data and counts correctly. After checking correctly, all the data received by B will be sent back to A. After receiving, A will check whether the received data is the data sent by itself. Then send the next frame.
Normally, the sending and receiving data are OK.
The error is as follows: when sending a certain frame of data, you can not send 2K data completely, and the data must be a multiple of 32 bytes.
Tracking the driver of ch340G, we found that his main process is: when sending data, call the write function, which will submit a URB to the USB subsystem, including 32 bytes of data. When the data is sent, the USB subsystem calls the driven completion function and continues to send the next 32 bytes of data in the completion function until all the data is sent. When an error occurs, the driver's completion function is not called when a 32-byte data is sent in the middle, resulting in the subsequent data being unable to continue to be sent. But the specific reasons were not found.
This phenomenon does not necessarily occur for a few minutes or one or two hours.
Testing the driver of the CH341 brought by the kernel will also lead to abnormal transmission.
On the hardware, there is no abnormal data sending and receiving when the circuit related to the serial port of the USB is flown out to connect to other CPU chips.
Can someone help me? Thank you very much!
(Please visit the site to view this file)