Skip to main content
jding.11
Associate
June 6, 2023
Solved

How to create a STM32F4 USB Composite Device (CDC+UAC) using STM32CubeMX+USB Device Middleware

  • June 6, 2023
  • 3 replies
  • 14401 views

Does the latest version of the driver of STM32F4 supporting USB audio class and CDC composite device functionality?

I want to use the USB interface of STM32F4 to develop the functions of USB audio and CDC composite devices.I have a question, is the latest version of the driver supporting USB audio and CDC composite device functionality? If supported,please let us know how to implement it.Thank you。

This topic has been closed for replies.
Best answer by Ghofrane GSOURI

Hello @jding.1​ 

First let me thank you for posting.

To create a USB composite device with CDC and UAC functionality, you can follow these general steps:

1- Select your target microcontroller model (e.g., STM32F479ZITx)

2- Enable the USB_OTG_FS and USB_OTG_HS by navigating to the "Connectivity" tab .


_legacyfs_online_stmicro_images_0693W00000dDTo7QAG.png
_legacyfs_online_stmicro_images_0693W00000dDTgsQAG.png3- In the "Class For FS IP" section, select "Communication Device Class (Virtual Port)" to enable CDC functionality.

In the "Class For HS IP" section, select "Audio Class" to enable UAC functionality.


_legacyfs_online_stmicro_images_0693W00000dDToRQAW.png4- Configure the other settings, such as endpoints, buffer sizes, and callbacks, as needed for your application.

5- Configure the clock settings and other peripheral configurations as per your project requirements.

6- Generate the initialization code using STM32CubeMX and export the project for your chosen toolchain (e.g., STM32CubeIDE).

Thx

Ghofrane

3 replies

Ghofrane GSOURI
Ghofrane GSOURIBest answer
Technical Moderator
June 9, 2023

Hello @jding.1​ 

First let me thank you for posting.

To create a USB composite device with CDC and UAC functionality, you can follow these general steps:

1- Select your target microcontroller model (e.g., STM32F479ZITx)

2- Enable the USB_OTG_FS and USB_OTG_HS by navigating to the "Connectivity" tab .


_legacyfs_online_stmicro_images_0693W00000dDTo7QAG.png
_legacyfs_online_stmicro_images_0693W00000dDTgsQAG.png3- In the "Class For FS IP" section, select "Communication Device Class (Virtual Port)" to enable CDC functionality.

In the "Class For HS IP" section, select "Audio Class" to enable UAC functionality.


_legacyfs_online_stmicro_images_0693W00000dDToRQAW.png4- Configure the other settings, such as endpoints, buffer sizes, and callbacks, as needed for your application.

5- Configure the clock settings and other peripheral configurations as per your project requirements.

6- Generate the initialization code using STM32CubeMX and export the project for your chosen toolchain (e.g., STM32CubeIDE).

Thx

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
jding.11
jding.11Author
Associate
June 12, 2023

I would like to use the STM32F4 USB FS device as a composite device(UAC+ CDC), without using a USB HS device.please let us know how to implement it.Thank you。

Robmar
Senior II
September 24, 2023

What you're asking for was available for the F407 in 2015, I have the code for doing this as you can see in this image.
STM seem to have dropped the ball on USB, it really seems like they are in a mess.  They've told me that they are focusing on USB for AzRTOS, and hope to have it working by Xmas, but like you, I'd prefer to have it working as it did back in 2015 but for the H7 in my case.

Robmar_1-1695514783176.png

 

MKing
Associate
January 19, 2024

Hi,

it is a shame that CubeMX does not support a combination of several device classes. After one day of searching examples i found a "software pack" for CubeMX:

alambe94/I-CUBE-USBD-Composite: Create STM32 USB Composite devices with ease. (github.com)

ST, please support this project and promote it, so we all can save lifetime!

 

MKing_0-1705645332984.png

 

I use:

CubeMX 6.10.0

CubeIDE 1.14.0

Processor: STM32F407VGT

Robmar
Senior II
January 19, 2024

Isn't the I-Cube composite plug-in fantastic!  I also passed it to STM's Paris support manager, Cedric, saying this was an example of what was needed, but the response was null, not interested.

IMHO I think ST staff have been coasting for years, taking it easy, their MCU products are not developed in-house, they buy in design parts, like the USB controller, and don't really have anyone expert in how to program it.

MLiak.1
Associate
February 2, 2024

Moreover, this package cannot be installed in the latest version of CubeIDE/cCubeMX... It looks like I will have to separately install older versions of the software and then import the project into the latest version. "Everything for users!" (sarcasm).

JWieb
Associate III
February 5, 2024

+1 ST please make this a priority