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.

TM4C123GE6PM: Can USB driverlib handle 0xEE Microsoft OS descriptors?

Part Number: TM4C123GE6PM

Hello,

I am trying to autoload winusb on my TM4C part using the approach linked below:

https://github.com/pbatard/libwdi/wiki/WCID-Devices

I'm wondering if TI's driverlib can support servicing the 0xEE descriptor requests from the operating system.  Does anyone know if this is possible?  When looking at the bulk USB example in TI's driver library I see the following with no where to place the appropriate "Microsoft OS string descriptors".  See code below taken from usb_bulk_structs.c in the example bulk usb project.

//*****************************************************************************
//
// The descriptor string table.
//
//*****************************************************************************
const uint8_t * const g_ppui8StringDescriptors[] =
{
    g_pui8LangDescriptor,
    g_pui8ManufacturerString,
    g_pui8ProductString,
    g_pui8SerialNumberString,
    g_pui8DataInterfaceString,
    g_pui8ConfigString
};

#define NUM_STRING_DESCRIPTORS (sizeof(g_ppui8StringDescriptors) /                \
                                sizeof(uint8_t *))

I've seen elsewhere that a string can be placed at the offset 0xEE, but I don't see the option to associate the 0xEE id windows uses with a particular string.  Does anyone know what I'm missing regarding the use of the driver library to handle this?

Thanks

  • Hi Robert,

      The additional String Descriptor located at index 0xEEis not mandated by the USB specifications. It is an OS String Descriptor specific to MS Windows only. I suppose during enumeration the host will send GET_DESCRIPTOR request for the string descriptor with the index of 0xEE. When the device receives this request, it will provide the OS String Descriptor in the format as defined by Microsoft. TivaWare USB library does not support such string descriptor extension but you are free to modify the library to adapt for your application.  

      

  • Would you happen to have a recommended approach to modifying the driverlib to handle this?  For example, maybe adding a callback somewhere to handle descriptors outside of the expected standard ones?

    As an example usbdenum.c has the following functions that seem to handle enumeration, would a mod to one of these make sense?

    static void USBDGetStatus(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDClearFeature(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDSetFeature(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDSetAddress(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDGetDescriptor(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDSetDescriptor(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDGetConfiguration(void *pvInstance,
                                     tUSBRequest *psUSBRequest);
    static void USBDSetConfiguration(void *pvInstance,
                                     tUSBRequest *psUSBRequest);
    static void USBDGetInterface(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDSetInterface(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDSyncFrame(void *pvInstance, tUSBRequest *psUSBRequest);
    static void USBDEP0StateTx(uint32_t ui32Index);
    static void USBDEP0StateTxConfig(uint32_t ui32Index);
    static int32_t USBDStringIndexFromRequest(uint16_t ui16Lang,
                                              uint16_t ui16Index);

  • Hey Charles,

    The usb driver lib has a "tCustomeHandlers" structure that (I think) allows the user to add handler functions for stuff that the driverlib doesn't handle.  There is a customer handler spot for string descriptors.  Is this TI's intention for tCustomHandlers?  It seems like it but isn't completely clear in the documentation.

    Info on this can be found in the USB driverlib guide in sections 2.23.2 and 2.24.1.4

  • Hi Robert,

      You can modify it and see if are able to extend for MS string descriptor. Let us know the result and I'm sure it will benefit others who may need to support this non-mandated USB feature.