Not able to get proper USB_DESC_TYPE_CS_INTERFACE using usb host cdc

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Not able to get proper USB_DESC_TYPE_CS_INTERFACE using usb host cdc

1,316 Views
s_ram
Contributor I

Hi All,

I am trying to get the usb host cdc_serial example to work on my custom board. (The mass storage device example works on my board, so I am assuming the HW is working fine)

Here is more data on my issue.

I am using 4.0.2 usb bare metal stack. I am using Freescale MK60FN1M0xxx15

I am trying to talk to a USB to serial device from FTDI called Chipx. Here is the info about the device.

Header 1

[Port2]  :  USB Serial Converter

          ---===>Device Information<===---

English product name: "Chipi-X"

ConnectionStatus:              

Current Config Value:        0x01  -> Device Bus Speed: Full

Device Address:                0x04

Open Pipes:                           2

          ===>Endpoint Descriptor<===

bLength:                           0x07

bDescriptorType:               0x05

bEndpointAddress:            0x81  -> Direction: IN - EndpointID: 1

bmAttributes:                    0x02  -> Bulk Transfer Type

wMaxPacketSize:             0x0040 = 0x40 bytes

bInterval:                         0x00

          ===>Endpoint Descriptor<===

bLength:                           0x07

bDescriptorType:               0x05

bEndpointAddress:            0x02  -> Direction: OUT - EndpointID: 2

bmAttributes:                    0x02  -> Bulk Transfer Type

wMaxPacketSize:             0x0040 = 0x40 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:            0x08 = (8) Bytes

idVendor:                        0x0403 = Future Technology Devices International Limited

idProduct:                       0x6015

bcdDevice:                       0x1000

iManufacturer:                     0x01

     English (United States)  "FTDI"

iProduct:                          0x02

     English (United States)  "Chipi-X"

iSerialNumber:                     0x03

     English (United States)  "FTWEIQP5"

bNumConfigurations:                0x01

          ===>Configuration Descriptor<===

bLength:                           0x09

bDescriptorType:               0x02

wTotalLength:                   0x0020  -> Validated

bNumInterfaces:                0x01

bConfigurationValue:          0x01

iConfiguration:                   0x00

bmAttributes:                    0xA0  -> Bus Powered

MaxPower:                       0x2D =  90 mA

          ===>Interface Descriptor<===

bLength:                           0x09

bDescriptorType:               0x04

bInterfaceNumber:             0x00

bAlternateSetting:             0x00

bNumEndpoints:               0x02

bInterfaceClass:                0xFF  -> Vendor Specific Device

bInterfaceSubClass:          0xFF

*!*CAUTION:    This appears to be an invalid bInterfaceSubClass

bInterfaceProtocol:                0xFF

*!*WARNING:  must be set to PC_PROTOCOL_UNDEFINED 0 for this class

iInterface:                        0x02

     English (United States)  "Chipi-X"

*!*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:             0x0040 = 0x40 bytes

bInterval:                         0x00

          ===>Endpoint Descriptor<===

bLength:                           0x07

bDescriptorType:               0x05

bEndpointAddress:            0x02  -> Direction: OUT - EndpointID: 2

bmAttributes:                    0x02  -> Bulk Transfer Type

wMaxPacketSize:             0x0040 = 0x40 bytes

bInterval:                           0x00

When I plug in the device I get

CDC Control Interface Attach event

State = attached, Class = 255, Subclass = 255, Protocol = 255

But nothing after that. When I dig into the code,

usb_hostdev_get_descriptor () returns USBERR_NO_DESCRIPTOR, when I stepped into the function, the control goes to

if (ptr1.cfig->bDescriptorType == desc_type)    // The descriptor type is  desc_type = USB_DESC_TYPE_CS_INTERFACE

The only ptr1.cfig->bDescriptorType I get are

0x04

0x05

0x05

So the function returns some error and the code simply spins in a loop doing nothing.

Why is this happening? How can I go about solving it?

Labels (2)
0 Kudos
4 Replies

894 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

I checked Chipx (USB Serial Converter) tool configuration description is different with USB stack CDC device.

You can try to use another Kinetis board works as an USB CDC device (software project located at USB stack path: C:\Freescale\Freescale USB Stack v4.0.3\Source\Device\app\cdc ), then connects with your usb host cdc board and check if it works with that USB CDC host or not.

Thank you for the attention.

Best regards,

Ma Hui

0 Kudos

894 Views
s_ram
Contributor I

I tried the USB HOST CDC with this USB to Serial eval board from Freescale

http://www.digikey.com/product-detail/en/EVBUSB2SER/EVBUSB2SER-ND/2660578?itemSeq=143964436&uq=63527...

Freescale link

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=EVBUSB2SER

and the example works! The interface descriptors match what the USB Host CDC is looking for. Here is the USB descriptors for the USB2SER chip. (see attached file)

Hopefully this helps others looking at this problem. Also, if there is way to make the code work with FTDI chips and generic off the shelf USB to serial convertors, please post it.

Thanks

-Santhosh

0 Kudos

894 Views
s_ram
Contributor I
0 Kudos

894 Views
s_ram
Contributor I

I will get a device example working on another board and will connect that board to my host board and check it out.

I have also tried with different USB to serial devices, and they all seem to have the same error. Is there some code which will work with FTDI devices?

-santhosh

0 Kudos