This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using WINUSB, without an INF file!

So you've got a TI platform (ARM, DSP, OMAP, etc. -- hereafter "USB device") that you want to communicate with a Windows application. You're writing both ends of that application -- the TI-side, and the Windows-side -- but you want it to communicate through the USB link.  How to?

The Microsoft WINUSB API is a great way to make that easier.  No need to write user-mode or kernel mode drivers. Your Windows-side application can communicate with the USB device through this clean, supported, documented API interface.  Tasty! 

Until recently, that solution was made needlessly complicated by the requirement for an INF file and surrounding minutiae.  You had to create an INF file (".inf") to precise specifications (with a GUID inside it), and it must be specially "signed" (through some cryptic process), and include two different co-installer executables, and put it all inside a "driver package".  Then you had to actually install it successfully.  This was even more complicated if someone else -- say, a customer -- was doing the installing.  You had to e-x-p-l-a-i-n it to them.  Ugh!  Lots of inconvenience, and lots of room for failure.

Well, now there's a way to do it all auto-magically, without an INF file.  Just plug-in your USB connection, and it works.  Plug-and-Play.  And it works on all Microsoft operating systems going back to XP.  (And all the necessary Windows components will be installed automatically, simply by enabling your Windows Driver Updates!)

That's all fabulous!  I can see the future!

All this tasty goodness requires just one,  more,  thing: An update to the TI USB Starterware, to make it speak Microsoft.  I've been examining the Microsoft requirements, and it looks pretty straightforward to make the changes to TI Starterware. 

It requires creating three simple packed data structures:   

  1. The first basically says, "I know the secret Microsoft protocol, therefore I get to play the game!"  (It is 18 bytes long, and unchanging. It will be the same on every USB device.)  
  2. The second basically says, "I want to communicate through the WINUSB API interface." (It is 40 bytes long, and unchanging. It will be the same on every USB device that wants to use the WINUSB API.)  
  3. The third includes the GUID.  (It is 142 bytes, and once you set it up for a particular application, it is unchanging. Except for the GUID, it will be the same on every USB device.)

The GUID is a long string of (random) numbers, that Windows uses to figure out which application to connect the USB device to. A GUID is created easily using a tool in MS Visual Studio.  Previously, the GUID was held in the INF file, but that file is no longer needed, by using the new solution.  Since the USB device and the Windows-side application both will contain the same GUID, they each communicate it to Windows, which then connects them together -- without an INF file.

I've created those three packed data structures in CCS.  Now it's onward to updating the TI Starterware.  The change is simple in concept:  When the Windows host asks for these data structures, the USB device should send them -- just like it sends other similar data packets.  It's that straightforward.  MS has a unique command-byte that "asks" for them, but it's simple to catch that, and then respond with the proper data structure. Microsoft has done a good job of melding their protocol into the USB standard, so the changes are seamless, easy, and invisible to all the lower layers of USB handling.

Before I get into details, I want to ask:  Is anyone here (a TI employee, or a TI customer) working on this?  Are there plans for this?  (Should I wait for TI to do it? -- it might take years.....)

-- Walter

