Re: SetAltInterface() error 31

Xiaofan Chen <[email protected]>
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAGjSPUCm+KmNHfRtK687yOsbwczcjWUJ5K7Di=8WWbScVMf-HQ@mail.gmail.com>
On Sun, May 4, 2014 at 9:15 PM, Johny Gudlik <[email protected]> wrote:
>
> Hello,
> I have problem with USB on SAM3S2C (user board) configured as USB device
> Vendor Class (it is my first project with USB). I can't set alternate
> setting to 1 of the interface 0. Device is opened successfully, but I get
> error in function  SetAltInterface() - 31 (0x1F)  (ERROR_GEN_FAILURE  A
> device attached to the system is not functioning).
>
> I'm using libusbK 3.0.7.0., Windows 7.
> USB: 2.0, Full speed
>
> What am I doing wrong?

This could be a FW bug. Have you check your firmware codes to
see if you are handling the set alternative interface request
correctly?

You can also use the debug version of libusbK to install the
check version of the driver and then use DebugView to
capture the debug information and post it to this mailing
list.

Chk version of libusbK:
http://sourceforge.net/projects/libusbk/files/libusbK-release/3.0.7.0/
You can download libusbK-3.0.7.0-bin-chk.7z.

1) Unzip the archive
2) Run the chk version of the inf-wizard to replace the driver
with the device plug-in.
3) Plug-out your device
4) Run DebugView in admin mode and enable "Capture
Kernel" and "Enable Verbose Kernel Output".
5) Plug-in your device and then run your program
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
6) Post the message from DebugView.


-- 
Xiaofan

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.