Skip to main content
Associate III
November 18, 2024
Solved

The STM32 USB device library feels complicated

The structure of the stm32 usb device library feels very complex, is there any tutorial to clarify the structure?

I want to implement a UVC.

This is a picture I found on a wiki, but I can't make sense of it.

Shiina_0-1731945993216.png

For example, the file stm32xxx_ll_usb has no LL for the API name, but the USB core has LL for the API name, which is very confusing, and PCD HAL driver The name doesn't tell you what it does.

If the following structure is better applied

Shiina_0-1732001345711.jpeg

 

 

 

This topic has been closed for replies.
Imen.DBest answer
ST Technical Moderator
November 18, 2024

Hello @Shiina ,

I recommend you refer to the following document: UM1734: STM32Cube™ USB device library.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks

5 replies

Imen.DBest answer
ST Technical Moderator
November 18, 2024

Hello @Shiina ,

I recommend you refer to the following document: UM1734: STM32Cube™ USB device library.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Andrew Neil
Super User
November 18, 2024

@Shiina wrote:

The structure of the stm32 usb device library feels very complex,


well, USB itself is quite complex!

 


@Shiina wrote:

This is a picture I found on a wiki


What Wiki? please give a link

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ShiinaAuthor
Associate III
November 18, 2024
gbm
Super User
November 18, 2024

My impression is that STM USB stack with tangled pointers and bidirectional function calls between logical levels is much more complex than USB. ;)

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
ST Technical Moderator
November 19, 2024

Hi @Shiina 

Capturing USB traffic is an excellent recommendation! Correlate the captured USB traffic with your code to understand how specific operations in your code translate to USB packets.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL