Skip to main content
XD_it
Associate III
June 18, 2025
Question

USB OTG CubeMX middleware selection.

  • June 18, 2025
  • 1 reply
  • 264 views

The only other mention i have found of this is in the following post

https://community.st.com/t5/stm32-mcus-products/usb-otg-dual-role-selection-from-cube-mx/td-p/569876

I'm using an F4 with external PHY.
Everything works fine when configuring the USB FS as exclusively device or host but i'm unable to configure CubeMX to use both.

What is the solution to this issue?
Do i have to manually copy the host/device implementations and make a frankenstein implementation?

The end goal is to have a USB Device VCP, a USB MSC and switch between them depending on the need.

I dont really need the OTG part since the switching part is handled separately outside of the CubeMX code.

 

Any input is appreciated.

1 reply

Technical Moderator
June 18, 2025

Hi @XD_it 

A new GitHub Hotspot repository, accompanied by a knowledge base article featuring a USB dual-role example for the STM32H723, is currently under validation and is expected to be published within a few weeks.

Unfortunately, CubeMX does not support importing both middleware simultaneously, as there is no example provided for this use case. You need to create two projects. One project as a host and the other as a device to configure both modes.

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.Best regards,FBL