Hi folks,
Curious problem I am having during the enumeration of a device plugged into a windows 7 USB 3.0 port.
I am using an old (2012) Freescale USB stack for an HID device which has been performing fine in a product for over 6 months.
It now crashes if the device is plugged into a Windows 7 USB 3.0 port. Everything is fine on a USB 2 port.
It is crashing during the get string descriptor as windows sending a language ID of 0xFFFF. The stack does not support this language ID and leaves the index beyond the string array (I cannot see how this stack could ever work under these conditions!)
case USB_STRING_DESCRIPTOR:
{
if(index == 0)
{
/* return the string and size of all languages */
*descriptor = (uint_8_ptr)g_languages.
languages_supported_string;
*size = g_languages.languages_supported_size;
}
else
{
uint_8 lang_id = 0;
uint_8 lang_index = USB_MAX_LANGUAGES_SUPPORTED;
for(;lang_id < USB_MAX_LANGUAGES_SUPPORTED; lang_id++)
{
/* check whether we have a string for this language
*/
if(index ==
g_languages.usb_language[lang_id].language_id)
{
/* check for max descriptors */
if(str_num < USB_MAX_STRING_DESCRIPTORS)
{
/* setup index for the string to be
returned */
lang_index = str_num;
}
break;
}
}
/* set return val for descriptor and size */
*descriptor =
(uint_8_ptr)g_languages.usb_language[lang_id].
lang_desc[lang_index];
*size = g_languages.usb_language[lang_id].
lang_desc_size[lang_index];
}
}
break;