|
From: Stephan M. <Ste...@ia...> - 2007-11-09 12:49:47
|
> As you can see, the bConfigurationValue is 0, not 1. Is that the
problem?
> And if it is, why does it work with the older version of the lib? Do I
have
> to change the value to 1 (which might be a problem as I can't flash the
> controller...)?
A configuration value of '0' is invalid (see USB spec
for details). So the only solution is to fix your device's
firmware.
It worked with the old DLL because the old version of
usb_set_configuration() treated the 'config' parameter as
an index, which was wrong. Whereas the new version treats
the parameter as a value that must be equal to one of the
descriptor's bConfigurationValue values.
Stephan
>
> Well, since the application on the controller is not written by me I
can't
> give you the code. But I can post what TestLibUsb gives me:
>
> wTotalLength: 46
> bNumInterfaces: 1
> bConfigurationValue: 0
> iConfiguration: 0
> bmAttributes: 80h
> MaxPower: 50
> bInterfaceNumber: 0
> bAlternateSetting: 0
> bNumEndpoints: 4
> bInterfaceClass: 255
> bInterfaceSubClass: 0
> bInterfaceProtocol: 0
> iInterface: 0
> bEndpointAddress: 01h
> bmAttributes: 02h
> wMaxPacketSize: 64
> bInterval: 0
> bRefresh: 0
> bSynchAddress: 0
> bEndpointAddress: 81h
> bmAttributes: 02h
> wMaxPacketSize: 64
> bInterval: 0
> bRefresh: 0
> bSynchAddress: 0
> bEndpointAddress: 02h
> bmAttributes: 02h
> wMaxPacketSize: 64
> bInterval: 0
> bRefresh: 0
> bSynchAddress: 0
> bEndpointAddress: 82h
> bmAttributes: 02h
> wMaxPacketSize: 64
> bInterval: 0
> bRefresh: 0
> bSynchAddress: 0
>
> As you can see, the bConfigurationValue is 0, not 1. Is that the
problem?
> And if it is, why does it work with the older version of the lib? Do I
have
> to change the value to 1 (which might be a problem as I can't flash the
> controller...)?
>
> Best regards
>
>
>
> Stephan Meyer-2 wrote:
> >
> > dev->config[0].bConfigurationValue should be >=1.
> > Could you please post your configuration descriptor(s)?
> >
> > Stephan
> >
> >>
> >> Hi,
> >>
> >> > is '1' a valid configuration value?
> >> well, it should be as the application can be run with the older
version
> > of
> >> libusb...
> >> I tried using your code and now the application runs over the
> >> usb_set_configuration. But now the next call (the one to
> >> usb_claim_interface()) returns an error...
> >> Here is the message:
> >> "usb_claim_interface: could not claim interface 0, invalid
configuration
> > 0".
> >>
> >> So as I understand configuration 0 is set by the set_configuration
and
> > is
> >> not valid. But why?? I mean it does work (with the older version of
the
> >> library)!
> >>
> >> Thanks in advance
> >>
> >>
> >> Stephan Meyer-2 wrote:
> >> >
> >> >> err = usb_set_configuration(m_dev, 1);
> >> >
> >> > * is '1' a valid configuration value?
> >> > This value must by the config-descriptors 'bConfigurationValue'
> >> > * try usb_set_configuration(m_dev,
dev->config[0].bConfigurationValue)
> >
> >> >
> >> > Stephan
> >> >
> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> the error message is
> >> >> "usb_set_configuration: could not set config 1: win error: The
> > parameter
> >> > is
> >> >> incorrect.".
> >> >>
> >> >> Michael
> >> >>
> >> >>
> >> >> Stephan Meyer-2 wrote:
> >> >> >
> >> >> > What's the error message returned
> >> >> > by usb_strerror()?
> >> >> >
> >> >> > Stephan
> >> >> >
> >> >> >
> >> >> >>
> >> >> >> Hi,
> >> >> >>
> >> >> >> I have a VisualC++ 6.0-application (MFC) for Windows XP.
> >> >> >> This application is supposed to communicate with a
microcontroller
> >
> >> > using
> >> >> >> Bulk writes over USB.
> >> >> >> With an older version of libusb (can't tell you the version,
but
> > it's
> >> >
> >> >> > from
> >> >> >> 05 August 2006) the application works fine. Now I downloaded
the
> >> > newest
> >> >> >> version of libusb (not the filter-driver!) and created a new
> >> > inf-file.
> >> >> >> After installing the new driver the application does not work
any
> >> > more!
> >> >> >> The relevant code is:
> >> >> >> ---------------------------------------------------
> >> >> >> usb_init();
> >> >> >> usb_find_busses();
> >> >> >> usb_find_devices();
> >> >> >> for (m_bus = usb_get_busses(); m_bus; m_bus = m_bus->next)
> >> >> >> {
> >> >> >> struct usb_device *dev;
> >> >> >> for (dev = m_bus->devices; dev; dev = dev->next)
> >> >> >> {
> >> >> >> if (dev->descriptor.bDeviceClass == 0xff) //find for
> > vendor
> >> >> >> specific class
> >> >> >> {
> >> >> >> m_dev = usb_open(dev);
> >> >> >> if (m_dev)
> >> >> >> {
> >> >> >> if ((dev->descriptor.idVendor == USB_VENDOR) &&
> >> >> >> (dev->descriptor.idProduct == USB_PRODUCT))
> >> >> >> {
> >> >> >> int err;
> >> >> >> err = usb_set_configuration(m_dev, 1);
> >> >> >> if (err)
> >> >> >> {
> >> >> >> char* s= usb_strerror();
> >> >> >> m_strInitStatus = s;
> >> >> >> UpdateData(FALSE);
> >> >> >> return;
> >> >> >> }
> >> >> >> err = usb_claim_interface(m_dev, 0);
> >> >> >> if (err)
> >> >> >> {
> >> >> >> char* s= usb_strerror();
> >> >> >> m_strInitStatus = s;
> >> >> >> UpdateData(FALSE);
> >> >> >> return;
> >> >> >> }
> >> >> >> }
> >> >> >> }
> >> >> >> }
> >> >> >> }
> >> >> >> }
> >> >> >>
> >> >> >
> >> >>
> >> >
> >>
> >
>
------------------------------------------------------------------------------------
> >> >> >>
> >> >> >> With the new version of libusb the usb_set_configuration(...)
call
> >
> >> >> > returns
> >> >> >> with an error and tells me, that configuration 1 could not be
set
> >> >> > because
> >> >> >> the parameter is invalid...
> >> >> >> If I use the new libusb0.dll, the new libusb.lib and the OLD
> >> > libusb0.sys
> >> >> > the
> >> >> >> application works fine again.
> >> >> >>
> >> >> >> Can someone please tell me where I am going wrong?
> >> >> >> Thank you in advantage for your help
> >> >> >> --
> >> >> >> View this message in context:
http://www.nabble.com/application-
> >> >> >> works-with-older-libusb-win32-but-not-with-version-0.1.12.1-
> >> >> >> tf4770195.html#a13644735
> >> >> >> Sent from the LibUSB Dev - Win32 mailing list archive at
> > Nabble.com.
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >
> >> >
> >
-------------------------------------------------------------------------
> >> >> >> This SF.net email is sponsored by: Splunk Inc.
> >> >> >> Still grepping through log files to find problems? Stop.
> >> >> >> Now Search log events and configuration files using AJAX and a
> >> > browser.
> >> >> >> Download your FREE copy of Splunk now >> http://get.splunk.com/
> >> >> >> _______________________________________________
> >> >> >> Libusb-win32-devel mailing list
> >> >> >> Lib...@li...
> >> >> >> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >> >> >
> >> >> >
> >> >> >
> >> >
> >
-------------------------------------------------------------------------
> >> >> > This SF.net email is sponsored by: Splunk Inc.
> >> >> > Still grepping through log files to find problems? Stop.
> >> >> > Now Search log events and configuration files using AJAX and a
> >> > browser.
> >> >> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> >> >> > _______________________________________________
> >> >> > Libusb-win32-devel mailing list
> >> >> > Lib...@li...
> >> >> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context: http://www.nabble.com/application-
> >> >> works-with-older-libusb-win32-but-not-with-version-0.1.12.1-
> >> >> tf4770195.html#a13664629
> >> >> Sent from the LibUSB Dev - Win32 mailing list archive at
Nabble.com.
> >> >>
> >> >>
> >> >>
> >> >
> >
-------------------------------------------------------------------------
> >> >> This SF.net email is sponsored by: Splunk Inc.
> >> >> Still grepping through log files to find problems? Stop.
> >> >> Now Search log events and configuration files using AJAX and a
> > browser.
> >> >> Download your FREE copy of Splunk now >> http://get.splunk.com/
> >> >> _______________________________________________
> >> >> Libusb-win32-devel mailing list
> >> >> Lib...@li...
> >> >> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >> >
> >> >
> >> >
> >
-------------------------------------------------------------------------
> >> > This SF.net email is sponsored by: Splunk Inc.
> >> > Still grepping through log files to find problems? Stop.
> >> > Now Search log events and configuration files using AJAX and a
> > browser.
> >> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> >> > _______________________________________________
> >> > Libusb-win32-devel mailing list
> >> > Lib...@li...
> >> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >> >
> >> >
> >>
> >> --
> >> View this message in context: http://www.nabble.com/application-
> >> works-with-older-libusb-win32-but-not-with-version-0.1.12.1-
> >> tf4770195.html#a13665547
> >> Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.
> >>
> >>
> >>
> >
-------------------------------------------------------------------------
> >> This SF.net email is sponsored by: Splunk Inc.
> >> Still grepping through log files to find problems? Stop.
> >> Now Search log events and configuration files using AJAX and a
browser.
> >> Download your FREE copy of Splunk now >> http://get.splunk.com/
> >> _______________________________________________
> >> Libusb-win32-devel mailing list
> >> Lib...@li...
> >> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
> >
-------------------------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems? Stop.
> > Now Search log events and configuration files using AJAX and a
browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Lib...@li...
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
>
> --
> View this message in context: http://www.nabble.com/application-
> works-with-older-libusb-win32-but-not-with-version-0.1.12.1-
> tf4770195.html#a13665771
> Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.
>
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
|