22
\$\begingroup\$

I was wondering why almost all USB cables that exist are USB-A to (Micro-USB | USB-C | USB-B | etc.)

Why was USB-A to USB-A not a popular thing? Is there a technical reason this cannot work?

\$\endgroup\$
14
  • 20
    \$\begingroup\$ i have one of those ... it is just a USB extension cord ... it works just fine \$\endgroup\$
    – jsotola
    Jun 19, 2019 at 0:54
  • 5
    \$\begingroup\$ USB A male to USB A male -> Methaphor: Consider a mains plug male to be the plug on a power cord that plugs into a female wall power socket. Now make a cord with one of these on each end. It will do SOMETHING but maybe not what you expect or want and it has the potential (pun noticed) to be dangerous in some cases. VERY dangerous in the case of mains power appearing on the pins of a male plug. \$\endgroup\$
    – Russell McMahon
    Jun 19, 2019 at 6:40
  • 4
    \$\begingroup\$ @RussellMcMahon But this isn't a mains plug, so your comment isn't valid or helpful. The reason a male-to-male mains plug is dangerous is that it's easy to touch pins at high voltage. USB is low voltage (5V max), so there is no safety risk to users. USB A connectors also cover their connections within a housing, so there is no risk of the connectors inadvertently touching anything else and damaging the USB circuitry or the other equipment. \$\endgroup\$
    – Graham
    Jun 19, 2019 at 10:57
  • 5
    \$\begingroup\$ @Graham Your comment is not valid or helpful :-). A surprising proportion of people are unaware of how critical comments come across and a smaller but deplorably significant proportion of others don't care. Starting off with a manifestly obvious statement followed by a couple of low grade denigrations is a strange way to start out. See following ... \$\endgroup\$
    – Russell McMahon
    Jun 19, 2019 at 12:24
  • 2
    \$\begingroup\$ @Graham ... The 'dangerous to users' aspect was a whimsical end comment and specifically noted "in the case of mains power ..." || However: "Dangerous" does not have to mean "to people" and, as you noted, 5V usually isn't. (The 5V 55A supply with open terminals sitting at my left elbow as I type is a potential exception - although not by reason of shock). USB cables are usually "sexed" in a manner that compells correctness of application A system with MM or FF cables has significant potential for "dangerousness". \$\endgroup\$
    – Russell McMahon
    Jun 19, 2019 at 12:25

7 Answers 7

45
\$\begingroup\$

USB-A male to USB-A female is fine. They exist, and are relatively common. They work just fine as USB extension cables, provided the overall length is not too long. For longer distances, active cables exist that contain an internal repeater or USB hub to regenerate the signal. However, you may run in to power delivery issues due to voltage drop.

USB-A male to USB-A male is dangerous. It is also not compliant with the USB specification*. They also exist, though I am not really sure why. Perhaps because the USB-A connector is shorter than the USB-B connector, so chinese external hard drive enclosure vendors decided to use it because it was a half a cent cheaper than the proper connector. A USB-A male to USB-A male cable is similar to a line cord with a male plug on both ends. You should never, ever use one of these. There are several problems. First of all, USB does not allow two USB hosts to be connected to each other. The software stack does not support it. You cannot simply connect two computers to each other via USB and have them talk to each other without inserting some component in the middle, such as two back-to-back USB to Ethernet converters or similar. USB on-the-go is a slightly different story as a USB OTG device will switch roles between host and device. USB OTG also uses a different connector entirely, an A/B variant that accepts both A and B type connectors, which only exists in the smaller sizes.

But this is not what makes USB-A to USB-A cables dangerous. What makes them dangerous is that the USB cable provides power, and USB hosts are in general not designed to accept power coming in the wrong way. If you connect two computers together with a USB-A to USB-A cable, their 5V supplies are almost certainly not at the same voltage, so one of them will power the other one through the USB cable. This in and of itself is not really a major problem, provided the source has appropriate current limiting to prevent the cable heating up and starting a fire. The problem really comes when one of the devices is turned off. Now, you have an external 5V supply coming in to a powered-off device that isn't designed to handle it. This can damage components on the motherboard in one or both devices. Also, USB devices are in general designed to draw less than 500 mA, but whatever is hanging off of the 5V rail inside a host could draw orders of magnitude more than that.

USB-C is a different story as is specifically designed to have identical connectors on both ends. Not only that, it is explicitly designed to support charging a host device via a USB C connector. As a result, USB C devices have to be designed to handle this situation appropriately.

*except for some extremely rare cables that you will most likely never come across that don't connect the 5V power, which are effectively indistinguishable from non-compliant cables unless you pull out a multimeter.

