Skip to main content
Associate
March 5, 2025
Question

NUCLEO - H753ZI - USB Host with HUB - Stm32CubeMX

Hello,

I am trying to use the USB HOST with CubeMX, everything works fine and I can detect my USB stick properly. The connection/disconnection is detected correctly.

Then, I tested connecting a UGREEN SD card reader, and everything works fine as long as I insert only one SD card. However, when I insert the second SD card into the card reader, CubeMX does not detect the second connection and only considers the first connection.

Similarly, when I connect a powered USB hub (Meta 7-Port USB 2.0 Hub), it detects the USB but never goes into "APPLICATION READY"...?

My question is the following: is it possible to use the USB Host with CubeMX to control a USB hub and read and write to multiple USB sticks?

I haven’t found any example on GitHub.

Thank you for reading!

This topic has been closed for replies.

7 replies

ST Technical Moderator
March 5, 2025

Hi @MoGrunwalski & welcome to ST Community

Maybe this example should be helpful

STM32CubeH7/Projects/NUCLEO-H723ZG/Applications/USB_Host/MSC_Standalone at master · STMicroelectronics/STM32CubeH7

even though not sure if that would be possible to use multiple USB sticks. Which product are you using? If having issues, would you attach ioc file?

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
Associate
March 5, 2025

Hi @FBL 

I just saw your example, but nothing seems to resemble the ability to control a USB hub with the USB Host. Here is my .ioc file attached.

 

Pavel A.
March 5, 2025

Yes this may be possible, with good USB libraries that support hubs.

Regarding the UREEN reader - if you connect it with two cards to a PC, will the PC see both cards? If yes, does PC see the reader as USB composite device with two functions, or one device/function with two LUNs?

 

 

Associate
March 5, 2025

 

Hi @Pavel A. 

Isn't this kind of library managed and defined directly with the code generated by STM32CubeMX?
Regarding the UGREEN card reader, the PC sees a device with two LUNs. I find my two distinct disks in the disk manager (E:) and (G:), and in the task manager, I see "Generic MassStorageClass USB Device" listed twice

 

Thank you 

Pavel A.
March 5, 2025

Hi @MoGrunwalski , maybe one device with two LUNs will be possible to implement with the existing ST USB library, as it does not require composite or hub support or other complications on the USB level.

Some tweaking is needed in the MSC (mass storage) protocol layer. Unlikely that STM32CubeMX can help here.

 

 

Pavel A.
March 5, 2025

Multiple CDC (host) unfortunately requires a hub or composite.

Multiport serial adapters were popular many years ago, but AFAIK this kind of device has not made it to official usb.org standard. This is a pity because need for such devices still exists.