Thank Simon21ic's help
今天的试验情况如下:
1. 按照Simon21ic的提示使用单个接口(3 ENDP)构造CDC VCOM 是可以的, 还没有试验单个接口(2 ENDP)的模式。
2. 以ST 的Mass Sample 为基础,逐步添加CDC VCOM 的代码,可以看到 Mass盘但是VCOM没有出现。
端点安排如下:
Interface 1
Mass (EndP1Tx,EndP1Rx)
Interface 2
VCom (EndP2 Intrrupt, EndP3Rx, EndP3Tx)
以上的两个Interface 单独试验都是Ok 的。
3. 运行的环境:万利的3210E板, IAR 5.3, Win2K
4. 关键想知道如何安排运行断点来发现问题?
下面是描述:
//MASS_SIZ_DEVICE_DESC=81
const uint8_t MASS_VCOM_DeviceDescriptor[MASS_SIZ_DEVICE_DESC] = {
0x12, // bLength
0x01, // bDescriptorType
0x00, // bcdUSB, version 2.00
0x02,
0x00, // bDeviceClass : each interface define the device class
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
0x40, // bMaxPacketSize0 0x40 = 64
0x83, // idVendor (0483)
0x04,
0x20, // idProduct
0x57,
0x00, // bcdDevice 2.00*/
0x02,
1, // index of string Manufacturer
2, // index of string descriptor of product*/
3, //
0x01 //bNumConfigurations
};
const uint8_t MASS_ConfigDescriptor[MASS_SIZ_CONFIG_DESC] = {
0x09, // bLength: Configuation Descriptor size
0x02, // bDescriptorType: Configuration
MASS_SIZ_CONFIG_DESC,
0x00,
0x02, // bNumInterfaces: 2 interface
0x01, // bConfigurationValue:
0x00, // iConfiguration:
0xC0, // bmAttributes:
0x32, // MaxPower 100 mA
/******************** Descriptor of Mass Storage interface ********************/
0x09, // bLength: Interface Descriptor size
0x04, // bDescriptorType:
0x00, // bInterfaceNumber: Number of Interface
0x00, // bAlternateSetting: Alternate setting
0x02, // bNumEndpoints*/
0x08, // bInterfaceClass: MASS STORAGE Class
0x06, // bInterfaceSubClass : SCSI transparent*/
0x50, // nInterfaceProtocol
4, // iInterface:
0x07, // Endpoint descriptor length = 7
0x05, // Endpoint descriptor type
0x81, // Endpoint address (IN, address 1)
0x02, // Bulk endpoint type
0x40, // Maximum packet size (64 bytes)
0x00,
0x00, // Polling interval in milliseconds
0x07, // Endpoint descriptor length = 7
0x05, // Endpoint descriptor type
0x01, // Endpoint address (OUT, address 2)
0x02, // Bulk endpoint type
0x40, // Maximum packet size (64 bytes)
0x00,
0x00, // Polling interval in milliseconds
//Interface Descriptor
0x09, // bLength: Interface Descriptor size
0x04, // bDescriptorType: Interface
0x01, // bInterfaceNumber: Number of Interface
0x00, // bAlternateSetting: Alternate setting
0x03, // bNumEndpoints: 3 endpoints used
0x02, // bInterfaceClass: Communication Interface Class
0x02, // bInterfaceSubClass: Abstract Control Model
0x01, // bInterfaceProtocol: Common AT commands
0x00, // iInterface:
//Header Functional Descriptor
0x05, // bLength: Endpoint Descriptor size
0x24, // bDescriptorType: CS_INTERFACE
0x00, // bDescriptorSubtype: Header Func Desc
0x10, // bcdCDC: spec release number
0x01,
//Call Managment Functional Descriptor
0x05, // bFunctionLength
0x24, // bDescriptorType: CS_INTERFACE
0x01, // bDescriptorSubtype: Call Management Func Desc
0x00, // bmCapabilities: D0+D1
0x01, // bDataInterface: 1
//ACM Functional Descriptor
0x04, // bFunctionLength
0x24, // bDescriptorType: CS_INTERFACE
0x02, // bDescriptorSubtype: Abstract Control Management desc
0x02, // bmCapabilities
//Union Functional Descriptor
0x05, // bFunctionLength
0x24, // bDescriptorType: CS_INTERFACE
0x06, // bDescriptorSubtype: Union func desc
0x00, // bMasterInterface: Communication class interface
0x01, // bSlaveInterface0: Data Class Interface
//Endpoint 2 Descriptor
0x07, // bLength: Endpoint Descriptor size
0x05, // bDescriptorType: Endpoint
0x82, // bEndpointAddress: (IN2)
0x03, // bmAttributes: Interrupt
0x08, // wMaxPacketSize:
0x00,
0xFF, // bInterval:
//Endpoint 3 Descriptor
0x07, // bLength: Endpoint Descriptor size
0x05, // bDescriptorType: Endpoint
0x03, // bEndpointAddress: (OUT3)
0x02, // bmAttributes: Bulk
0x40, // wMaxPacketSize:
0x00,
0x00, // bInterval: ignore for Bulk transfer
//Endpoint 3 Descriptor
0x07, // bLength: Endpoint Descriptor size
0x05, // bDescriptorType: Endpoint
0x83, // bEndpointAddress: (IN3)
0x02, // bmAttributes: Bulk
0x40, // wMaxPacketSize:
0x00,
0x00 // bInterval
};