Electrical – can i be host usb without OTG and USB-A on stm32

hoststm32usbusb device

Okay, hello everyone !

I'm a little bit confused with USB possibility and stm32 MCU !

I have a stm32l433rb and it has just an usb full speed (device) capabilities. In the other hand, on my hardware, I wanted to add a USB typeA connector.

So I'm not OTG, so can my STM32 can be host anyway to read some data from an usb key plug on the USB-A ? Or I can just be device ? In the guideline for hardware implementation : http://comm.eefocus.com/media/download/index/id-1010928, they show me how to implement a downstream line without OTG, so in this mode, i'm host, and I read data from a device but … i don't understand how to do this without OTG ?

And If I use the stm32l475RC, with an OTG port, I think I can force the MCU to be host with a USB type A connector (put ID pin to ground no ?) so I can read a usb key but if I want to transfer data from my MCU to a PC, can I be seen like a device or my pin ID put to ground will block this ? (maybe a host can talk to a host … ?).

Thanks for reading !

Best Answer

USB host can't talk to another USB host.

You seem to have a design constraint to have a Type-A receptacle. Understandable, to read a USB key. But change the data role in your design will be problematic then.

You can start with your design having Type-A receptacle and set the OTG_FS_ID low. It will be a legitimate USB host.

However, for your design to be a USB device, you can't use Type-A receptacle, it must be Type-B receptacle.

What you can do is to add another Type-B connector, and de-multiplex USB data to it using a dedicated IC USB switch, because the D+/D- data lines are already muxed inside the MCU.

Since Type-A nor Type-B standard connectors don't have ID pin, the switch can be done by manually selecting the mode (set OTG_FS_ID low or high). The direction of data switch should correspond to the position of manual OTG switch.

Alternatively, you can use VBUS=high signal on Type-B port to make this switch for you. You will have then a priority of device function over host function if a stadard B - A cable is connected to a PC host. This all might be a heck of confusion to customers, but this is the price to go with old USB connectors.