| 
      
      
      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 | 
| 
      
      
      From:  <and...@nt...> - 2006-09-21 15:58:55
       | 
| It is indeed a problem with the set_altinterface respectively with my = device! When I call set_altinterface only the first time, I can claim, = release, write and read as much as I want without problems. I think, there's some more firmware debugging to do... Thanks Stephan! Andreas -----Urspr=FCngliche Nachricht----- Von: lib...@li... = [mailto:lib...@li...] Im Auftrag von = Stephan Meyer Gesendet: Mittwoch, 20. September 2006 21:46 An: lib...@li... Betreff: Re: [Libusb-win32-devel] Read/write and release/claim_interface 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?=20 Does it reset the endpoint's data toggle bits when it receives such a = request? Stephan > Hi >=20 > 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. >=20 > 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() >=20 > 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() >=20 > **************************** >=20 > 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. >=20 > Any hints are appreciated! > Thanks, Andreas >=20 > ---------------------------------------------------------------------- > --- Take Surveys. Earn Cash. Influence the Future of IT Join=20 > SourceForge.net's Techsay panel and you'll get the chance to share=20 > your opinions on IT & business topics through brief surveys -- and=20 > earn cash=20 > = http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEV > DEV _______________________________________________ > 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=3D100071&distributionid=3D000000000066 -------------------------------------------------------------------------= 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=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV _______________________________________________ Libusb-win32-devel mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel |