cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make an OTG USB connection to an STM32H753 using a USB Type-C receptacle?

ddomonoske
Associate

I have an STM32H753 using a USB OTG-HS peripheral configured for full speed mode, which is connected to a USB Type-C receptacle. The goal is to connect to a Galaxy S8 where the S8 is the host and the STM is the peripheral. However, this is a Type-C to Type-C connection, so a standard Type-C cable doesn't force the phone to be the host and the pair do not connect reliably. If a Type-C cable is used, then this connection only works if the STM is powered on after the cable has been physically connected to both the phone and the STM. The connection does not work if the STM is already powered on when the cable is plugged in.

What does work 100% of the time is using a Type-C to Micro-B cable with a Micro-B to Type-C adapter on the STM side. The Type-C to Micro-B cable is for USB OTG and it forces the phone to be the host. Based on the USB specs, I believe the cable has a 5.1kΩ pulldown on pin USB-CC1 at the host, and the adapter has a 56kΩ pullup on pin USB-CC1 at the device. I've ordered USB breakout boards to confirm this but haven't been able to do so yet.

I tried to emulate the USB OTG cable-adapter behavior with a Type-C cable by placing 5.1kΩ pulldowns at USB-CC1 and USB-CC2 on the STM side, but I get the performance I originally described above when using a Type-C cable. If I leave USB-CC2 not connected, as some of the specs call out, then the connection never works.

I think a hardware fix would be the easiest, so is there something I'm missing here regarding the physical connection that could make this work with a Type-C cable?

If not, I've separately considered two firmware solutions. First, somehow forcing the STM to be the peripheral regardless of what the CC and/or ID lines are. Second, having a callback that resets the STM when a cable is connected. In this case a full reset of the STM would be acceptable when the cable is connected, although it does seem ridiculous. I'm also open to other solutions, whatever you think would be the easiest to implement.

Thanks for your help,

DW

1 ACCEPTED SOLUTION

Accepted Solutions
CYANG.1
ST Employee

Hi,

If you add two 5.1K ohm resistors on both CC1 and CC2 pins on STM side, it should be ok. I think you may consider other reasons.

B.R.

View solution in original post

1 REPLY 1
CYANG.1
ST Employee

Hi,

If you add two 5.1K ohm resistors on both CC1 and CC2 pins on STM side, it should be ok. I think you may consider other reasons.

B.R.