cancel
Showing results for 
Search instead for 
Did you mean: 

USB device with many interfaces

Zygmunt Ptak
Associate
Posted on October 31, 2017 at 19:17

Hi,

I want to create USB device but I want to have few interfaces like:

- DFU (can be generated with stm32cubemx)

- my own iface with bulk transfers

- HID (also can be generated by 

stm32cubemx)

But from what I see I can only generate only one USB interface with stm32cubemx.

So the questions are:

1. Can I generate code from stm32cubemx with many USB interfaces?

2. If not, how can I implement my USB device? (By implementing everything from scratch in USBD_ClassTypeDef?)

#bulk #usb #hid #dfu
1 REPLY 1
Ben K
Senior III
Posted on November 01, 2017 at 15:43

1. Can I generate code from stm32cubemx with many USB interfaces?

No.

2. If not, how can I implement my USB device? (By implementing everything from scratch in USBD_ClassTypeDef?)

Yes. The STM32 USB Device Library itself is not designed to support a composite USB device. Unfortunately there are several challenges to overcome e.g. when handling endpoint 0 class specific requests, or handling pClassData. Therefore you cannot simply create a new class which will call the existing class callbacks, you will need rework in the ST classes themselves.