USB Host Support

I am trying to see if the USB library as currently written can support a CDC device. I am so far unable to send/receive data using the Bulk IN/OUT.

Here are the device details:

Information for device Low Energy Dongle (VID=0x2458 PID=0x0001):

Connection Information:

Device current bus speed: FullSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device address: 0x001A
Current configuration value: 0x00
Number of open pipes: 0

Device Descriptor:

0x12 bLength
0x01 bDescriptorType
0x0200 bcdUSB
0x02 bDeviceClass (Communication Device Class)
0x00 bDeviceSubClass
0x00 bDeviceProtocol
0x20 bMaxPacketSize0 (32 bytes)
0x2458 idVendor
0x0001 idProduct
0x0001 bcdDevice
0x01 iManufacturer "Bluegiga"
0x02 iProduct "Low Energy Dongle"
0x03 iSerialNumber "1"
0x01 bNumConfigurations

Configuration Descriptor:

0x09 bLength
0x02 bDescriptorType
0x0043 wTotalLength (67 bytes)
0x02 bNumInterfaces
0x01 bConfigurationValue
0x04 iConfiguration "CDC"
0x80 bmAttributes (Bus-powered Device)
0x25 bMaxPower (74 mA)

Interface Descriptor:

0x09 bLength
0x04 bDescriptorType
0x00 bInterfaceNumber
0x00 bAlternateSetting
0x01 bNumEndPoints
0x02 bInterfaceClass (Communication Device Class)
0x02 bInterfaceSubClass (Abstract Control Model)
0x01 bInterfaceProtocol (ITU-T V.250)
0x05 iInterface “CDC control”

CDC Header Functional Descriptor:

0x05 bFunctionalLength
0x24 bDescriptorType
0x00 bDescriptorSubtype
0x0110 bcdCDC

CDC Abstract Control Management Functional Descriptor:

0x04 bFunctionalLength
0x24 bDescriptorType
0x02 bDescriptorSubtype
0x02 bmCapabilities

CDC Union Functional Descriptor:

0x05 bFunctionalLength
0x24 bDescriptorType
0x06 bDescriptorSubtype
0x00 bControlInterface
0x01 bSubordinateInterface(0)

CDC Call Management Functional Descriptor:

0x05 bFunctionalLength
0x24 bDescriptorType
0x01 bDescriptorSubtype
0x03 bmCapabilities
0x01 bDataInterface

Endpoint Descriptor:

0x07 bLength
0x05 bDescriptorType
0x82 bEndpointAddress (IN endpoint 2)
0x03 bmAttributes (Transfer: Interrupt / Synch: None / Usage: Data)
0x0040 wMaxPacketSize (1 x 64 bytes)
0x40 bInterval

Interface Descriptor:

0x09 bLength
0x04 bDescriptorType
0x01 bInterfaceNumber
0x00 bAlternateSetting
0x02 bNumEndPoints
0x0A bInterfaceClass (CDC Data)
0x00 bInterfaceSubClass
0x00 bInterfaceProtocol
0x06 iInterface “CDC data”

Endpoint Descriptor:

0x07 bLength
0x05 bDescriptorType
0x84 bEndpointAddress (IN endpoint 4)
0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data)
0x0040 wMaxPacketSize (64 bytes)
0x01 bInterval

Endpoint Descriptor:

0x07 bLength
0x05 bDescriptorType
0x04 bEndpointAddress (OUT endpoint 4)
0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data)
0x0040 wMaxPacketSize (64 bytes)
0x01 bInterval

Microsoft OS Descriptor is not available. Error code: 0x0000001F

String Descriptor Table

Index LANGID String
0x00 0x0000 0x0409
0x01 0x0409 "Bluegiga"
0x02 0x0409 "Low Energy Dongle"
0x03 0x0409 "1"
0x04 0x0409 "CDC"
0x05 0x0409 "CDC control"
0x06 0x0409 “CDC data”


Can you clarify which library, and what code you’re using?

Sorry,

USB.device.lib.nut

I started looking at writing my own driver for the device described in the initial post, but was questioning if the USBHost library can support a CDC USB device as it is currently written.

This is with imp005 hardware of coarse.

I may have figured this out. The library was hard coded to use a certain interface for bulk transfers. I copied the library and made some tweaks and I am a little farther along.

If you have useful changes, a pull request on the repo would be much appreciated :slight_smile: