This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/EK-TM4C123GXL: USB serial lost frames

Part Number: EK-TM4C123GXL
Other Parts Discussed in Thread: EK-TM4C1294XL

Tool/software: Code Composer Studio

Hi,

Now, the client is MCU and the host is CPU.

The host CPU sent 1.8KB datas(1000 frames, every frame including 2 head bytes and 16 data bytes) to usb-serial.

I have mapped a 1.8KB buf in the MCU and some frames are lost in the usb driver function USBEndpointDataGet.

I count the 16bytes datas and only about 938 can be read.

  • Hello Rick,

    There isn't a lot of information here for me to work with... I'm not aware of a known issue to cause that problem.

    I can see you are using our usb_dev_serial example. Is this being done on a LaunchPad?

    Where in the code are you updating the counter? I am guessing in the USB callback for Data Received?

    Did you check if the buffer maybe had extra data at times? Perhaps the callback to the application occurred after two packets were received sometimes?

    Can you add a counter for if ui32ByteCount is greater than 16 bytes as well? Maybe also one for 1-15 bytes? See how many times that triggers?

    Just trying to think of situations that could explain your observation since that seems to be done in the app layer and not the USB stack.

  • Hello Ralph,

    Thank you very much for your response.

    Sorry for reading your answer so late for our national day.

    I have verified the issue based on the usb_serial_dev example on a LaunchPad again.
    I'm going to test it following your steps.

    I also upload the test code. Please review it. Thank you.usb_serial_verification_20201009.zip

  • Hello Rick,

    We don't really do code reviews of full projects so if you have a particular area of the usb_dev_serial project you modified and want me to look over, let me know the line counts and I can do so.

  • Hi Ralph

    Many thanks.

    Sorry, I'm busy doing another poject.

    The line counts is 2854 - 2862 in the usb.c file.

    I added this only for frames statistics.

    I have also removed these debug code and the issue can be reproduced too.

  • Hello Rick,

    I had asked originally the following and I think it is very important to get information here as I don't think your test code is catching everything:

    Ralph Jacobi said:
    Can you add a counter for if ui32ByteCount is greater than 16 bytes as well? Maybe also one for 1-15 bytes? See how many times that triggers?

    There may be times that by the time the USBEndpointDataGet API is called more than 16 bytes were received. I also would be curious if maybe sometimes the packets came in smaller too.

    What application are you using to run this test? If I can run it on my EK-TM4C1294XL LaunchPad with the usb_dev_serial application then I can check for this issue and I can also review USB analyzer data. But I would need the right test program to do that check.