P.S.  The Microsoft protocol allows for some additional options, such as dealing with power issues:  selective power-down, and remote-wakeup.  But those are unnecessary for most TI customer applications.  Rather, the central benefit of this approach is to get rid of that darned INF file.

  • The Microsoft USB OS Descriptors are invisible to the usual USB protocol. That is, it does no harm whatever to other existing USB devices or USB systems, yet it allows us to avoid using an .inf file, as well as various other advantages. 

    I gather (from the lack of response?) that TI has no interest in supporting the Microsoft USB OS Descriptors. May I ask why? 

    1. Firstly, I want to know whether I would be wasting my time implementing it myself?  (Actually, I've implemented it already, though haven't fully tested it. But would I be wasting further time pursuing it?)
    2. Secondly, unknown to me, perhaps there is some alternative protocol (say, from the USB Implementers Forum , or USB-IF), which will someday (eventually?) make the Microsoft extensions obsolete?  (If there is such a thing on the horizon, I am unaware of it.)  Or does TI view the Microsoft protocol as "illegal" in some sense, since it did not come from the USB-IF? 

    I'm interested in your thoughts on the matter.

    -- Walter

     

  • Hi Walter,

    USB spec provides means for all USB devices to report its descriptors thus describing its functionality and capability . It is upto the host to kick start the necessary driver and on Windows based host machines the VID/PID combo is used to search for a driver.

    Through the use of Microsoft OS string descriptors ( offset 0xEE) Microsoft kicks off the Class driver without the VID/ PID information  ( this is my guess ) thus providing support to a larger number of devices.  

    Currently TI has no plans for supporting the same in StarterWare devices as

    • we feel the need to absolve ourselves from any OS dependent feature 
    • It is straight forward to implement Microsoft OS string descriptors support
    Regards
    Vineeth
  • Vineeth,

    Thank you for your reply, and please forgive me for requesting further clarification.

    The Microsoft USB protocol extension still queries and uses the VID/PID, and kicks off the Class driver without requiring an .inf file and associated troubles.  That offers a significant advantage to your customers, who want to connect TI components to their customer's computers, and in many cases, that currently requires that an unknown, unwary customer install the .inf file and driver package (a complexity elaborated in my opening post).  Your customers must explain to their customers how to install the .inf file and associated driver package.  This is all a needless complication, and can be avoided by using the Microsoft OS descriptors. 

    These descriptors provide the GUID (Globally Universal ID) -- direct from the USB device to the PC host. Thus bypassing -- and making unnecessary -- the .inf file, which previously held the GUID. 

    You say TI will not support this technology because "It is straight forward to implement Microsoft OS string descriptors support".  Yes, but it is not trivial. It requires digging into the bowels of the TI Starterware, and some serious work, I can testify.  Yet TI knows their own Starterware far better than anybody else.  Say, one-hundred TI customers want to avoid the complications of the .inf file (by using the Microsoft OS descriptors).  Are you saying TI will, in effect, thumb-their-nose at their customers, and expect one-hundred customers individually go make the changes to the TI Starterware?  Why wouldn't TI gladly solve the matter once-and-for-all -- thereby adding value to the TI line of products?  You acknowledge the solution is straightforward, so why doesn't TI do it?  I am baffled by your response. Surely you cannot mean that. 

    You say TI "feels the need to absolve themselves from any OS dependent feature."  Can you elaborate further?  Because that statement suggests TI doesn't understand the technology it is rejecting. 

    • If this technology were built into TI Starterware, then TI customers could freely use it, or not, by their choice.  They are not required to use it.  They are not "dependent" on using it.
    • Or are you suggesting Microsoft might not support their published spec? (Even though it works on systems from XP to Windows8.)  Are you suggesting it's hazardous to become "dependent" on a Microsoft feature?  Those are not serious concerns.
    • In either case, becoming "dependent" is not a problem.

    One thing is clear to me: The USB .inf file is going the way of the dinosaur.  And the Microsoft USB enhancement makes that happen.  I could understand the TI reluctance, if TI knows a better way. Do you know a better way? 

    Again, please forgive me for requesting more clarification.

    And thank you for your help.

    -- Walter

     

  • Walter,

    In principle, I agree with you, and thanks for bringing it to our notice. I think we do need to ensure effective plug-and-play with host PCs (Linux & Microsoft) when the TI processor is a USB device.

    The concern from our side is currently the usual one - resource constraints to implement it at this time. However, we will definitely add it to our to-do list and work on it when we have some free time. If you are planning to implement any part of it, we would be happy to pull it in and integrate it into StarterWare so that it becomes part of the standard product.

    Regards,
    Mugdha

  • I for one would very much welcome such an addition. I am currently trying to implement a composite device where one of the endpoints exposes a MS OS Descriptor, while the others do not, and I am very surprised to hear that anyone thinks 'It is straight forward to implement Microsoft OS string descriptors support'. In fact, if anyone has any sample code to offer which shows how to do this, I would very much appreciate it.
  • Hi Walter,

    it is a very difficult (to impossible) process to get some bugfixes or feature enhancements into the official StarterWare package - that's why some people created a free version: https://sourceforge.net/projects/starterwarefree 

    Just at this moment this free package contains much more bugfixes and feature enhancements than the official package - and I would bet the official package will never see most of the enhancements.

    So why don't you contribute your changes to this code repository?