Skip to main content
Associate III
October 28, 2023
Solved

How can I use multiple USB device classes with STM32L4

  • October 28, 2023
  • 2 replies
  • 3064 views

Hello together,
does anyone know how I can implement multiple USB device classes on a STM32?
I want to use the CDC so a VCP and the DFU class so I can communicate with my chip and drive an update if needed. I am working with a STM32L452RE.

It must be possible, it is the standard functionality of every ST-Link V2/V3 debugger that exists.

In the CubeMx you can not set this, is that documented somewhere? Unfortunately I haven't found anything yet.

Thanks for your assistance!

Best answer by Pavel A.

The keyword is "composite device". Search for it and you'll find enough information.

 

2 replies

Pavel A.
Pavel A.Answer
Super User
October 28, 2023

The keyword is "composite device". Search for it and you'll find enough information.

 

EniRot99Author
Associate III
October 30, 2023

This was the right key word. Found this which looks nice: I-CUBE-USBD-Composite 

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

Shirley.Ye
ST Employee
October 30, 2023

you can download the L4 cube firmware in st.com and there is USB middleware in stm32cube_fw_l4\Middlewares dir.