cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5: USB_OTG_FS not visible & USB_Device option missing in the Middleware settings

Sus
Associate

Hi,

I would greatly appreciate it if someone could share their thoughts here and let me know if my understanding is correct.

Question 1. The STM32H573 supports both USB Host and Device, but why are “USB_OTG_FS” or “USB_DRD_FS” not visible in CubeMX?
It appears to be due to the USB IP architecture. The STM32H573 integrates a dedicated USB 2.0 Full-Speed Host & Device block, but unlike some other STM32 series, it does not provide an OTG/DRD block with ID-pin based automatic role switching.
As a result, CubeMX only exposes it as “USB (FS)”, and the user has to manually select either Host or Device mode.

Question 2. Is the current CubeMX GUI template for the STM32H5 series limited to Device-only USB configuration?
Both Host and Device functionality are supported by the hardware, but in CubeMX the GUI is still modeled primarily for Device-only use.
This means that CubeMX does not automatically generate the corresponding code for Host operation, and the developer must manually initialize the HAL PCD/HCD layer and integrate the USB class stack.

Question 3. Is this a limitation of the HAL / CubeMX software support?
It looks like. The STM32H5 HAL and CubeMX templates do not yet fully reflect OTG/DRD operation.
Therefore, in CubeMX the USB_Device middleware menu may not appear, and class code such as HID is not automatically generated.
In this case, HID, and other USB class drivers need to be added manually to the project, which can lead to issues such as class registration function call errors such as like attachments:

Thank you!

 

2 REPLIES 2
TDK
Super User

This chip does not support OTG because there is no ID pin (nor does it have the underlying hardware support). Because of that, you won't find any OTG options in CubeMX for it.

To enable it as a USB host, select host in the USB tab and then configure it in the USBX tab. Seems to be working okay in CubeMX. USBX is the supported USB framework for this chip.

TDK_0-1758760662162.png

 

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hi @Sus 

Q1:

STM32H573 supports USB DRD (Dual Role Device) controller and not USB OTG controller as mentioned in the reference manual.

Also, as mentioned @TDK , STM32H5 supports USBX natively instead of ST USB library. Here examples of classic library if needed. USB_Device MW is not supported by CubeMX. So, the point is code generation is allowed only using the USBX stack.

Q2:Would you attach IOC file if you confirm USB Mode is not configurable

FBL_0-1760346996631.png

Q3: if still having issues related to CubeMX code generation check the examples firmware provided here

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.