cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use multiple USB device classes with STM32L4

EniRot99
Associate II

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

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

 

View solution in original post

5 REPLIES 5
Pavel A.
Evangelist III

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

 

Shirley.Ye
ST Employee

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

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

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

Yeah, same thing as I posted. 

 

But now I can say, the question was useless in my case, since when I jump into bootloader application from running application it switches the usb device class from CDC to DFU. So no special function is required in my case 😊