|
From: Stephan M. <ste...@we...> - 2006-09-20 19:45:58
|
I don't think that your problems are cause by release/claim_interface. These commands don't send any data to the device. They just lock some resources (the interfaces) in the driver. I think the problem seems to be the set_altinterface command. Does your firmware properly handle a set_interface request? Does it reset the endpoint's data toggle bits when it receives such a request? Stephan > Hi > > I don't understand the behavior of subsequent read/write operations when using usb_release_interface() and usb_claim_interface() between the read/writes. > My test device is a AT90SUB1287 and loops the data from an OUT bulk endpoint to an IN bulk endpoint. > I'm using the latest CVS source, but I had the same problem with the official libusb-win32-snapshot 20060827. > > This scenario works fine: > **************************** > - usb_open() > - usb_set_configuration() > - usb_claim_interface() > - usb_set_altinterface() > - usb_bulk_write() (multiple read/writes work fine) > - usb_bulk_read() > - usb_release_interface() > - usb_close() > > This scenario gives me a timeout error, but read/write work after some timeout errors again: > **************************** > - usb_open() > - usb_set_configuration() > - usb_claim_interface() > - usb_set_altinterface() > - usb_bulk_write() (works fine, I get the data on the device) > - usb_release_interface() > ** > - usb_claim_interface() > - usb_set_altinterface() > - usb_bulk_read() (works fine, I get the data from the device) > - usb_release_interface() > ** > - usb_claim_interface() > - usb_set_altinterface() > - usb_bulk_write() (no failure (libusb), but I don't get any data on the device) > - usb_release_interface() > ** > - usb_claim_interface() > - usb_set_altinterface() > - usb_bulk_write() (no failure (libusb), but I don't get any data on the device) > - usb_bulk_read() (fails, timeout error) > - usb_bulk_write() (works fine, I get the data on the device) > - usb_bulk_read() (fails, timeout error) > - from now on all read/write are successful again > - usb_release_interface() > - usb_close() > > **************************** > > Is it not allowed to claim the interface again after release? > I'm wondering why writing to the device succeeds, although I don't get any data on the device? I can write as many times as I want without getting an error from libusb. The device can buffer only one transfer. > Strange is, that it starts working again after some subsequent write/reads. > > Any hints are appreciated! > Thanks, Andreas > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Libusb-win32-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel _____________________________________________________________________ Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! http://smartsurfer.web.de/?mc=100071&distributionid=000000000066 |