22

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?

ocrdu
  • 8,705
  • 21
  • 30
  • 42
NessDan
  • 343
  • 1
  • 2
  • 6
  • 20
    i have one of those ... it is just a USB extension cord ... it works just fine – jsotola Jun 19 '19 at 00:54
  • I have a few of those too. – DKNguyen Jun 19 '19 at 04:17
  • 5
    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. – Russell McMahon Jun 19 '19 at 06:40
  • 4
    @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. – Graham Jun 19 '19 at 10:57
  • 1
    @RussellMcMahon Who said anything about male-to-male? – David Richerby Jun 19 '19 at 11:32
  • 1
    What @jsotola said. This style of cable is uncommon, certainly, but it's not _never_ used. – aroth Jun 19 '19 at 12:14
  • @DavidRicherby If it's unspecified then it's MM or MF or FF. Alex has covered the M-F case. MM was the other likely candidate so I addressed it. FWIW. FF is yet to be addressed :-) – Russell McMahon Jun 19 '19 at 12:14
  • 5
    @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 ... – Russell McMahon Jun 19 '19 at 12:24
  • 2
    @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**](https://www.meanwell.com/Upload/PDF/RSP-320/RSP-320-SPEC.PDF) 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". – Russell McMahon Jun 19 '19 at 12:25
  • Note that "micro-usb" is actually "micro-b usb". (In other words, aside from extension cords, USB always went from A to B, even when the B connectors got smaller. Of course, the coming of C changed this situation as backwards compatible cables connected A to C.) – Jasper Jun 19 '19 at 15:17
  • USB A Male to USB A male is popular when using cable adaptors. – Steven Jan 01 '21 at 07:55
  • I have an external USB hard disk drive adapter that has two USB-A male connectors in parallel so that it can provide twice the usual current for the drive if needed. It's not dangerous, as the male (and female) USB connectors have only an exposed shield shell and it takes effort to contact the active terminals. – PStechPaul Jul 28 '22 at 03:33
  • @PStechPaul What makes A-to-A cables dangerous if they violate the spec is not that there would be exposed contacts, it's that they can short out a computer power supply. This can produce more current than the cable is built to handle and produce a fire hazard. – MacGuffin Jul 28 '22 at 08:50
  • A well designed USB port will have some sort of current limiting that would certainly kick in before hazardous currents flowed. – PStechPaul Jul 28 '22 at 19:55

7 Answers7

45

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.

alex.forencich
  • 40,694
  • 1
  • 68
  • 109
  • 1
    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! – NessDan Jun 19 '19 at 02:56
  • 4
    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. – guntbert Jun 19 '19 at 10:57
  • 1
    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. – Erlkoenig Jun 19 '19 at 11:09
  • 3
    @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) – ThreePhaseEel Jun 19 '19 at 11:40
  • 8
    @ThreePhaseEel Mechanical design raisins are my least favorite dried fruit. – Tashus Jun 19 '19 at 14:33
  • 1
    The USB 3.1 legacy cable assembly specification defines how to construct a spec compliant A-to-A cable. See section 5.5.2 in the linked document: https://usb.org/sites/default/files/USB%203.1%20Legacy%20Cable%20and%20Connector%20Revision%201.0.zip These cables are safe because they leave the power pin as open circuit. Not all A-to-A cables leave the power pin unconnected, but to do so they violated the spec. This is not new, it's been in the spec for over a decade. – MacGuffin Jul 27 '22 at 15:05
  • @MacGuffin probably 99.9% of the A to A cables have the power connected. Sure, you can make one that's compliant, but it won't work any of the devices that use USB A connectors and expect to be powered over USB. – alex.forencich Jul 27 '22 at 18:22
  • @alex.forencich If 99.9% of cables are not compliant then it is incorrect to say all A-to-A cables violate the spec. It may be correct to suggest using an A-to-A cable is dangerous, and that nobody should use them because of the risk of damaging hardware, but it is not correct to say that compliant cables do not exist and cannot exist. Also, it is incorrect to say the USB spec does not allow host-to-host connections as I can show in the spec where it is explicitly allowed. It may be true that no OS supports this but it is allowed in the spec, and that has been allowed since November 2008. – MacGuffin Jul 27 '22 at 19:59
  • Ok, I suppose I should edit that to say all commonly available A to A cables are not compliant with the spec. Literally every single A to A cable that I have come across has the power connected, and hence is not compliant. And many of these cables are also USB 2, not USB 3. And if the vast majority of A to A cables are not compliant, with no easy way to tell if it's compliant or not, then using a random one when you need a compliant one is likely to be dangerous. – alex.forencich Jul 27 '22 at 20:08
  • There you go, I added a footnote to clarify that yes, you can technically make one that's compliant, but these cables are extremely rare. – alex.forencich Jul 27 '22 at 20:36
  • @alex.forencich While that edit is helpful in correcting one error I can point to more errors. USB-A/male to USB-A/female cables are not "fine", they violate the USB spec. Microsoft does support USB host-to-host communications for kernel mode debugging, proving it incorrect to state no software stack supports this. There's more that is incorrect, or at least potentially misleading. Perhaps I'll attempt my own edits later, but then when or if I'm done then it's not going to be what people voted as useful or accepted as an answer. – MacGuffin Jul 28 '22 at 09:16
  • USB 3.1 standard-A to USB 3.1 standard-A cable assembly does exist and is clearly stated in USBIF document "USB 3.1 Legacy Cable and Connector Revision 1.0". Nvidia shield TV does use this cable to connect shield to PC for transfer files or fastboot. See link:https://www.nvidia.com/en-us/shield/support/shield-tv-pro/how-to-transfer-content-to-shield/. – iouzzr Oct 25 '22 at 02:17
  • @iouzzr yes, apparently it is legal to have a USB 3 cable with A type ports on both ends, so long as the POWER is not connected so that it is safe to use. But it is impossible to know if a cable is wired this way without pulling out a DMM, and 99% of the A to A cables on the market are noncompliant either by being USB 2 cables, or by connecting the power as well as the high speed data lines. – alex.forencich Oct 26 '22 at 03:43
  • After I got a noncompliant USB 3.0 A to A cable with both VBUS, DP, DM connected, I tried to make it compliant by cutting these three signal wires. To my surprise, Nvidia Shield didn't like this compliant cable. I didn't have the chance and courage to see if Shield like the original noncompliant cable. I think Shield developers just know this USB A to A cable fact, so they just assume it is noncompliant. For example to connect to PC, you have to set an option in the shield settings to make an USB port connect to PC only. And for fastboot, you have to press controller A&B button during startup. – iouzzr Oct 28 '22 at 11:10
