This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

reading data from USB endpoint

Hello,

I modified a "memory" example for AT91SAM7X-EK board and I am trying to read data from Endpoint 2 (OUT).
The function USB_ReadEP returns a byte count of data received. But When I try to read the data buffer that is suppose to hold this data it doesn't match what the Host sent.

Here is the code I used:

         BYTE * EP_Data;
        DWORD cnt;
        // Read EP2 data
        cnt = USB_ReadEP (0x02, (BYTE*)EP_Data);

         // Write data back to host
        USB_WriteEP(0x83, (BYTE *)EP_Data, cnt);

So I get the correct count of bytes received but the data in the EP_Data buffer doesn't match what I sent from the Host.
Does anyone know if this is the correct way to read data from Endpoints?

Thanks
Mario

Parents Reply Children