1

我正在 STM32F4 MCU 上实现一个虚拟 COM 端口。

MCU 没有可用的端点,所以我必须取消中断端点/通知元素。问题是 MCU 只能向 pc 发送一次消息,之后 pc 将无法收到。

设备 USB 描述符:

Interface Association Descriptor:
------------------------------
0x08    bLength
0x0B    bDescriptorType
0x02    bFirstInterface
0x02    bInterfaceCount
0x02    bFunctionClass   (Communication Device Class)
0x02    bFunctionSubClass   (Abstract Control Model)
0x01    bFunctionProtocol   (ITU-T V.250)
0x06    iFunction

Interface Descriptor:
------------------------------
0x09    bLength
0x04    bDescriptorType
0x02    bInterfaceNumber
0x00    bAlternateSetting
0x00    bNumEndPoints
0x02    bInterfaceClass   (Communication Device Class)
0x02    bInterfaceSubClass   (Abstract Control Model)
0x01    bInterfaceProtocol   (ITU-T V.250)
0x02    iInterface   ""

CDC Header Functional Descriptor:
------------------------------
0x05    bFunctionalLength
0x24    bDescriptorType
0x00    bDescriptorSubtype
0x0110  bcdCDC

CDC Call Management Functional Descriptor:
------------------------------
0x05    bFunctionalLength
0x24    bDescriptorType
0x01    bDescriptorSubtype
0x00    bmCapabilities
0x01    bDataInterface

CDC Abstract Control Management Functional Descriptor:
------------------------------
0x04    bFunctionalLength
0x24    bDescriptorType
0x02    bDescriptorSubtype
0x02    bmCapabilities

CDC Union Functional Descriptor:
------------------------------
0x05    bFunctionalLength
0x24    bDescriptorType
0x06    bDescriptorSubtype
0x00    bControlInterface
0x01    bSubordinateInterface(0)

Interface Descriptor:
------------------------------
0x09    bLength
0x04    bDescriptorType
0x03    bInterfaceNumber
0x00    bAlternateSetting
0x02    bNumEndPoints
0x0A    bInterfaceClass   (CDC Data)
0x00    bInterfaceSubClass   
0x00    bInterfaceProtocol   
0x02    iInterface   ""

Endpoint Descriptor:
------------------------------
0x07    bLength
0x05    bDescriptorType
0x03    bEndpointAddress   (OUT Endpoint)
0x02    bmAttributes    (Transfer: Bulk / Synch: None / Usage: Data)
0x0010  wMaxPacketSize   (16 Bytes) 
0x00    bInterval

Endpoint Descriptor:
------------------------------
0x07    bLength
0x05    bDescriptorType
0x85    bEndpointAddress   (IN Endpoint)
0x02    bmAttributes    (Transfer: Bulk / Synch: None / Usage: Data)
0x0010  wMaxPacketSize   (16 Bytes) 
0x00    bInterval
4

1 回答 1

0

如果我删除这个无用的端点,usbser windows 驱动程序就会发疯。因此,即使应用程序从未使用过它,您也必须有一个中断 IN 端点。

于 2016-08-10T14:11:27.450 回答