Hi !
I have to implement an USB CDC Host driver for STM32F4 controller. Has anyone an idea/example how to do that. I only found examples for CDC Device.
Thanks
Marc
> When I attach the CDC device to PC I get two virtual COM-Ports which I can use with Terminal.
For confirmation, did you read out the descriptors of the target device on a PC? Virtual COM ports may derive from a vendor specific device using a custom PC driver. For example, FTDI and SiLabs apply vendor specific devices for their USB-UART chips.
UVCView is a handy utility to see USB descriptors on PC. (Maybe, USBView can't display such a complicated descriptor set by its bug) I attached UVCView to this post. " href= "http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11800"> www.microsoft.com/.../details.aspx
Please post the descriptors of the target device, to make our discussion forward ;-)
Tsuneo
The output of UVCView shows:
[Port3] : USB-Verbundgerät ---===>Device Information<===--- English product name: "Motorola Tetra Radio" ConnectionStatus: Current Config Value: 0x01 -> Device Bus Speed: High Device Address: 0x01 Open Pipes: 4 ===>Endpoint Descriptor<=== bLength: 0x07 bDescriptorType: 0x05 bEndpointAddress: 0x81 -> Direction: IN - EndpointID: 1 bmAttributes: 0x02 -> Bulk Transfer Type wMaxPacketSize: 0x0200 = 0x200 max bytes bInterval: 0x00 ===>Endpoint Descriptor<=== bLength: 0x07 bDescriptorType: 0x05 bEndpointAddress: 0x01 -> Direction: OUT - EndpointID: 1 bmAttributes: 0x02 -> Bulk Transfer Type wMaxPacketSize: 0x0200 = 0x200 max bytes bInterval: 0x00 ===>Endpoint Descriptor<=== bLength: 0x07 bDescriptorType: 0x05 bEndpointAddress: 0x82 -> Direction: IN - EndpointID: 2 bmAttributes: 0x02 -> Bulk Transfer Type wMaxPacketSize: 0x0200 = 0x200 max bytes bInterval: 0x00 ===>Endpoint Descriptor<=== bLength: 0x07 bDescriptorType: 0x05 bEndpointAddress: 0x02 -> Direction: OUT - EndpointID: 2 bmAttributes: 0x02 -> Bulk Transfer Type wMaxPacketSize: 0x0200 = 0x200 max bytes bInterval: 0x00 ===>Device Descriptor<=== bLength: 0x12 bDescriptorType: 0x01 bcdUSB: 0x0200 bDeviceClass: 0x00 -> This is an Interface Class Defined Device bDeviceSubClass: 0x00 bDeviceProtocol: 0x00 bMaxPacketSize0: 0x40 = (64) Bytes idVendor: 0x0CAD = Motorola GEMS idProduct: 0x9011 bcdDevice: 0x2416 iManufacturer: 0x01 English (United States) "Motorola" iProduct: 0x02 English (United States) "Motorola Tetra Radio" iSerialNumber: 0x00 bNumConfigurations: 0x01 ===>Configuration Descriptor<=== bLength: 0x09 bDescriptorType: 0x02 wTotalLength: 0x0037 -> Validated bNumInterfaces: 0x02 bConfigurationValue: 0x01 iConfiguration: 0x03 English (United States) "Generic Serial config" bmAttributes: 0xC0 -> Bus Powered MaxPower: 0x00 = 0 mA ===>Interface Descriptor<=== bLength: 0x09 bDescriptorType: 0x04 bInterfaceNumber: 0x00 bAlternateSetting: 0x00 bNumEndpoints: 0x02 bInterfaceClass: 0xFF -> Vendor Specific Device bInterfaceSubClass: 0x00 *!*CAUTION: This appears to be an invalid bInterfaceSubClass bInterfaceProtocol: 0x00 iInterface: 0x00 *!*CAUTION: 0xFF is a prerelease Class ID ===>Endpoint Descriptor<=== bLength: 0x07 bDescriptorType: 0x05 bEndpointAddress: 0x81 -> Direction: IN - EndpointID: 1 bmAttributes: 0x02 -> Bulk Transfer Type wMaxPacketSize: 0x0200 = 0x200 max bytes bInterval: 0x00 ===>Endpoint Descriptor<=== bLength: 0x07 bDescriptorType: 0x05 bEndpointAddress: 0x01 -> Direction: OUT - EndpointID: 1 bmAttributes: 0x02 -> Bulk Transfer Type wMaxPacketSize: 0x0200 = 0x200 max bytes bInterval: 0x00 ===>Interface Descriptor<=== bLength: 0x09 bDescriptorType: 0x04 bInterfaceNumber: 0x01 bAlternateSetting: 0x00 bNumEndpoints: 0x02 bInterfaceClass: 0xFF -> Vendor Specific Device bInterfaceSubClass: 0x00 *!*CAUTION: This appears to be an invalid bInterfaceSubClass bInterfaceProtocol: 0x00 iInterface: 0x00 *!*CAUTION: 0xFF is a prerelease Class ID ===>Endpoint Descriptor<=== bLength: 0x07 bDescriptorType: 0x05 bEndpointAddress: 0x82 -> Direction: IN - EndpointID: 2 bmAttributes: 0x02 -> Bulk Transfer Type wMaxPacketSize: 0x0200 = 0x200 max bytes bInterval: 0x00 ===>Endpoint Descriptor<=== bLength: 0x07 bDescriptorType: 0x05 bEndpointAddress: 0x02 -> Direction: OUT - EndpointID: 2 bmAttributes: 0x02 -> Bulk Transfer Type wMaxPacketSize: 0x0200 = 0x200 max bytes bInterval: 0x00
The device actually sends 0xFF for InterfaceClass. I would expect 0x02 for CDC.
Surely, the device has two interfaces (composite device). Both of interfaces belong to vendor specific class (bInterfaceClass: 0xFF).
The Vendor ID (VID: idVendor) shows it's a Motorola device. Is it an Android phone or pad?
Android phone swaps its USB interface, when USB tethering is enabled on Setting. RNDIS (derivative of CDC) interface appears.
Hi, Marc!
I wolud like to know if you have figured out some way to develop your CDC USB host driver;
What did you do? Have you edited the USB MSD's files to adapt to a CDC like Tsuneo did recommend?
Thank you in advance;
Marcel.