cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 HAL Composite USB Device Example

qwer.asdf
Senior
Posted on November 10, 2014 at 14:30

Hello. I am using the new HAL library for writing a program for STM32F4Discovery (for university presentation). The program activates a USB FS CDC device once running to speak with a PC. I've attached an SD card slot to the discovery, and I also need the discovery board to act as USB FS Mass Storage device after the user clicks the User Button (without losing the CDC functionality). Then become back to the only-CDC mode once the user safe-ejects the mass storage device. As far as I know this is called a composite device (one physical connection, several devices). Is this possible with STM32F4 with HAL library and USB OTG library? If yes, is there an example code for this? Please help me if you can, thank you.

Edit 1

I have found a composite device example in ''STM32_USB-FS-Device_Lib_V4.0.0'' library which is used by STM32F102xx, STM32F103xx, STM32L1 and STM32F3. But there is no composite device example in ''STM32_USB-Host-Device_Lib_v2.1.0'' which is used in my mcu's (STM32F407) case, though its documentation (UM1021) says that it supports it: ''supports multi-interface applications (composite devices)''.

#cdc #composite #msc #usb
14 REPLIES 14
Posted on November 12, 2014 at 17:27

Hi,

The STM32Cube FW package includes examples based on elementary USB classes (MSC, HID, CDC,...). 

Multi-interface applications (composite) are not yet developed. We’ll notify our development team about this subject.  

Regards,

Heisenberg.

qwer.asdf
Senior
Posted on November 14, 2014 at 14:01

Thank you.

Could you please tell me if it is currently possible to achieve a composite USB device using the current version of STM32CubeF4 HAL library (so it is just lacking an example demonstration) or the libraries should be changed first (hopefully in the near future) to do that?

And, thank you for the STM32Cube initiative, it's still not as mature as the StdPeriph libraries, but I'm sure it will be, soon enough.
Posted on January 12, 2015 at 17:12

Hi,

It is possible to achieve your own composite USB Device, by combining the desired classes' drivers into one class, under your own folder within: Middlewares\ST\STM32_USB Device Library\Class

Regards,

Heisenberg.

skufaev
Associate II
Posted on July 13, 2015 at 01:37

Any news about composite device example?

mostafa z
Associate II
Posted on February 01, 2018 at 08:04

Hi,

I need USB Composite (MSC +HID) 

STM32Cube 

example based on Stm32f407 microcontroller

please help me..

i have an example

canwe
Associate II

Hi,

I need USB Composite (MSC +CDC) 

STM32Cube 

example based on Stm32f7 microcontroller

please help me..

  •  

AMilf
Associate

Anyone have an example of this they would care to share?

Trying to make composite MSC +CDC in a STM32Cube for STM32F7.

Thanks

JCorn.2
Associate II

I am looking for an STM32F4 CDC MSC example. Can Someone help?