Question

I tried to implement a USB device. There was an example code which implements a HID. I changed the configuration descriptor and the device disappeared from devices ( lsusb ) I have no idea what went wrong, because I made it according to CDC documentation. Here is he configuration descriptor:

static unsigned char ConfigDescr[]= // CONFIGURATION Descriptor
{
    0x09,       // bLength
    0x02,       // bDescriptorType = Config
    0x43,0x00,  // wTotalLength(L/H) = 67 bytes
    0x02,       // bNumInterfaces
    0x01,       // bConfigValue
    0x00,       // iConfiguration
    0xE0,       // bmAttributes. b7=1 b6=self-powered b5=RWU supported
    0x01,       // MaxPower is 2 ma
// INTERFACE Descriptor
    0x09,       // length = 9
    0x04,       // type = IF
    0x00,       // IF #0
    0x00,       // bAlternate Setting
    0x01,       // bNum Endpoints
    0x02,       // bInterfaceClass = Communucations
    0x02,0x01,  // bInterfaceSubClass=Abstract (modem), bInterfaceProtocol=AT-commands (v.25ter)
    0x00,       // iInterface
// CDC header
    0x05,           // bFunctionLength = 5
    0x24,           // bDescriptorType = CS_INTERFACE 24h
    0x00,           // bDescriptorSubtype = Header Functional Descriptor
    0x10, 0x01,     // bcdCDC
// CDC Call Management
    0x05,           // bFunctionLength = 5
    0x24,           // bDescriptorType = CS_INTERFACE 24h
    0x01,           // bDescriptorSubtype = Call Management
    0x00,           // bmCapabilities = 0x00
    0x01,           // bDataInterface
// CDC Abstract Control Model
    0x04,           // bFunctionLength = 4
    0x24,           // bDescriptorType = CS_INTERFACE 24h
    0x02,           // bDescriptorSubtype = ACM
    0x02,           // bmCapabilities = 0x02
// CDC Union
    0x05,           // bFunctionLength = 5
    0x24,           // bDescriptorType = CS_INTERFACE 24h
    0x06,           // bDescriptorSubtype = Union Functional Descriptor
    0x00,           // bMasterInterface
    0x01,           // bSlaveInterface
//Endpoint Descriptor
    0x07,       // bLength = 7
    0x05,       // bDescriptorType (Endpoint)
    0x83,       // bEndpointAddress (EP3-IN)
    0x03,       // bmAttributes (interrupt)
    8,0,           // wMaxPacketSize (8)  // 8
    255,        // bInterval (poll every 10 msec)
// Interface Descriptor
    0x09,       // length = 9
    0x04,       // type = IF
    0x01,       // IF #1
    0x00,       // bAlternate Setting
    0x02,       // bNum Endpoints
    0x0a,       // bInterfaceClass = CDC Data interface
    0x00,0x00,  // bInterfaceSubClass=unused, bInterfaceProtocol=no protocol needed
    0x00,       // iInterface
// Endpoint Descriptor
    0x07,       // bLength
    0x05,       // bDescriptorType (Endpoint)
    0x01,       // bEndpointAddress (EP1-OUT)
    0x02,       // bmAttributes (bulk)
    64,0,           // wMaxPacketSize (64)
    0,      // bInterval
// Endpoint Descriptor
    0x07,       // bLength
    0x05,       // bDescriptorType (Endpoint)
    0x81,       // bEndpointAddress (EP1-IN)
    0x02,       // bmAttributes (bulk)
    64,0,           // wMaxPacketSize (64)
    0};     // bInterval
Was it helpful?

Solution

Finally, I have got the new USB library from the manufacturer, because there was an old code. That solves my problem, so I close this question. Thank you for your help!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top