cancel
Showing results for 
Search instead for 
Did you mean: 

USB-FS composite device (CDC HID)

slachist
Associate II
Posted on May 26, 2013 at 22:54

Hello everyone,

I'm trying to make a USB composite device working both CDC and HID, to work as a virtual com port and as HID device at the same time.

I've actually started from the USB composite device example provided by USB-FS 4.0.

*I changed the descriptor file(total number of interfaces =3)

*I changed these function in usb_prop file 

*customHID_Reset to reset all the endpoints

*customHID_DATASetup

*I added both Virtual_Com_Port_GetLineCoding, Virtual_Com_Port_SetLineCoding function and linecoding structure

*I updated the total number of endpoints in the device table to 5

The device is detected by the host but with a yellow warning sign code(10)

Please tell me if I'm missing something. or can you provide me with an example cause I didn't find in the internet.

4 REPLIES 4
tsuneo
Senior
Posted on May 28, 2013 at 04:24

As of CDC composite device,

- On the config descriptor set, the CDC interfaces are bound by IAD (Interface Association Descriptor), if you are applying the standard two-interface CDC.

- The Device Dedcriptor should have the triad (device class, subclass, protocol) of IAD.

- For Windows INF file, the interface number (MI) is appended after the CDC VID/PID

CDC composite device was discussed once on this topic,

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FMultiple%20USB%20CDC%20%28USB%20IAD%29.%20How

Tsuneo

slachist
Associate II
Posted on May 28, 2013 at 23:53

Hi,

Do I need an IAD for making CDC+HID device or only IAD is used for making CDC+CDC?

Please sir where can I create my inf file and how can I use it?

Thanks

tsuneo
Senior
Posted on May 30, 2013 at 00:38

> Do I need an IAD for making CDC+HID device

Yes

> Please sir where can I create my inf file and how can I use it?

On above topic, you'll see an example of INF for composite CDC

STM32-CDC-Composite.inf

As you have just one pair of CDC interfaces, the DeviceList on the INF declares just one line for the pair.

If your CDC interface is the second one after HID, ''MI_00'' is replaced with ''MI_01''

;------------------------------------------------------------------------------

;  Device list

;------------------------------------------------------------------------------

[DeviceList]

%DESCRIPTION1% = STM32CDCCMP, USB¥VID_FF02&PID_0001&MI_00

[DeviceList.ntamd64]

%DESCRIPTION1% = STM32CDCCMP, USB¥VID_FF02&PID_0001&MI_00

Tsuneo

Tomas Long
Associate II
Posted on July 13, 2018 at 05:28

I'm also writing USB composite device CDC+HID(keyboard),but have some error, I used USB FS Lib 4.0.0,and STM32 StdPeriph Lib V3.5.0 .Have you solved that problem now,Can you give me your rountine for reference.Think you!