AnsweredAssumed Answered

STM32F4 HAL Composite USB Device Example

Question asked by qwer.asdf on Nov 10, 2014
Latest reply on Feb 1, 2018 by mostafa z
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)".

Outcomes