cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 USB OTG Dual Role

Shikamaru
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

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. 

FBL_0-1708618669672.png

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.

View solution in original post

4 REPLIES 4
FBL
ST Employee

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. 

FBL_0-1708618669672.png

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.

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.


@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


@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. 

FBL_0-1708618669672.png

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.