Electronic – STM32 “USB Device” vs. “USB OTG HS” – what is the difference

microcontrollerstm32stm32f4usb

I recently downloaded the stm32 app for MCU search and found out that for example STM32F429 has "NO" in "USB Device" peripheral, while it says "YES" in "USB OTG FS" and "USB OTG HS". Which is quite surprising since STM32F429 is fully functional as USB Device, i.e. it supports all the libraries and USB classes.
Some other MCUs have "USB Device" stated in it, eg. STM32L052
enter image description here

Then I tried to check CubeMX and found out that there is USB_Device peripheral in their search(and again STM32F429 does not include it, USB stuff is done through OTG).

It may be quite easy question since I suspect that USB Device simply means the one that does not support OTG, but I am not sure, usually MCUs use OTG anyway(and moreover there is only one library, so why state "NO" in USB peripheral). I couldn't find information about it in google or in CubeMX documentation.

I am not really concerned much about it since USB OTG HS seems to work OK with the library, but I'm wondering about terminology.

I understand that probably ST forum is a better place for this question, but many topics there are just don't get answered or answered after 2 years have past. 🙂

Thanks.

Best Answer

Your thought are correct: the devices that are marked "Yes" in the USB device column are just able to act as a USB device. They don't support the OTG spec, and they are not able to act as a host either.

But of course, any device capable of USB OTG can, on the other hand, act as a simple device. He who can do more can do less.

They identify them in this way because the "USB device", "OTG FS", and "OTG HS" are three different IP cores in the chips. They all have their particular capabilities/specs, and they may require different drivers (as you noticed).

To sum up:

  • USB device: only able to act as a device, at full speed (12Mbps)
  • USB OTG FS: able to act as a device/host/OTG peripheral, at full speed (12Mbps)
  • USB OTG HS: able to act as a device/host/OTG peripheral, at full speed (12Mbps) or high speed (480Mbps). Note that the HS core for [the vast majority of]* ST MCUs require an external ULPI PHY chip to actually support high speed. The on-chip PHY can only do full speed. ...Yes, it's very confusing.

*Edit: It seems ST finally made some efforts to integrate a on-chip high-speed PHY on a few of their newest MCUs (more specifically: some of the STM32F7x3 and STM32F730 versions, at the moment). However, there isn't a specific column that clearly indicates this feature in their device selection table, which again adds to the confusion. You need to look at the datasheet details.

Related Topic