hi I am working on a HID_Device this is my USB_DeviceDescriptor
const BYTE USB_DeviceDescriptor[] = { USB_DEVICE_DESC_SIZE, /* bLength */ USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */ WBVAL(0x0110), /* 1.10 */ /* bcdUSB */ 0x00, /* bDeviceClass */ 0x00, /* bDeviceSubClass */ 0x00, /* bDeviceProtocol */ USB_MAX_PACKET0, /* bMaxPacketSize0 */ WBVAL(0xA5C8), /* idVendor */ WBVAL(0x526A), /* idProduct */ WBVAL(0x0100), /* 1.00 */ /* bcdDevice */ 0x04, /* iManufacturer */ 0x20, /* iProduct */ 0x42, /* iSerialNumber */ 0x01 /* bNumConfigurations */ };
And This is My USB_StringDescriptor:
/* USB String Descriptor (optional) */ BYTE USB_StringDescriptor[] = { /* Index 0x00: LANGID Codes */ 0x04, /* bLength */ USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */ WBVAL(0x0409), /* US English */ /* wLANGID */ /* Index 0x04: Manufacturer */ 0x1C, /* bLength */ USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */ 'M',0, 'A',0, 'N',0, 'S',0, 'H',0, 'O',0, 'O',0, 'R',0, 'S',0, 'I',0, 'M',0, 'I',0, 'N',0, /* Index 0x20: Product */ 0x22, /* bLength */ USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */ 'M',0, '.',0, 'S',0, '.',0, 'L',0, 'O',0, 'C',0, 'K',0, 'V',0, '4',0, '.',0, '1',0, ' ',0, '0',0, '0',0, '0',0, /* Index 0x42: Serial Number */ 0x1A, /* bLength */ USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */ 'V',0, 'E',0, 'R',0, ' ',0, ' ',0, '.',0, '1',0, '.',0, '0',0, '0',0, ' ',0, ' ',0, /* Index 0x5C: Interface 0, Alternate Setting 0 */ 0x08, /* bLength */ USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */ 'H',0, 'I',0, 'D',0, };
but I can not get My Specifications from my HID! please show me , where is my mistake!
Well 2 obvious mistakes are that you have not encoded strings in unicode (2 bytes per character), second obvious mistake is that in device descriptor iManufacturer, iProduct and iSerialNumber are not offset of string from first character but are index of string descriptor inside your whole array of string descriptors so in your case, 1, 2 and 3.
And last obvious mistake is you did not study USB Specification enough :-)
Sorry, I missed that you do have unicode encoding, then only wrong things are indexes, but I suppose your problem is in your configuration descriptor which you haven't specified here.
thank you for your Attention. Yes,you are right,I have no study in USB Specification. This is my First project in ARM. I Can Not Found Any Source About USB Specification in ARM:-( and I am in trial and error!
View all questions in Keil forum