\$\endgroup\$
14
  • 1
    \$\begingroup\$ Excellent comment, thanks for explaining the history behind this and also delving into why USB-C to USB-C is so common. I appreciate it! \$\endgroup\$
    – NessDan
    Jun 19, 2019 at 2:56
  • 4
    \$\begingroup\$ I own a device (a weather station) with an USB-A socket. So to connect it to my computer I need an USB-A-male to USB-A-male cable. \$\endgroup\$
    – guntbert
    Jun 19, 2019 at 10:57
  • 1
    \$\begingroup\$ USB-A male to USB-A female cables (without an integrated hub) is not defined by the USB specification, but are produced nevertheless. Since USB supports only a maximum cable length because of signal integrity, and such USB-extension cords make it possible to exceed that length, they might not work. USB was (originally) intended such that anything that fits mechanically does work. Non-Standard extension cords (without an integrated hub) subvert this. \$\endgroup\$
    – Erlkoenig
    Jun 19, 2019 at 11:09
  • 3
    \$\begingroup\$ @guntbert -- yeah sighs some derps put USB-A sockets on their devices, either out of cluelessness, or for mechanical design raisins (and not good ones either) \$\endgroup\$ Jun 19, 2019 at 11:40
  • 8
    \$\begingroup\$ @ThreePhaseEel Mechanical design raisins are my least favorite dried fruit. \$\endgroup\$
    – Tashus
    Jun 19, 2019 at 14:33
15
\$\begingroup\$

Because it's against the standard. The USB standard says that type A is for hosts, and type B is for devices.

In practical terms, a device with a type A connector is expected to provide power, so if you connect two of them together, they will attempt to power each other, leading most likely to Bad Things Happening. Type C gets around this by a negotiation mechanism.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Brownie points if you can list the spec :) That is, if you want to pay a million dollars for the entire document LOL. \$\endgroup\$
    – user103380
    Jun 19, 2019 at 1:01
  • 1
    \$\begingroup\$ @KingDuken Somehow I don't think that crowdfunding campaign will take off. \$\endgroup\$
    – Hearth
    Jun 19, 2019 at 1:02
  • 11
    \$\begingroup\$ You can just download the spec from the USB-IF for free: usb.org/documents \$\endgroup\$
    – Erlkoenig
    Jun 19, 2019 at 11:39
  • \$\begingroup\$ USB A-to-A cables do not violate the USB 3.x spec. Such cables are rare because there is not much support for them in common operating systems, and not much need for such cables because Ethernet, WifFi, Bluetooth, and more are common. USB A-to-A cables are mostly used for operating system and other low level software development on devices that don't have other ports available. There's documentation from Microsoft and Linux developers on how to setup an A-to-A cable for debugging. Using A-to-A cables outside of debugging would only require software to make this more accessible to users. \$\endgroup\$
    – MacGuffin
    Jul 27, 2022 at 14:47
  • 2
    \$\begingroup\$ The vast majority of A-to-A cables are not compliant as they connect the 5V power supply. But sure, a small minority might be compliant, and you would need a multimeter to tell the difference. \$\endgroup\$ Jul 27, 2022 at 20:37
9
\$\begingroup\$

USB-A to USB-A cables are in fact legal. It's in the USB 3.x specification and it has been since at least 2011. I clipped the image below out of the USB 3.0 specification document published in June 2011. This cable is safe to connect two hosts together because the VBUS line is not connected. The D+ and D- lines used for USB 1.1/2.0 backward compatibility is also not connected, making this a USB 3.x-only cable. The "superspeed" data lines are crossed over for 5Gbps or 10Gbps data transfer.

It is true that the type A connector is for hosts but what has not been true for years is that host to host connections are not allowed by the USB spec. I do wish this kind of cable was more popular since this would provide a very fast connection with a relatively inexpensive cable. This would be quite useful as well since on some newer computers there aren't many ports except USB. All it should take to make this work for connecting two computers to create a serial-like or Ethernet-like connection is the right software.

USB A to A cable assembly wiring

