2024-02-22 05:56 AM
HI team,
I am using STM32F7 series controller. I want to use USB OTG in dual mode where I want to run USB device and Host on same application. So till now I couldn't find a single application or sample related to this. Can anyone narrow down the path for me how to achieve this.
regards,
Shikamaru
Solved! Go to Solution.
2024-02-22 08:25 AM
Hello @Shikamaru
Unfortunately, there is no example or demo for this dual role device on STM32F7. OTG requires additional circuitry to support the protocols, called HNP and SRP as explained in the reference manual. With reference boards dedicated to F7, I guess this would not be achievable.
However, if you want to learn more about USB PD dual role application, here is a ST wiki to help you step by step create your dual role application.
STM32StepByStep:Getting started with USB-Power Delivery Dual Role - stm32mcu
I hope this helps!
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.
2024-02-22 08:25 AM
Hello @Shikamaru
Unfortunately, there is no example or demo for this dual role device on STM32F7. OTG requires additional circuitry to support the protocols, called HNP and SRP as explained in the reference manual. With reference boards dedicated to F7, I guess this would not be achievable.
However, if you want to learn more about USB PD dual role application, here is a ST wiki to help you step by step create your dual role application.
STM32StepByStep:Getting started with USB-Power Delivery Dual Role - stm32mcu
I hope this helps!
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.
2024-02-22 04:59 PM
It is not possible to run Device and Host "at the same" time. The ID pin would tell the direction. And as Host you have to provide power, as Device you get it from host (PC). No possible, not intended.
If your MCU is Host and would provide VBUS - but you connect it to a PC which "thinks" your MCU is a Device - you have a POWER conflict!
You could change the role, depending on what is connected (e.g. via the ID signal or if you see VBUS powered) to Device or Host (but not both at the same time!).
You might need to deal with USBC-PD inside the chip (for USB PWR handling). And you need external components, like an USBC-PD chip, a power switch for VBUS.
2024-02-22 10:56 PM - edited 2024-02-22 11:01 PM
@tjaekel wrote:It is not possible to run Device and Host "at the same" time. The ID pin would tell the direction. And as Host you have to provide power, as Device you get it from host (PC). No possible, not intended.
If your MCU is Host and would provide VBUS - but you connect it to a PC which "thinks" your MCU is a Device - you have a POWER conflict!You could change the role, depending on what is connected (e.g. via the ID signal or if you see VBUS powered) to Device or Host (but not both at the same time!).
You might need to deal with USBC-PD inside the chip (for USB PWR handling). And you need external components, like an USBC-PD chip, a power switch for VBUS.
Exactly, this is what am also planning, depending on the ID signal will decide which is device and host then I will initialize the stacks of device or host. Do we have any samples for this ?
If not then I am planning this way, first will make sure only device is working fine then same goes for Host only. At final will merge those two and build a stand alone project which has both of them. how about this method ?
regards,
Shikamaru
2024-02-22 10:58 PM
@FBL wrote:Hello @Shikamaru
Unfortunately, there is no example or demo for this dual role device on STM32F7. OTG requires additional circuitry to support the protocols, called HNP and SRP as explained in the reference manual. With reference boards dedicated to F7, I guess this would not be achievable.
However, if you want to learn more about USB PD dual role application, here is a ST wiki to help you step by step create your dual role application.
STM32StepByStep:Getting started with USB-Power Delivery Dual Role - stm32mcu
I hope this helps!
Thanks @FBL , got it.
2024-07-24 05:34 AM
Abysmal USB support from STM as usual. If ST don't make good driver support available I doubt the MCU department will prosper over the decade ahead given the competition.
2024-07-24 05:36 AM
Its pretty simple, there are 2 status lines to set on USB-C to configure the mode, and a small VBUS IC or FET to power external device when in Host mode.
What abysmal is the lack of support from ST as usual.
2024-07-24 06:47 AM
Hi @Robmar
We may recommend different USB stacks from Tuxera partner for example, which may be helpful. Tuxera USB Stack - USB Host & Device and OTG stacks with wide range of class drivers for STM32 - STMicroelectronics
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.
2024-07-24 09:40 AM
I've checked their web and they don 't publish their license costs, so I'm guessing for small-medium volumes the price is going to be too high.
Raspberry Pi embedded boards are the only option we now have given ST aren't interested in providing USB OTG drivers, and the prices are very affordable.
2024-07-25 03:15 AM - edited 2024-07-25 03:16 AM
The hardware is easy, but I wrote about ST not providing an USB OTG dual role driver, there are numerous posts complaining about a lack of support.
FBL from ST said customers can buy a driver from Tuxera, but they haven't even bothered to reply to our email, and we're a business!
So there you go, read posts a bit more carefully nextime.