lpcware

USB Serial Hosting

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by brownm on Fri May 10 02:06:32 MST 2013

Hi There I am trying to connect to a USB Modem with the LPC1768, To begin with I thought that I would take easy steps.


1. Get the USB library working on a LPCExpresso 1769 with the Base board - done


2. Plug in a Keyboard and run up the example code (no problems) - put the jumpers in on J61 on the base board!!


3. Plug in a serial to USB Cable from FTDI and host this. I have the example code VirtualSerialHost.c which I got from another posting - this all compiles and detects the insertion of the serial cable no problems.


4. the CDC device class is 0x02 but the FTDI implements its own class 0xFF (for Vendor specific)


so I hit this Assertion in  <span style="font-size: x-small;"><strong>EVENT_USB_Host_DeviceEnumerationComplete</strong></span>


<p align="LEFT"><span style="color: #7f0055; font-size: x-small;"><span style="color: #7f0055; font-size: x-small;"><strong>if</strong></span></span><span style="font-size: x-small;"> (CDC_Host_ConfigurePipes(&amp;VirtualSerial_CDC_Interface, </span><span style="font-size: x-small;">ConfigDescriptorSize, ConfigDescriptorData) != </span><em><span style="color: #0000c0; font-size: x-small;"><span style="color: #0000c0; font-size: x-small;">CDC_ENUMERROR_NoError</span></span></em><span style="font-size: x-small;">)</span>

<span style="font-size: x-small;">{</span>


<span style="font-size: x-small;">       </span><span style="font-size: x-small;">puts_P(PSTR(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"Attached Device Not a Valid CDC Class Device.\r\n"</span></span><span style="font-size: x-small;">));</span><span style="font-size: x-small;">LEDs_SetAllLEDs(LEDMASK_USB_ERROR);</span>


<span style="font-size: x-small;"> </span><strong><span style="color: #7f0055; font-size: x-small;"><span style="color: #7f0055; font-size: x-small;">    return</span></span></strong><span style="font-size: x-small;">;</span>


 <span style="font-size: x-small;">}</span>


 


<h2>How do I accept the FTDI serial dongle as a valid CDC device? so that I can accept it as serial device?</h2>

 


Everything else seems to be working fine  - sorry about the formating on the post it went a bit weird when I cut an paste into it and the font is really tiny.


Thanks and Regards


 


Marshall Brown


 


 


Heres the details from USB View (from the FTDI website)


 


Device Descriptor:
bcdUSB:             0x0200
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x08 (8)
idVendor:           0x0403 (Future Technology Devices International Limited)
idProduct:          0x6001
bcdDevice:          0x0600
iManufacturer:        0x01
0x0409: "FTDI"
iProduct:             0x02
0x0409: "FT232R USB UART"
0x0409: "FT232R USB UART"
iSerialNumber:        0x03
0x0409: "A901CT6L"
bNumConfigurations:   0x01


ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     Full
Device Address:       0x06
Open Pipes:              2


Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00


Endpoint Descriptor:
bEndpointAddress:     0x02  OUT
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00


Configuration Descriptor:
wTotalLength:       0x0020
bNumInterfaces:       0x01
bConfigurationValue:  0x01
iConfiguration:       0x00
bmAttributes:         0xA0 (Bus Powered Remote Wakeup)
MaxPower:             0x2D (90 Ma)


Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x02
bInterfaceClass:      0xFF
bInterfaceSubClass:   0xFF
bInterfaceProtocol:   0xFF
iInterface:           0x02
0x0409: "FT232R USB UART"
0x0409: "FT232R USB UART"


Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00


Endpoint Descriptor:
bEndpointAddress:     0x02  OUT
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00


 


Original Attachment has been moved to: Example_VirtualSerialHost_0_1.zip

Outcomes