This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB CDC Host

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

Parents
  • 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.

    Marc

Reply
  • 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.

    Marc

Children