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!
Unfortunately, you will have to learn enough of USB to be able to make use of things you want to achieve.
For example, in your configuration size you have size calculated by using USB_ENDPOINT_DESC_SIZE*2 but in your configuration you only have one endpoint specified and that is bulk in.
There are two major options you have, 1-st is to take a product like Keil middleware which will help you to achieve your goal without deep understanding of the USB itself, and 2-nd is to study USB thoroughly and put all of the necessary pieces together.
Your chosen option with trial and error is very problematic here as little inconsistencies in implementation can bring to not working device or device crashing during runtime.
Dear Milorad. Thank you So Much For Your Guidance.
Good Luck.