15

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.

Hearth
  • 27,177
  • 3
  • 51
  • 115
  • 1
    Brownie points if you can list the spec :) That is, if you want to pay a million dollars for the entire document LOL. –  Jun 19 '19 at 01:01
  • 1
    @KingDuken Somehow I don't think that crowdfunding campaign will take off. – Hearth Jun 19 '19 at 01:02
  • 11
    You can just download the spec from the USB-IF for free: https://usb.org/documents – Erlkoenig Jun 19 '19 at 11:39
  • 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. – MacGuffin Jul 27 '22 at 14:47
  • 2
    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. – alex.forencich Jul 27 '22 at 20:37
9

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

MacGuffin
  • 919
  • 6
  • 7
  • 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. – alex.forencich Mar 15 '21 at 21:02
  • @alex.forencich " I don't think these cables actually exist. " They exist: https://www.datapro.net/products/usb-3-0-super-speed-a-a-debugging-cable.html 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. – MacGuffin Mar 16 '21 at 16:13
  • "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) – Ben Voigt Jul 27 '22 at 21:21
  • @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: https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/setting-up-a-usb-3-0-debug-cable-connection – MacGuffin Jul 28 '22 at 07:12
  • @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. – Ben Voigt Jul 28 '22 at 15:22
  • @BenVoigt "it probably means OTG circuitry." It does not. It means it supports debugging. That means there is a buffer in the USB controller that accepts debugging information from the CPU, or something of that nature. USB-OTG requires the use of an ID pin to inform a device if it is to be in host or peripheral mode, and USB-A does not have that ID pin. There is also nothing in the USB 3.x spec that references OTG, that is an optional extension to USB 2.0 only. Host to host communications is different, and applies to USB 3.x. If I'm incorrect then cite a source. – MacGuffin Jul 28 '22 at 15:41
7

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.

TimWescott
  • 44,867
  • 1
  • 41
  • 104
  • "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. – Dmitry Grigoryev Sep 26 '19 at 09:18
  • 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. – MacGuffin Jan 24 '22 at 03:28
0

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.

Gaz
  • 1
  • 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. – Hearth Jan 24 '22 at 00:56
  • 1
    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. – MacGuffin Jan 24 '22 at 03:26
0

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

  • 2
    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. – Justme Oct 17 '22 at 21:43
  • @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. – MacGuffin Oct 17 '22 at 22:32
0

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.