2014-10-17 04:12 AM
Hello I have a question about USB OTG with STM32F4 discovery. I have a working application for cdc device mode and in another project a application for msc host mode (from STM32CubeF4 V1.3.0).
Is it possible to configure the USB core so that it switches automatically between device cdc and host msc when it detects the corresponding device on the USB port? #otg #library #usb #stm322014-10-17 04:15 AM
''Is it possible to configure the USB core so that it switches automatically between device cdc and host msc when it detects the corresponding device on the USB port?''
YES - that is the very point of the USB OTG specification, OTG = On The Go ie can dynamically switch between Host and device modes. (It cannot be both on the same USB peripheral at the same time !)2014-10-17 04:53 AM
Thank you for your fast reply. Is there any example or documentation how to configure the USB host and device library for my use case? I found the documents ''UM1734 STM32Cube USB device library'' and ''UM1720 STM32Cube USB host library'', but I can't find anything about how to configure the otg feature.
2014-10-21 01:51 AM
Hi Chris,
The USB OTG features are not really implemented within the STM32_USB libraries available under the STM32Cube_FW_F4 package. Some HAL USB LL APIs can help you to start implementing OTG features, but the provided solution as it is now, can't really deal with USB OTG details. Let me know if this helps or if you have further questions.Regards,Heisenberg.2014-10-21 03:19 AM
Hi Heisenberg,
thank you for this information, at the moment I don't have further questions. Regards, Chris.2014-10-21 06:36 AM
Hi
Sorry, forgot to check back on this post. The old, no longer supported USB OTG library I think should do thishttp://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257882
2015-11-25 04:47 PM
Hello are there any examples yet to support USB OTG switching between device to host mode as advertised by the presence of the OTG_ID bit. Many thanks.
2015-11-26 09:50 AM
Hi neilh,
I think the example under STM32Cube_FW_F4_V1.9.0\Projects\STM324x9I_EVAL\Applications\USB_Host\DualCore_Standalone can help you.-Shahrzad-2017-08-01 05:21 AM
BEN_ROMDHANE.Mon.001/people?filterID=followers
Chip:- STM32Fxxx. Can U help us to convert USB Standard peripheral library to HAL Library? In USB OTG Stack Implementation and not able to switch between Device and HOST mode. ID Line detection is problem. What kind of configuration is require to detect ID Pin status correctly? Is any hardware changes required? Can U help us to explain OTG Driver as per HAL Library? what can be initial state of USB HOST or Device in USB OTG Implementation?Thanks and Regards,
Shail Shah2019-02-01 03:08 PM
These examples are using both USB cores on the MCU, they don't (that I can see) give any examples for switching mode between device and host.
James