Task Tracker - Custom USB device with WinUSB and no INF file required to install

I just posted Custom USB device with WinUSB and no INF file required to install on Task Tracker. Feel free to discuss and make suggestions here.

See this link for the details on WinUSB without a INF file.
[url]http://blogs.msdn.com/b/usbcoreblog/archive/2012/09/26/how-to-install-winusb-sys-without-a-custom-inf.aspx[/url]

The code to test this issues is based on the following Codeshare link.
[url]https://www.ghielectronics.com/community/codeshare/entry/859[/url]

If there is interest in this feature please vote on this issue and join the discussion.
[url]https://www.ghielectronics.com/tracker/entry/197[/url]

Here is what I have found so far, with the Microsoft USB client. Some of these issues have already been posted to the codeshare link.

  • The end point buffer size fails when set to 8 bytes, currently I am using 64.

- A test if the USB stream supports timeouts.
 
```cs

if (_usbStream.CanTimeout)
{
     _usbStream.ReadTimeout = 60000;
    _usbStream.WriteTimeout = 60000;
}
  • Very often the serial port debugging crashes the NETMF controller, at or around the statement, a bit of a workaround is to reset the NETMF board, and just monitor the debug statements.

 // Set the configuration
usbController.Configuration = configuration;
  • Setting the USB version greater then 0x200 to enables the Binary device Object Store (BOS) descriptor query. This is a show stopper, with USB bus stall condition.

 device.bcdUSB = 0x0210;

The GHI Electronics USB client also has the show stopper issue, the Version property is readonly in the RawDevice object and set to 0x0110.

More on features in the next post.

Some of the features to make this useful in a production setting would be to set the following parameters:
USB Device Descriptor, Vendor ID, Product ID, Product Revision, and serial number, possibly some of the other strings, like manufacture name, product name, display name, and friendly name.

The extended OS descriptors, add a parameter for DeviceInterface GUID.

That’s what I have determined so far, to be really useful.

Bus stall screen capture:

@ PHITEK - To summarize, you are asking for support for 8 byte packet sizes, support for USB version 2, a CanTimeout flag on USB streams, and increased reliability of usbController.Configuration?

@ John - Yes the goal is to readily support WinUSB with out the needed for a Microsoft signed INF file. I would also like at least two end points, bulk and interrupt supported.

To me this would be a more ideal interface then the CDC serial port approach.

I would help debug this in anyway I can, I could even loan you my USB analyzer if that helps.

I would guess it could help GHI Electronics as well, as you could replace GHI_NETMF_Interface with this approach, and even assign a unique GUID to each device or family of devices. The biggest draw back is some microcontroller vendors do not supply a USB Product ID for low volume production. Sadly USB.ORG does not allow this type of USB Vendor ID allocation / usage to vendors any longer.

Thanks for your consideration on this issue.

@ John - usbController.Configuration issue, typically set a break point on this statement and single step, often inspecting some of the descriptors, it will some times initialize and I have full debugging, if the USB controller does not return from single stepping, I reset the device and can at least see the debug output statements.

There doesn’t seem to be one way that works all the time.

@ PHITEK - For the bug you seem to be encountering with setting Configuration, I would start a separate thread so we can look into that one with more detail.

@ John - Ok will do, I see if I can get some smaller code fragment to fail as well, one that assumes the USB controller is present, and stopped. Will work on it this evening.

Custom USB device with WinUSB and no INF file required to install was updated.

Status went from Proposed to Closed.

Posting simple replies to get your points up and then posting SPAM will get your account deleted. Idiot.

2 Likes