\$\endgroup\$
6
  • \$\begingroup\$ I don't think these cables actually exist. All of the USB A to USB A cables I have seen connect VBUS and the data pins. And if they did, I would argue that they would be just as dangerous, because there is no way of knowing whether they are connected on a given cable without digging out a multimeter. So if cables built to this standard existed, and people got used to using them to connect two hosts together, then all it takes is one non-standard cable with VBUS connected to cause serious damage. \$\endgroup\$ Mar 15, 2021 at 21:02
  • \$\begingroup\$ @alex.forencich " I don't think these cables actually exist. " They exist: datapro.net/products/… I suspect that it's because there are so many non-compliant cables out there that Apple, Microsoft, Google, and other OS publishers do not support use of these A-to-A cables. That is unfortunate as I see these USB 3.x A-to-A cables would be quite useful if they were supported for host-to-host communications. As it is now these cables are supported only for limited cases, cases where it is assumed the person knows which is the right cable. \$\endgroup\$
    – MacGuffin
    Mar 16, 2021 at 16:13
  • \$\begingroup\$ "All it should take to make this work for connecting two computers to create a serial-like or Ethernet-like connection is the right software". Incorrect. The circuitry is different between a USB host and a USB device. Only USB OTG devices have both (and there's a standard connector for them which permits two different cables, one to connect the OTG to a host, and a different one to connect it to a device) \$\endgroup\$
    – Ben Voigt
    Jul 27, 2022 at 21:21
  • \$\begingroup\$ @BenVoigt The USB spec describes how to connect a USB host to a USB host. I cited the source in my answer, and even included an image of the section in question. On what basis do you claim I'm incorrect? Microsoft even describes how to set up a USB 3.0 host-to-host connection for kernel mode debugging: docs.microsoft.com/en-us/windows-hardware/drivers/debugger/… \$\endgroup\$
    – MacGuffin
    Jul 28, 2022 at 7:12
  • \$\begingroup\$ @MacGuffin: That's not making a connection between two ordinary hosts. Unfortunately Microsoft doesn't say what "host controller that supports debugging" means in USB terms, but it probably means OTG circuitry. \$\endgroup\$
    – Ben Voigt
    Jul 28, 2022 at 15:22
7
\$\begingroup\$

USB pre-3.0 has a host side and a slave side. USB-A connectors are for the host, USB-B are for the slave.

USB 3.0 and above is peer-peer, and the USB-C connector supports that.

\$\endgroup\$
2
  • \$\begingroup\$ "USB 3.0 and above is peer-peer" - no, the structural topology of USB3 is the same as of USB2: a star with one host and multiple devices, possibly connected through hubs. \$\endgroup\$ Sep 26, 2019 at 9:18
  • \$\begingroup\$ The USB 3.0 spec does show peer-to-peer operation. The structural topology is not necessarily the same as USB 2.0, it most often is but its not required to be so. \$\endgroup\$
    – MacGuffin
    Jan 24, 2022 at 3:28
0
\$\begingroup\$

I stumbled across this article when searching for this very type of cable. In fact, I already have one but I need one that is a little longer. They aren't common, but they do exist.

My mini studio mixer has a USB bus for in & out. The USB socket will also take a USB stick to play audio files, or even record audio onto the stick. Both connection options use the same USB (A) socket.

I assume this isn't dangerous as the mixer is mains powered, and therefore the pins that would normally receive 5v of USB power probably aren't connected inside the mixer.

\$\endgroup\$
2
  • \$\begingroup\$ If it can use a USB drive, it has to power the USB drive, so those power pins definitely have to be connected to something. It's possible that it came with a special cable that had the power pins not connected to avoid the problems talked about above. \$\endgroup\$
    – Hearth
    Jan 24, 2022 at 0:56
  • 1
    \$\begingroup\$ You can assume it is not dangerous but it is. If a USB port will power a USB flash drive then it is demonstrably providing power out of the port. If one were to accidentally connect this powered port on the device to a powered port on a host then bad things could happen. The way you describe the use of this device it appears that one might be using the same port to connect to hosts and devices. If so then they did something very nonstandard to prevent damage. \$\endgroup\$
    – MacGuffin
    Jan 24, 2022 at 3:26
0
\$\begingroup\$

They are used in low level programming of devices like security panels and devices. Like Bosch,DMP, fire panels. They can be used with terminal software for command line programming

\$\endgroup\$
2
  • 2
    \$\begingroup\$ The other answers already make clear these USB-A male to USB-A male cables exist and are used even if they should not exist and be used. Your aswer does not even mention if you mean A-A male-male or perfectly legal A-A male-female. \$\endgroup\$
    – Justme
    Oct 17, 2022 at 21:43
  • \$\begingroup\$ @Justme A cable with USB-A/male on one end and USB-A/female on the other end is not a “perfectly legal” cable, it is forbidden in the USB specification. The valid cable and adapter assemblies are defined on page 50 in USB 3.2 Revision 1.1. I’d link directly to the spec but it appears to keep moving on USB.org so any link I give is likely to end up dead shortly after I post this. USB-A/male to USB-A/male cables are in the table of valid cable assemblies, but the wiring is very specific and perhaps counter intuitive to be a valid assembly. Buyer beware as there are many invalid cables. \$\endgroup\$
    – MacGuffin
    Oct 17, 2022 at 22:32
0
\$\begingroup\$

USB male-to-male A-A cables are not common in consumer products because:

  1. they are not specified in the standard before USB 3
  2. they do not provide a visual cue as to their wiring

The lack of visual cue as to wiring and the lack of specification before version 3 could result in unsafe or damaging connections in a consumer context.

However, USB 3 male-to-male A-A cables are an essential part of the hardware toolkit for embedded software developers, but not for "host-to-host connection, such as for operating system debugging" as suggested by the standard, but for device development.

SBC's (single board computers) such as the SolidRun HummingBoard Pulse have a connector with two USB 3 type A female sockets that are wired to a DesignWare3 (dwc3) USB controller in the NXP i.MX8 SoC on which the SBC is based. By modifying the Linux device tree file (the .dts) you can configure the one of these two dwc3 ports to be a USB "device" port. When you do this you can use the SBC to develop a new USB "gadget" (Linux parlance for a USB device) but then to use it as a device you need a USB 3 male-to-male A-A cross cable as defined in the standard or similar.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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