??? 06/26/05 09:52 Read: times |
#95950 - USB Enumeration (descriptor) problem |
Hi,
I am developing the firmware for an AT89C5131 and have problems with the enumeration process. I took the example code from ATMEL Website (HID Keyboard example) and wanted to adjust this for my needs. I don't understand the CONF_LENGTH value in the configuration descriptor. According to the usb spec this is the sum of all the descriptors, that belong to one configuration. So I concluded that sizeof(struct USB_Config_Data) instead of CONF_LENGTH would work. But it doesn't. Instead CONF_LENGTH is defined as 0x2200 in another header file. But I counted just 93 Bytes at most that are stored in USB_Config_Data. struct USB_Config_Data { struct usb_st_configuration_descriptor cfg; struct usb_st_interface_descriptor ifc; struct usb_st_hid_descriptor hid ; struct usb_st_endpoint_descriptor ep1 ; unsigned char rep[SIZE_OF_REPORT] ; }; code struct USB_Config_Data usb_configuration = { { sizeof(struct usb_st_configuration_descriptor), CONFIGURATION, CONF_LENGTH, NB_INTERFACE, CONF_NB, CONF_INDEX, CONF_ATTRIBUTES, MAX_POWER}, { sizeof(struct usb_st_interface_descriptor), INTERFACE, INTERFACE_NB, ALTERNATE, NB_ENDPOINT, INTERFACE_CLASS, INTERFACE_SUB_CLASS, INTERFACE_PROTOCOL, INTERFACE_INDEX }, { 9, HID, 0x1101, 8, 1, REPORT, 0x3B00 }, { sizeof(struct usb_st_endpoint_descriptor), ENDPOINT, ENDPOINT_NB_1, EP_ATTRIBUTES_1, EP_SIZE_1, EP_INTERVAL_1 }, { 0x05,0x01, /* Usage Page (Generic Desktop) */ 0x09,0x06, /* Usage (Keyboard) */ ... } } I hope anybody can help me. Thank you in advance. Sebastian. |
Topic | Author | Date |
USB Enumeration (descriptor) problem | 01/01/70 00:00 | |
Not Quite![]() | 01/01/70 00:00 |