Hello,
Currently i am doing an USB2UART project. My COM1 flow is getting through.
But COM1 + COM2, I am facing a system hang problem. I had changed only desciptor tables. ( configuration descriptor - no.of interface for com1 only is 2. now com1 + com2 i have changed no.of.interface is 4) please help me regarding this issue
Thanks, Vasanth B
/************************ CDC 0 ***************************/ /* IAD */ 0x08, // bLength 0x0B, // bDescriptorType = 11 USB_CDC_CIF_NUM0, // bFirstInterface 0x02, // bInterfaceCount CDC_COMMUNICATION_INTERFACE_CLASS, // bFunctionClass (Communication Class) CDC_ABSTRACT_CONTROL_MODEL, // bFunctionSubClass (Abstract Control Model) 0x01, // bFunctionProcotol (V.25ter, Common AT commands) 0x00, // iInterface /* Interface 0, Alternate Setting 0, Communication class interface descriptor */ USB_INTERFACE_DESC_SIZE, /* bLength */ USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_CDC_CIF_NUM0, /* bInterfaceNumber: Number of Interface */ 0x00, /* bAlternateSetting: Alternate setting */ 0x01, /* bNumEndpoints: One endpoint used */ CDC_COMMUNICATION_INTERFACE_CLASS, /* bInterfaceClass: Communication Interface Class */ CDC_ABSTRACT_CONTROL_MODEL, /* bInterfaceSubClass: Abstract Control Model */ 0x01, /* bInterfaceProtocol: V.25ter, Common AT commands */ 0x00, /* iInterface: */ /*Header Functional Descriptor*/ 0x05, /* bLength: Endpoint Descriptor size */ CDC_CS_INTERFACE, /* bDescriptorType: CS_INTERFACE */ CDC_HEADER, /* bDescriptorSubtype: Header Func Desc */ WBVAL(CDC_V1_10), /* 1.10 */ /* bcdCDC */ /*Call Management Functional Descriptor*/ 0x05, /* bFunctionLength */ CDC_CS_INTERFACE, /* bDescriptorType: CS_INTERFACE */ CDC_CALL_MANAGEMENT, /* bDescriptorSubtype: Call Management Func Desc */ 0x01, /* bmCapabilities: device handles call management */ USB_CDC_DIF_NUM0, /* bDataInterface: CDC data IF ID */ /*Abstract Control Management Functional Descriptor*/ 0x04, /* bFunctionLength */ CDC_CS_INTERFACE, /* bDescriptorType: CS_INTERFACE */ CDC_ABSTRACT_CONTROL_MANAGEMENT, /* bDescriptorSubtype: Abstract Control Management desc */ 0x02, /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */ /*Union Functional Descriptor*/ 0x05, /* bFunctionLength */ CDC_CS_INTERFACE, /* bDescriptorType: CS_INTERFACE */ CDC_UNION, /* bDescriptorSubtype: Union func desc */ USB_CDC_CIF_NUM0, /* bMasterInterface: Communication class interface is master */ USB_CDC_DIF_NUM0, /* bSlaveInterface0: Data class interface is slave 0 */ /*Endpoint 1 Descriptor*/ /* event notification (optional) */ USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_IN(1), /* bEndpointAddress */ USB_ENDPOINT_TYPE_INTERRUPT, /* bmAttributes */ WBVAL(0x0010), /* wMaxPacketSize */ 0x02, /* 2ms */ /* bInterval */ /* Interface 1, Alternate Setting 0, Data class interface descriptor*/ USB_INTERFACE_DESC_SIZE, /* bLength */ USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_CDC_DIF_NUM0, /* bInterfaceNumber: Number of Interface */ 0x00, /* bAlternateSetting: no alternate setting */ 0x02, /* bNumEndpoints: two endpoints used */ CDC_DATA_INTERFACE_CLASS, /* bInterfaceClass: Data Interface Class */ 0x00, /* bInterfaceSubClass: no subclass available */ 0x00, /* bInterfaceProtocol: no protocol used */ 0x00, /* iInterface: */ /* Endpoint, EP2 Bulk Out */ USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_OUT(2), /* bEndpointAddress */ USB_ENDPOINT_TYPE_BULK, /* bmAttributes */ WBVAL(USB_CDC_BUFSIZE), /* wMaxPacketSize */ 0x00, /* bInterval: ignore for Bulk transfer */ /* Endpoint, EP2 Bulk In */ USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_IN(2), /* bEndpointAddress */ USB_ENDPOINT_TYPE_BULK, /* bmAttributes */ WBVAL(USB_CDC_BUFSIZE), /* wMaxPacketSize */ 0x00, /* bInterval: ignore for Bulk transfer */ // ------ continue to the next message -------
/************************ CDC 1 ***************************/ /* IAD */ 0x08, // bLength 0x0B, // bDescriptorType = 11 USB_CDC_CIF_NUM1, // bFirstInterface 0x02, // bInterfaceCount CDC_COMMUNICATION_INTERFACE_CLASS, // bFunctionClass (Communication Class) CDC_ABSTRACT_CONTROL_MODEL, // bFunctionSubClass (Abstract Control Model) 0x01, // bFunctionProcotol (V.25ter, Common AT commands) 0x00, // iInterface /* Interface 0, Alternate Setting 0, Communication class interface descriptor */ USB_INTERFACE_DESC_SIZE, /* bLength */ USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_CDC_CIF_NUM1, /* bInterfaceNumber: Number of Interface */ 0x00, /* bAlternateSetting: Alternate setting */ 0x01, /* bNumEndpoints: One endpoint used */ CDC_COMMUNICATION_INTERFACE_CLASS, /* bInterfaceClass: Communication Interface Class */ CDC_ABSTRACT_CONTROL_MODEL, /* bInterfaceSubClass: Abstract Control Model */ 0x01, /* bInterfaceProtocol: V.25ter, Common AT commands */ 0x00, /* iInterface: */ /*Header Functional Descriptor*/ 0x05, /* bLength: Endpoint Descriptor size */ CDC_CS_INTERFACE, /* bDescriptorType: CS_INTERFACE */ CDC_HEADER, /* bDescriptorSubtype: Header Func Desc */ WBVAL(CDC_V1_10), /* 1.10 */ /* bcdCDC */ /*Call Management Functional Descriptor*/ 0x05, /* bFunctionLength */ CDC_CS_INTERFACE, /* bDescriptorType: CS_INTERFACE */ CDC_CALL_MANAGEMENT, /* bDescriptorSubtype: Call Management Func Desc */ 0x01, /* bmCapabilities: device handles call management */ USB_CDC_DIF_NUM1, /* bDataInterface: CDC data IF ID */ /*Abstract Control Management Functional Descriptor*/ 0x04, /* bFunctionLength */ CDC_CS_INTERFACE, /* bDescriptorType: CS_INTERFACE */ CDC_ABSTRACT_CONTROL_MANAGEMENT, /* bDescriptorSubtype: Abstract Control Management desc */ 0x02, /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */ /*Union Functional Descriptor*/ 0x05, /* bFunctionLength */ CDC_CS_INTERFACE, /* bDescriptorType: CS_INTERFACE */ CDC_UNION, /* bDescriptorSubtype: Union func desc */ USB_CDC_CIF_NUM1, /* bMasterInterface: Communication class interface is master */ USB_CDC_DIF_NUM1, /* bSlaveInterface0: Data class interface is slave 0 */ /*Endpoint 1 Descriptor*/ /* event notification (optional) */ USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_IN(4), /* bEndpointAddress */ USB_ENDPOINT_TYPE_INTERRUPT, /* bmAttributes */ WBVAL(0x0010), /* wMaxPacketSize */ 0x02, /* 2ms */ /* bInterval */ /* Interface 1, Alternate Setting 0, Data class interface descriptor*/ USB_INTERFACE_DESC_SIZE, /* bLength */ USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_CDC_DIF_NUM1, /* bInterfaceNumber: Number of Interface */ 0x00, /* bAlternateSetting: no alternate setting */ 0x02, /* bNumEndpoints: two endpoints used */ CDC_DATA_INTERFACE_CLASS, /* bInterfaceClass: Data Interface Class */ 0x00, /* bInterfaceSubClass: no subclass available */ 0x00, /* bInterfaceProtocol: no protocol used */ 0x00, /* iInterface: */ /* Endpoint, EP2 Bulk Out */ USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_OUT(5), /* bEndpointAddress */ USB_ENDPOINT_TYPE_BULK, /* bmAttributes */ WBVAL(USB_CDC_BUFSIZE), /* wMaxPacketSize */ 0x00, /* bInterval: ignore for Bulk transfer */ /* Endpoint, EP2 Bulk In */ USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_IN(5), /* bEndpointAddress */ USB_ENDPOINT_TYPE_BULK, /* bmAttributes */ WBVAL(USB_CDC_BUFSIZE), /* wMaxPacketSize */ 0x00, /* bInterval: ignore for Bulk transfer */ // // cut off CDC 2 - 4, to make this post short. // To recover them, // - Copy entire "CDC 0" descriptors // - Replace all USB_CDC_CIF_NUM0, USB_CDC_DIF_NUM0 on CDC 0 to the corresponding ones // - Replace three Endpoint numbers on the endpoint descriptors, interrupt IN, bulk IN/OUT // /************************ CDC 2 ***************************/ /************************ CDC 3 ***************************/ /************************ CDC 4 ***************************/ /* Terminator */ 0 /* bLength */ };