cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 multiple USB devices?

markus2399
Associate II
Posted on October 09, 2013 at 21:15

Hi!

I would like to use the USB interface of the STM32F4 in device mode such that it appears on the bus as two separate devices (a virtual COM port and a vendor-specific device) using ST's USB implementation (http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257882). I was able to use the VCP example provided by ST, and could also create a vendor-specific interface, but I don't know how to combine both into a single program. I looked at the dual-core example, but as far as I understand, this only works if one device uses the full-speed core and the other device the high-speed core. I also tried to create a single USB configuration with two interface descriptors (one for the VCP, the second for the vendor-specific interface), but this wasn't successful either.

Can anybody please explain how such a multi-device setup can be implemented with the STM32F4?

Thanks and kind regards,

Markus

#stm32f4-usb-multiple-devices
5 REPLIES 5
Posted on October 09, 2013 at 21:35

Composite Device?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
markmclean9
Associate II
Posted on October 10, 2013 at 10:14

Microchip have some composite device examples on their website, might give you some pointers as to how it is done.

dthedens23
Associate II
Posted on October 10, 2013 at 17:04

You are on the right track with a composite device.

For instance a CDC and HID (virtual com port and keyboard for example)

Windows knows how to deal with this device because the ''inf'' file describes the devices and what drivers to load for each device.

You have a CDC and a Vendor Specific.  You need an ''inf'' that describes the CDC and what driver to load against the vendor specific, otherwise Windows has no clue as to what to do with the Vendor Specific part of the composite device.

You firmware takes IN and OUT from the Endpoints described in the USB configuration descriptors that you provided.  CDC usually goes to a UART, (doesn't have to).  What you do with the packets going to the Vendor Specific Endpoints is up to you. 

markus2399
Associate II
Posted on October 11, 2013 at 00:16

Thanks for the hints! I found

http://embeddedcodesource.com/developer/microchip_technology_59/usb_keyboardmouse_combination_device

and will try to figure out how this applies to the STM32F4.

Kind regards,

Markus

nishant
Associate
Posted on May 04, 2015 at 13:07

Hi Markus

i have similar requirement for one of my work.(using stm32f4 otg lib)

just wondering if u were able to achieve this .

Regards

Nis