Reply by May 11, 20072007-05-11
> r = usb_bulk_read(hCurrent_reader, 0x86, buffer, USB2_BUFFER_SIZE, 1000); > if (r != USB2_BUFFER_SIZE){ > printf("Bulk Read failed (%d).\n",r); > printf("%s\n",usb_strerror()); > } else { > printf("Bulk read success\n"); > }
I use IOCTL_EZUSB_BULK_READ instead of usb_bulk_read(), but I suppose the functionality is similar. There are two ways the read can fail: A) If you supply a buffer that is smaller than the amount of data that is in the active FX2 FIFO, the read will fail with an error. I don't know the usb_bulk_read() function, but maybe it returns a negative value in this case. Check the docs. B) If the FX2 has less data in the active FIFO than the size of your buffer, the read will complete but return only the number of bytes actually read. In this case the read has not completely failed, but your code will claim so. Hope this helps, Marc
Reply by Gavin Brewer May 10, 20072007-05-10
jetmarc@hotmail.com wrote:
>> "usb_submit_async: submitting request failed, win error: The parameter >> is incorrect" >> >> So far, we have established that the problem is on the peripheral (8051 >> FX2) side, and *not* on the host side. > > How have you established that? >
We tested a different device with it's own firmware. The program used to load the .HEX file into the device memory, (r)enumerate USB devices and issue vendor requests etc was still the same. This setup worked fine and so therefore the problem was not with the host end of things.
> What parameters do you use to call the driver function? >
Well, here's the function call: r = usb_bulk_read(hCurrent_reader, 0x86, buffer, USB2_BUFFER_SIZE, 1000); if (r != USB2_BUFFER_SIZE){ printf("Bulk Read failed (%d).\n",r); printf("%s\n",usb_strerror()); } else { printf("Bulk read success\n"); } You may almost certainly require more specific information; if this is so then please ask. Thank you, Gavin Brewer.
Reply by May 10, 20072007-05-10
> "usb_submit_async: submitting request failed, win error: The parameter > is incorrect" > > So far, we have established that the problem is on the peripheral (8051 > FX2) side, and *not* on the host side.
How have you established that? What parameters do you use to call the driver function?
Reply by Gavin Brewer May 9, 20072007-05-09
Hi Guys,

I have attempted to perform a USB Bulk read transfer over an EZ-USB FX2 
  development board. Vendor requests work fine, but using the 
usb_bulk_read() functions returns the following error message:

"usb_submit_async: submitting request failed, win error: The parameter 
is incorrect"

So far, we have established that the problem is on the peripheral (8051 
FX2) side, and *not* on the host side.

Could anyone give me some advice as how to modify my firmware code, or 
at least help me find out what is going on?

Thank you,
		Gavin Brewer