Hello,
I've been using TivaWare_C_Series-2.0.1.11577 with TM4C123GH6ZRB. I created a USB bulk device and it talked to PC using TI bulk device driver. I modified the usb_bulk_example and it can send/receive data to/from the board.
But I found when the message is relatively large (in this case, more than 512 bytes), if the PC uses ReadUSBPacket(...) with a timeout value (50 ms here) to receive data, it will lose data. For example, using
dwError = ReadUSBPacket(hUSB, szBuffer, 64, &ulRead, 50, NULL);
it may lose a block of 64 bytes from time to time. If the buffer size is changed to 128 bytes, it will lose blocks of 128 bytes. If I change the buffer size to way bigger than the message size, it will lose a whole message from time to time. If I make it a blocking read (changing 50 to INFINITE), it won't lose any data.
On the PC side, I added up the ulRead numbers. On the board, I counted the bytes sent out in RxHandler(). They didn't match. The data rate was very low - it could be just a message a second.
Any help is greatly appreciated!
Yanli