cancel
Showing results for 
Search instead for 
Did you mean: 

USB emuneration fails sometimes, gives Code 10 error on Windows PC

Vandana
Associate

Hi, I have used STM32G0B1RE microcontroller which is configured as Custom HID Device using STM32CubeMX. I have changed the report descriptors to the following

__ALIGN_BEGIN static uint8_t CUSTOM_HID_ReportDesc_FS[USBD_CUSTOM_HID_REPORT_DESC_SIZE] __ALIGN_END =
{
  /* USER CODE BEGIN 0 */
0x06, 0xa0, 0xff,              // USAGE_PAGE (USB Control Panel Gen 2)
        0x09, 0xa5,                    // USAGE (Usage1)
        0xa1, 0x00,                    // COLLECTION (Physical)
        0x09, 0xa6,                    //   USAGE (Usage2)
        0x85, 0x01,                    //   REPORT_ID (1)
        0x09, 0xa7,                    //   USAGE (Usage3)
        0x15, 0x80,                    //   LOGICAL_MINIMUM (-128)
        0x25, 0x7f,                    //   LOGICAL_MAXIMUM (127)
        0x75, 0x08,                    //   REPORT_SIZE (8)
        0x95, 0x06,                    //   REPORT_COUNT (6)
        0x81, 0x02,                    //   INPUT (Data,Var,Abs)
        0x85, 0x02,                    //   REPORT_ID (2)
        0x09, 0xa7,                    //   USAGE (Usage3)
        0x15, 0x80,                    //   LOGICAL_MINIMUM (-128)
        0x25, 0x7f,                    //   LOGICAL_MAXIMUM (127)
        0x75, 0x08,                    //   REPORT_SIZE (8)
        0x95, 0x05,                    //   REPORT_COUNT (5)
        0x91, 0x02,                    //   OUTPUT (Data,Var,Abs)
  /* USER CODE END 0 */
  0xC0    /*     END_COLLECTION              */
};
 
1 REPLY 1

So Microsoft doesn't like, perhaps find something to validate or troubleshoot descriptors, and USB interactions?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..