Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 1 month ago.
Its possible to run at same time USBKeyboard and USBSerial?
Hi Samuel,
I need to run at same time an HID Class (keyboard) and a CDC class (serial port, virtual com on PC side). It's possible to implement with your USB stack?
Thanks,
Samuel Ramirez
Question relating to:
3 Answers
11 years, 1 month ago.
Hi Chris,
Thanks for your reply!
I compiled and imported the binary file of your `USBSerialKeyboard_Example` to my mbed board but I just can see ath the PC side the virtual COM port but I don't see the HID class running an ''emulated" keyboard.
Is that correct?
Regards,
Samuel
10 years, 2 months ago.
Has anyone looked at this library and example further?
With the example as-downloaded, the keyboard does not show up under Windows7 with a FRDM-KL25Z but the serial port does.
Here is the USB descriptor dump when it's plugged in:
descriptor dump
Information for device CDC DEVICE (VID=0x1F00 PID=0x2012): Connection Information: ------------------------------ Connection status: Device connected Device actual bus speed: Full Device is hub: No Device adress: 0x0006 Current configuration value: 0x01 Number of open pipes: 5 Device Descriptor: ------------------------------ 0x12 bLength 0x01 bDescriptorType 0x0110 bcdUSB 0xEF bDeviceClass (Miscellaneous device) 0x02 bDeviceSubClass 0x01 bDeviceProtocol 0x40 bMaxPacketSize0 (64 Bytes) 0x1F00 idVendor 0x2012 idProduct 0x0100 bcdDevice 0x01 iManufacturer 0x02 iProduct 0x03 iSerialNumber 0x01 bNumConfigurations Configuration Descriptor: ------------------------------ 0x09 bLength 0x02 bDescriptorType 0x006B wTotalLength 0x03 bNumInterfaces 0x01 bConfigurationValue 0x00 iConfiguration 0x80 bmAttributes (Bus-powered Device) 0x32 bMaxPower (100 mA) Interface Association Descriptor: ------------------------------ 0x08 bLength 0x0B bDescriptorType 0x00 bFirstInterface 0x02 bInterfaceCount 0x02 bFunctionClass (Communication Device Class) 0x02 bFunctionSubClass (Abstract Control Model) 0x01 bFunctionProtocol (ITU-T V.250) 0x00 iFunction 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) 0x00 iInterface CDC Header Functional Descriptor: ------------------------------ 0x05 bFunctionalLength 0x24 bDescriptorType 0x00 bDescriptorSubtype 0x0110 bcdCDC CDC Call Management Functional Descriptor: ------------------------------ 0x05 bFunctionalLength 0x24 bDescriptorType 0x01 bDescriptorSubtype 0x03 bmCapabilities 0x01 bDataInterface CDC Abstract Control Management Functional Descriptor: ------------------------------ 0x04 bFunctionalLength 0x24 bDescriptorType 0x02 bDescriptorSubtype 0x06 bmCapabilities CDC Union Functional Descriptor: ------------------------------ 0x05 bFunctionalLength 0x24 bDescriptorType 0x06 bDescriptorSubtype 0x00 bControlInterface 0x01 bSubordinateInterface(0) Endpoint Descriptor: ------------------------------ 0x07 bLength 0x05 bDescriptorType 0x81 bEndpointAddress (IN Endpoint) 0x03 bmAttributes (Transfer: Interrupt / Synch: None / Usage: Data) 0x0040 wMaxPacketSize (64 Bytes) 0x10 bInterval Interface Descriptor: ------------------------------ 0x09 bLength 0x04 bDescriptorType 0x01 bInterfaceNumber 0x00 bAlternateSetting 0x02 bNumEndPoints 0x0A bInterfaceClass (CDC Data) 0x00 bInterfaceSubClass 0x00 bInterfaceProtocol 0x00 iInterface Endpoint Descriptor: ------------------------------ 0x07 bLength 0x05 bDescriptorType 0x82 bEndpointAddress (IN Endpoint) 0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data) 0x0040 wMaxPacketSize (64 Bytes) 0x00 bInterval Endpoint Descriptor: ------------------------------ 0x07 bLength 0x05 bDescriptorType 0x02 bEndpointAddress (OUT Endpoint) 0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data) 0x0040 wMaxPacketSize (64 Bytes) 0x00 bInterval Interface Descriptor: ------------------------------ 0x09 bLength 0x04 bDescriptorType 0x02 bInterfaceNumber 0x00 bAlternateSetting 0x02 bNumEndPoints 0x03 bInterfaceClass (Human Interface Device Class) 0x01 bInterfaceSubClass 0x01 bInterfaceProtocol 0x00 iInterface HID Descriptor: ------------------------------ 0x09 bLength 0x21 bDescriptorType 0x0111 bcdHID 0x00 bCountryCode 0x01 bNumDescriptors 0x22 bDescriptorType (Report descriptor) 0x0068 bDescriptorLength Endpoint Descriptor: ------------------------------ 0x07 bLength 0x05 bDescriptorType 0x81 bEndpointAddress (IN Endpoint) 0x03 bmAttributes (Transfer: Interrupt / Synch: None / Usage: Data) 0x0040 wMaxPacketSize (64 Bytes) 0x01 bInterval Endpoint Descriptor: ------------------------------ 0x07 bLength 0x05 bDescriptorType 0x01 bEndpointAddress (OUT Endpoint) 0x03 bmAttributes (Transfer: Interrupt / Synch: None / Usage: Data) 0x0040 wMaxPacketSize (64 Bytes) 0x01 bInterval String Descriptor Table -------------------------------- Index LANGID String 0x00 0x0000 0x0009 0x01 0x0009 "mbed.org" 0x02 0x0009 "CDC DEVICE" 0x03 0x0009 "0123456789" 0x04 0x0009 "01" 0x05 0x0009 "CDC" 0x10 0x0009 " " 0x11 0x0009 "mbed.org" 0x12 0x0009 "CDC DEVICE" 0x13 0x0009 "0123456789" 0x14 0x0009 "01" 0x15 0x0009 "CDC" 0x20 0x0009 " " 0x21 0x0009 "mbed.org" 0x22 0x0009 "CDC DEVICE" 0x23 0x0009 "0123456789" 0x24 0x0009 "01" 0x25 0x0009 "CDC" 0x30 0x0009 " " 0x31 0x0009 "mbed.org" 0x32 0x0009 "CDC DEVICE" 0x33 0x0009 "0123456789" 0x34 0x0009 "01" 0x35 0x0009 "CDC" 0x40 0x0009 " " 0x41 0x0009 "mbed.org" 0x42 0x0009 "CDC DEVICE" 0x43 0x0009 "0123456789" 0x44 0x0009 "01" 0x45 0x0009 "CDC" 0x50 0x0009 " " 0x51 0x0009 "mbed.org" 0x52 0x0009 "CDC DEVICE" 0x53 0x0009 "0123456789" 0x54 0x0009 "01" 0x55 0x0009 "CDC" 0x60 0x0009 " " 0x61 0x0009 "mbed.org" 0x62 0x0009 "CDC DEVICE" 0x63 0x0009 "0123456789" 0x64 0x0009 "01" 0x65 0x0009 "CDC" 0x70 0x0009 " " 0x71 0x0009 "mbed.org" 0x72 0x0009 "CDC DEVICE" 0x73 0x0009 "0123456789" 0x74 0x0009 "01" 0x75 0x0009 "CDC" 0x80 0x0009 " " 0x81 0x0009 "mbed.org" 0x82 0x0009 "CDC DEVICE" 0x83 0x0009 "0123456789" 0x84 0x0009 "01" 0x85 0x0009 "CDC" 0x90 0x0009 " " 0x91 0x0009 "mbed.org" 0x92 0x0009 "CDC DEVICE" 0x93 0x0009 "0123456789" 0x94 0x0009 "01" 0x95 0x0009 "CDC" 0xA0 0x0009 " " 0xA1 0x0009 "mbed.org" 0xA2 0x0009 "CDC DEVICE" 0xA3 0x0009 "0123456789" 0xA4 0x0009 "01" 0xA5 0x0009 "CDC" 0xB0 0x0009 " " 0xB1 0x0009 "mbed.org" 0xB2 0x0009 "CDC DEVICE" 0xB3 0x0009 "0123456789" 0xB4 0x0009 "01" 0xB5 0x0009 "CDC" 0xC0 0x0009 " " 0xC1 0x0009 "mbed.org" 0xC2 0x0009 "CDC DEVICE" 0xC3 0x0009 "0123456789" 0xC4 0x0009 "01" 0xC5 0x0009 "CDC" 0xD0 0x0009 " " 0xD1 0x0009 "mbed.org" 0xD2 0x0009 "CDC DEVICE" 0xD3 0x0009 "0123456789" 0xD4 0x0009 "01" 0xD5 0x0009 "CDC" 0xE0 0x0009 " " 0xE1 0x0009 "mbed.org" 0xE2 0x0009 "CDC DEVICE" 0xE3 0x0009 "0123456789" 0xE4 0x0009 "01" 0xE5 0x0009 "CDC" 0xF0 0x0009 " " 0xF1 0x0009 "mbed.org" 0xF2 0x0009 "CDC DEVICE" 0xF3 0x0009 "0123456789" 0xF4 0x0009 "01" 0xF5 0x0009 "CDC" ------------------------------ Connection path for device: Intel(R) 6 Series/C200 Series Chipset Family USB Enhanced Host Controller - 1C26 Root Hub Generic USB Hub Generic USB Hub CDC DEVICE (VID=0x1F00 PID=0x2012) Brought to you by TDD v1.82.0, Aug 20 2013, 17:17:20
11 years, 1 month ago.
Hey Samual I had written a USB Iibrary to do just that a while ago (was to do with a project I did to hook a manual treadmill up to Skyrim, fun way to keep fit, swinging wiimotes for the swords while running was challenging though) anyway I always planned on cleaning the library up and publishing but never got round to it.
Here is the initial version, last time I put it on my mbed it worked, dont have time to try just now.
Exampe:
Import programUSBSerialKeyboard_Example
USBSerialKeyboard Example Program
Library :
Import libraryUSBSerialKeyboard
A Composite device with USBSerial and USBKeyboard