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.
I have a basic question on USB transfers/ drivers.
Lets say a host wants to read data from the device (TIVA) and it performs a transfer IN, where(in which part of the device SW driver) the device should process the answer?
The routine RxHandler is for the data the device receives from the host while TxHandler is the data the device transmits to the host...so If the HOST start a transfer IN...where I am going to see that in the device sw driver(so I can process the information and answer)?
Right now I am writing data (transfer OUT) from the host to communicate to the device which data to send in the next Transfer IN request...so I manage the answer in the RxHandler..it does not look to me the correct way to do it.
Thanks.
The transfers are initiated always by the HOST.
With IN-TRANSFER I mean...the HOST requires data from the DEVICE(read). OUT-TRANSFER the HOST sends data to the Device(write).
G.
Gianluca Allegretto said:My question is... is it possible to perform only the IN-Transfer?
Yes, IN and OUT endpoints work independently each other, even if they share the same endpoint number (except for the default endpoint, EP0).
I need a kind of callback to prepare teh data to send to the HOST when it requires a bulkIN...
Sometimes I have some TIMEOUT
OK I have few more information to share .
I added some debug to have statistics about what is happening and I would really appreciate your feedback.
As I wrote the main communication between HOST/DEVICE is implemented as request of data BULK-OUT and just after that a BULK-IN to get the data. The data is a buffer of 380 bytes. I wanted to monitor what is happening , these are the results from the HOST.
REQ_MSG_RECEIVED :
OK 365007 (each is 380 bytes) it is like 18minuts test.
TIMEOUT 31
BAD ID 24
GENERIC ERROR 0
I have breaks points in the device to make sure BUfferWrite return the correct number(it never fails).
I don't know is 31 timeouts on 365007 frames is a normal number for a bulk communication..I do not have experience with that.
The BAD ID (24) happens when there is a TIMEOUT (but sometimes there is timeout without bad ID). BAD ID means the data received by the HOST does not have the correct information...I am sending always 0x55 and receiving 0x00).
There are not other errors in the HOST,I am monitoring also :
"LIBUSB_TRANSFER_CANCELLED request message";
"LIBUSB_TRANSFER_STALL request message";
"LIBUSB_TRANSFER_NO_DEVICE request message";
"LIBUSB_TRANSFER_OVERFLOW request message
On the Device side I have added counter for all error cases in RxHandler and TXHandler...but I do not have any error.