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

Could you provide a link to your example?

LHabe.1
Associate II

Has anyone come up with a composite CDC+MSC example? Preferably for STM32F4?

Thank you. TinyUSB is an option, but i'd like to find a direct low level composite driver. Or build my own