2015-07-09 08:18 AM
Hi folks,
New to USB here. I know (more or less ;) ) what the difference between host and device are but not a lot more.When configuring USB via 'MX, I find that if I set USB_OTG_FS as Host_Only, the USB Host middleware is available. Likewise configure as Device_Only, the Device middleware is available. If I configure USB_OTG_FS as OTG/Dual_Role_Device, then neither Host nor Device middleware is available. (Activate_SOF is not available to configure as the related GPIO pin is already configured for another input.)Why is this? I would expect with dual role, I would be able to configure both Host and Device middlewares.Is this a middleware library limitation? Does HAL not support dual role devices? (I'm just starting on reviewing UM1720 (host library) and UNM1734 (device library) and perhaps will find the answer there.)At present I may need to either detect that a USB cable connects the device to a PC or that a USB flash drive has been connected via OTG cable, depending on which way the powers that be decide to go. I think I need the device library for the former and the host library for the latter and it would be nice to get both configured while I wait for an answer.Feel free to offer alternate suggestions.Thanks! #usb-host-device-stm32cubemx2015-07-14 08:46 AM
2016-06-05 07:50 AM
Hi HankB,
I found myself in the same situation. did you find any solution for this problem? I thought about choosing device, generate the code, copy it and then generate the code for the host, using both parts and writing the code for switching them by myself. Hope you came across better solution.Thanks,Avner