Author Topic: Windows 7 USB low speed device problems  (Read 21009 times)

jdunne

  • Member
  • ***
  • Posts: 26
Windows 7 USB low speed device problems
« on: April 11, 2011, 10:47:46 am »
Hello,

I created a modified version of Microchip's USB HID bootloader a few years back.  The HID bootloader used Interrupt transfer with 64 byte IN and OUT pipes very similarly to Microchip's present HID bootloader.  The only problem is I configured my device for USB LOW speed.  According to the USB spec, low speed devices cannot have an interrupt pipe larger than 8 bytes.  I am well aware of this restriction now (though I wasn't when I originally wrote the bootloader).  Windows XP and 2000 had no problems with me unknowingly violating the spec.  The bootloader cannot be changed.  The unit utilizes an EXTERNAL USB pullup resistor on the D- pin, so it is unfortunately stuck with USB low speed.  The only way to work around this issue is to use a driver of some kind to force the unit to enumerate and communicate despite the USB spec violation.

Now that Windows 7 has been around for a while we tested our bootloader on it a few months back.  I have since rewritten the bootloader to work around this issue by using control transfer, so I have no issue with newly produced units.  Anyway, I have a large number of units in the field that need a firmware upgrade, and Windows 7 will not allow the device to enumerate.

I have tried 2 separate approaches so far to solve this issue, with no success with either.  I created an inf file to load WinUSB and updated my PC application to work with the WinUSB library.  Everything worked just fine on my Windows XP machine, but when I tried moving over to the Windows 7 machine the device wouldn't enumerate.  I can only guess that WinUSB is imposing the same restriction that the standard HID driver is that a low speed USB device cannot have interrupt pipes larger than 8 bytes.

I also tried LibUSB.  LibUSB allowed the device to enumerate on Windows 7, so, again I updated my PC application to work with LibUSB.  Again, everything worked fine in Windows XP.  I moved over to Windows 7 and as soon as I attempt to write to the device, I get a Win32 exception saying PipeTransferSubmit saying "parameter not correct."  I'm thinking this also has to do with the Interrupt transfer limitation.

So, now I find myself stuck.  I'll be spending part of my day setting up Windows XP mode and attempting to get the device to work through that.  Setting up Windows XP mode is relatively simple, but for users who are just trying to do a firmware update on their device its a bit excessive to ask.  Having some idea of how it works, I am hopeful that it will work, but even if it does, it is an imperfect solution.  (Also it isn't available on Windows 7 Starter).

Does anyone know of a driver setup that would enable me to bypass this limitation?  Or did I do something wrong with the 2 approaches I already tried?

Joe

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Windows 7 USB low speed device problems
« Reply #1 on: April 11, 2011, 11:57:52 am »
I don't know of a solution other than having the devices shipped back to you to upgrade.

It's not a limitation of the HID driver, it's a limitation of the USB spec. The reason is to force devices that need more bandwidth to use a higher speed so they don't hog the bus with large amounts of low-speed traffic.

Jan

jdunne

  • Member
  • ***
  • Posts: 26
Re: Windows 7 USB low speed device problems
« Reply #2 on: April 11, 2011, 12:28:57 pm »
I don't know of a solution other than having the devices shipped back to you to upgrade.

It's not a limitation of the HID driver, it's a limitation of the USB spec. The reason is to force devices that need more bandwidth to use a higher speed so they don't hog the bus with large amounts of low-speed traffic.

Jan

Thanks anyway Jan.  By the way, I tried Windows XP mode and of course, Windows XP mode doesn't allow HID devices to be connected to it.  Oy vey. 

Joe

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Windows 7 USB low speed device problems
« Reply #3 on: April 11, 2011, 12:47:37 pm »
It's a shame that Windows was forgiving on this for so long, allowing issues like this to lie undiscovered.

Jan

jcddcjjcd

  • Member
  • ***
  • Posts: 14
Re: Windows 7 USB low speed device problems
« Reply #4 on: April 13, 2011, 11:51:37 pm »
Joe.
It appears there is no easy way.
What about supplying end users with a boot cd with a minimal Linux system and then compile your Application with Mono.
Possibly a lot of work?
Regards,
John.

jcddcjjcd

  • Member
  • ***
  • Posts: 14
Re: Windows 7 USB low speed device problems
« Reply #5 on: April 14, 2011, 03:28:51 am »
Joe.
If you want to go down the path I proposed I have located a linux LiveCD that runs off the CD and doesn't require intallation.
My thinking here is that once booted it will find you bootloader firmware and you will run your Bootloader application as you would on XP.
It has mono and C# support built in. You can find it at:
http://www.ibiblio.org/onebase/onebaselinux.com/About/features/developgo.php
Regards,
John.

jdunne

  • Member
  • ***
  • Posts: 26
Re: Windows 7 USB low speed device problems
« Reply #6 on: April 14, 2011, 10:58:23 am »
Thanks for the input John.

Unfortunately we've conceded defeat and recalled the units in question for rework at the factory.  I posted this question on the MSDN forums and even they told me I was screwed.
http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/792eaf3f-b5f0-4738-b0ea-1a5c689e8b22

Joe