Author Topic: USB HID problem in Windows 7  (Read 22981 times)

jhl_iv

  • Member
  • ***
  • Posts: 5
USB HID problem in Windows 7
« on: April 02, 2012, 03:28:26 pm »
I have a handful of devices (PIC 2550 & 4550) that have been working for years on Windows XP through a hub and now we are upgrading to Windows 7 and one of the devices isn't working.
Windows 7 states that the device needs troubleshooting. I can see it with USBTrace, and I see it enumerated in the registry under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HidUsb\Enum


But the software can't open it, shouldn't the call to FindDeviceFromGuid with the HidGuid find this? The DevicePathName list doesn't contain the device in question?

Help!!

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB HID problem in Windows 7
« Reply #1 on: April 02, 2012, 05:25:10 pm »
A hardware protocol analyzer will show what is happening on the bus.

What do you mean by "the software can't open it"? What software, what line of code, and what error code or other result are you seeing?

Jan

jhl_iv

  • Member
  • ***
  • Posts: 5
Re: USB HID problem in Windows 7
« Reply #2 on: April 02, 2012, 05:45:50 pm »
I'll get out my beagle and get it all setup to sniff.
The software is using the Win32 calls that you have posted to open (createfile) and read from the device.


But basically the snippet (not a complete for loop) is:
begin snippet
/////////////////////////////////////////////////////////////////////////////
 DeviceFound = _MyDeviceManagement.FindDeviceFromGuid(HidGuid, ref DevicePathName);


for (int i = 0; i < 128; i++)
            {
                if (DevicePathName != null)
                {
// the problem is that DevicePathName does not contain the device's path in it
                    if (DevicePathName.Contains(panelVidPid))
                    {
                        // found it now open it!
                            _HIDHandle = FileIOApiDeclarations.CreateFile
                                                                 (DevicePathName,
                                                                  FileIOApiDeclarations.GENERIC_READ | FileIOApiDeclarations.GENERIC_WRITE,
                                                                  FileIOApiDeclarations.FILE_SHARE_READ | FileIOApiDeclarations.FILE_SHARE_WRITE,
                                                                  ref Security,
                                                                  FileIOApiDeclarations.OPEN_EXISTING,
                                                                  0,
                                                                  0);
/////////////////////////////////////////////////////////////////////////////
end snippet

It is stating in Device Status: This device cannot start. (Code 10)

Thanks,
John

jhl_iv

  • Member
  • ***
  • Posts: 5
Re: USB HID problem in Windows 7
« Reply #3 on: April 02, 2012, 06:08:37 pm »
In the Total Phase Data center it appears to keep trying the Setup (12 times) and ends up Suspending.
There are a whole bunch of NAKs.
I've got 3 Invalid PID Sequences (EP 0 CTRL) and 1 Timeout in the errors section.

I am just baffled as this device has been working for years under Windows XP with the same type of hardware (PC, USB Hub, Device, cables,  etc.).

John

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB HID problem in Windows 7
« Reply #4 on: April 02, 2012, 09:55:12 pm »
All USB hosts don't have to behave identically. They just have to comply with the USB specs.

You need to identify the control request that is failing and where it is failing, then fix it in the device firmware. For example, endpoint 0 must ACK all Setup packets. If it's returning NAK, you need to fix that.

Jan

jhl_iv

  • Member
  • ***
  • Posts: 5
Re: USB HID problem in Windows 7
« Reply #5 on: April 03, 2012, 09:00:32 am »
Could that mean the MS made Windows 7 more compliant and that Windows XP was less compliant which is why this has worked for years under XP?

I am using your book and following my tdc files with a fine tooth comb, I'll figure it out, just thought I would ask the guru if she's run into this situation before.


Thanks!

John

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB HID problem in Windows 7
« Reply #6 on: April 03, 2012, 12:10:56 pm »
If the computers are different (in other words, you're not using the same PCs upgraded from WinXP), it can be the host-controller hardware that differs.

All USB hosts don't have to behave identically. They just have to comply with the USB specs.

The piece that isn't compliant is likely your device.

Jan

jhl_iv

  • Member
  • ***
  • Posts: 5
Re: USB HID problem in Windows 7
« Reply #7 on: April 03, 2012, 02:51:16 pm »
They are the exact same pieces of hardware (ASUS motherboards). What I meant was perhaps my device isn't compliant, but XP was more forgiving than Windows 7.

Some new information, my device works fine through an optically isolated hub, but not through the hubs we ship with. It also works fine when plugged straight into the computer USB port.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB HID problem in Windows 7
« Reply #8 on: April 03, 2012, 03:04:42 pm »
Yes, the host driver can be forgiving of errors or it the errors might not occur if the host does things differently.

In any case, the solution is to see what is happening on the bus and go from there.

Jan