16
\$\begingroup\$

Up until USB C all the USB connectors were carefully chosen so that two hosts could not be plugged into each other.

With USB C both the host and device have the same connector. With this setup it is now possible to plug two hosts into each other. USB C does use an active cable which I assume arbitrates connections preventing any electrical damage.

I assume one of three things could happens.

  1. Nothing at all
  2. An error "don't do this" or something like that
  3. A connection is established with one host submitting as a device to the other host. (seems unlikely)

What happens? Is it one of my propositions or something completely different?

\$\endgroup\$
1
  • \$\begingroup\$ Interesting question, unfortunately I haven't got the time to find out. It does raise another question though; are there any devices that are host-only USB-C? \$\endgroup\$
    – Puffafish
    Commented Sep 2, 2016 at 13:19

4 Answers 4

22
\$\begingroup\$

The answer depends on whether the host ports are regular host ports, or "Dual-Role Ports" (DRP), at least one of them.

If both ports are regular host ports, nothing will happen, so (1) is true. (because both ports will have pull-ups on CC pin, and this will not trigger any host reaction, VBUS will not be asserted).

If one of the ports (like in some modern tablets/phones) is DRP, the DRP port will alternate its CC function trying to pretend as host, then as device, and so forth. Depending on the other port, right connection will be established. So the answer is (3).

If both ports are DRP, the (3) is still true, just the role of devices will be determined at random, depending on cable plug-in time relative to CC cycle.

These are SPECIFICATIONS for the Type-C connector.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ One amendment to this: Most DRPs are configured as Try.Source or Try.Sink. Only when they are the same is it random, if one has a source preference and one has a sink preference they will always arrange themselves in that manner. \$\endgroup\$
    – crlanglois
    Commented Dec 4, 2017 at 18:43
  • 2
    \$\begingroup\$ @crlanglois, there are two kind of "roles" in Type-C framework, one is "host-device" role, and another is ""provider-consumer", or "source-sink". I was talking about "host-device" dual role switch. You apparently mean power roles, and they obviously can have different priorities/preferences. \$\endgroup\$ Commented Dec 5, 2017 at 0:09
7
\$\begingroup\$

According to here, nothing bad will happen as long as both USB Type-C ports work to the specification. So option (1) of your list.

To summarise that blog post in case the link ever dies, he essentially explains section 2.3.1 of the Type-C specification:

Section 2.3.1 of USB Type-C Spec Image from the linked blog post.

What this says is that unlike earlier USB ports, the USB Type-C specification mandates that power is not applied to the port until CC pin detection is complete. There are basically two pins in the USB Type-C cable which can be used to passively detect whether a device is a host or a slave using resistors without enabling the VBus supply.

Only once a host (DFP) detects that a slave (UFP) has been attached will it start enumeration and enable the VBus supply.

As a result, when you plug two compliant hosts together, nothing at all will happen as neither detects a slave on the other end, so power is not applied (preventing shorting of supplies) and no signalling is performed (preventing bus contention). This would be option (2) from your list.


If however the device is a (cheap) clone of something which is non-compliant to the specification, who knows what will happen. If for example you get a USB Type-C phone charger and it isn't designed to spec, it may always enable the bus voltage, which could cause damage. That is just speculation though.

\$\endgroup\$
1
  • \$\begingroup\$ As per your prediction, the link has died. \$\endgroup\$
    – Robin
    Commented Apr 18, 2020 at 9:39
3
\$\begingroup\$

USB C does use an active cable which I assume arbitrates connections preventing any electrical damage.

USB-C does not require active cables.

I assume one of three things could happens.

  1. Nothing at all

  2. An error "don't do this" or something like that

  3. A connection is established with one host submitting as a device to the other host. (seems unlikely)

What happens? Is it one of my propositions or something completely different?

Having plugged two computers together by a USB-C cable before I can say all of the above are possible. My Macbook Pro when plugged into a Windows desktop computer will start charging. There's no data connection but the laptop will draw power. Plugging two MacBooks together by a USB-C cable will create a data connection as both computer's USB-C ports support Thunderbolt. This can used to create a fast Ethernet-like connection, or be used to connect an Apple computer in target disk mode to another computer and allowing the host computer to access the Apple computer's drive as if it's a Thunderbolt or USB drive. Some computers might give some kind of error in that there's no driver for the attached device. Some computers will do nothing at all.

I know this is an old question, I posted mostly to correct the point that USB-C cables must be active. There are USB-C cable with "e-markers" to identify the cable to the devices but since these electronic identifiers are not in the data path they are still considered passive cables. There are active USB-C cables which can extend the length of a USB or other protocol beyond the length possible by passive cables. There are USB devices that have captive USB-C connections for two host that look and act like a cable in many ways but because the active part of the cable appears as a device to both computers these are not technically a cable.

\$\endgroup\$
1
\$\begingroup\$
  1. would happen or random role

In addition to what @Ale..chenski said, I strongly suggest you to read through section 4.5.1.4 and 4.5.1.4.1 of the USB Type-C Spec. It describes USB Type-C State-Machine-Based Role Swapping.

In summation, there are state machines that let a DRP which is destined as a source become a sink when connected to another DRP in Source mode and vice versa.

The specification describes the Try.SRC and Try.SNK state machines give an example:

A USB Type-C DRP-based product may incorporate either or both the Try.SRC and Try.SNK swap mechanisms to affect the resulting role. Try.SRC allows a DRP that has a policy-based preference to be a Source when connecting to another DRP to affect a transition from a destined Sink role to the Source role. Alternately, Try.SNK allows a DRP that has a policy-based preference to be a Sink when connecting to another DRP to affect a transition from a destined Source role to the Sink role.

The example; Laptop (DRP) mobile phone (DRP):

For example, a small mobile device that prefers being a Sink or UFP should implement Try.SNK, so that when attached to a DRP system such as a laptop, the mobile device will always be the power sink. If the mobile device is connected to a Sink-only port partner, the Try.SNK method will fail, and the mobile device will end up in the Source role. If the mobile device is connected to a port partner that also implements Try.SNK, the mobile device will randomly end up in either a Source or Sink role.

\$\endgroup\$
1
  • \$\begingroup\$ The question is now: Which component realizes this? The CC controller, the cpu, the usb controller (in our case this component only has D+ D- ports, so is it maybe outdated? \$\endgroup\$
    – MichaelZ
    Commented Jan 23, 2023 at 7:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.