2012-03-04 09:29 PM
Hi,
I’m a beginner in usb development. I need to have download and readback data to and from stm32f103ze through usb. I have a problem while downloading data to microcontroller. I’m following the libraries that I got from st. For collecting the data form host I had used the following function
DataLength = GetEPRxCount(bEpAddr & 0x7F);
//
/* Use the memory interface function to write to the selected endpoint */
PMAToUserBufferCopy(pBufferPointer, GetEPRxAddr(bEpAddr & 0x7F) , DataLength);
While using this functions the stating location of receive buffer is pointed to some other location. So I haven’t got the exact data that I have sent. By rewriting the functions as follows I got my exact data.
DataLength = GetEPRxCount(bEpAddr & 0x7F);
Temp =
GetEPRxAddr(bEpAddr & 0x7F);
Temp = Temp & 0x01ff;
//
/* Use the memory interface function to write to the selected endpoint */
PMAToUserBufferCopy(pBufferPointer, Temp - 1 , DataLength);
Here what may the issue??
By this minor modification I solved current issue. But I have a doubt that, will this give exact data at all time??
FYI:- Attached file is my usb descriptor.