cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L073- multiple USB device interfaces

lprzenioslo
Associate II

Hello,

We are currently evaluating the STM32L073 series in terms of the possibility to configure the USB device as either:

  • 3x interfaces, all serial (COM) ports.
  • 3x interfaces, 2x serial (COM) port and 1x mass storage device.

In the STM32 studio I have noticed initially that in theory there is the possibility to define from 1 to 255 interfaces?

0693W00000WL5f5QAD.pngBut then when set the USBD_MAX_NUM_CONFIGURATION and USBD_MAX_NUM_INTERFACES to 2, I had no way to configure more than 1 interface in the software GUI. I right now don't have the hardware to check that physically.

Are multiple USB interfaces possible for this one? I would appreciate all help.

12 REPLIES 12

Hi @gbm​ , thanks for the answer.

Sorry, I don't really dig the approach based on interrupts. In modern firmware it should be handled elsewhere, not in the interrupt routine. I.e, doing this in the ISR you need to access the flash in a blocking way. Otherwise the SPI can be used with DMA, and so on.

gbm
Lead III

In real modern firmware there is no "elsewhere", just the interrupts. 🙂

That's why in modern MCUs we have multilevel interrupt preemption.

What I meant here is to handle this outside the interrupt routine- i.e., the main loop if there is no RTOS or in a thread if there is. Using multilevel interrupt preemption is not really cross platform, but that's a different story.