2025-10-30 2:45 PM - edited 2025-10-30 2:46 PM
Hi community,
Before I start discussing my specific issue, I would like to know if dual USB host operation is allowed on STM32H7 MCUs. The H7 MCU has both FS and HS USB cores, and I want to configure both FS and HS as USB hosts, not using the OTG feature. The HS USB core will also run in full-speed host mode without an external PHY, with each host having its own USB port. Are there any potential issues with this configuration?
I encountered unexpected behavior during project development: USB FS MSC class functionalities were affected when devices were plugged into the USB HS port.
Here is my USB class setup:
The USB FS core is registered with two classes — MSC class and a custom printer class.
The USB HS core is registered with a HID class.
All classes worked individually.
If no device is plugged into the USB HS port, the USB FS port works normally. It prints correctly when connected to a thermal receipt printer and creates text file reports using FATFS when connected to a flash drive.
However, after I plugged a barcode scanner or any other device (another flash drive or SD card adapter) into the USB HS port, the USB FS core started experiencing issues with MSC class operations. It seemed like the USB host controller stayed busy and eventually timed out. Specifically:
USBH_MSC_RdWrProcess flagged a busy status and eventually returned a timeout error.
Luckily, the printer class still worked on the USB FS port.
I also checked the USB HS port HID class operations after this issue occurred. The barcode scanner still worked. It appears that, so far, the issue only affects MSC class operations on the USB FS side.
After unplugging devices from both HS and FS ports and reattaching a flash drive to the USB FS port, text file writing function worked normally again.
I also tried changing the interrupt priorities for both USB cores (FS = 6, HS = 7), but this had no effect. No DMA is being used. I checked the USB driver code, and it does not appear that FS and HS share the same static/global buffers.
I hope someone has some insight into this issue. Thank you!
