TX vs RX naming conventions for USB 3.0 SuperSpeed pairs

Just a draft note for now, as a result of a mistake I made while designing a USB 3.0 board featuring a male USB type-C plug soldered directly to the board I designed!

A classic problem with the TX and RX lines of UARTs & RS-232 systems is that the “TX” and “RX” nomenclature is a little bit open to interpretation — at some point the wire that is labelled “TX” because it was transmitted by one device gets a new name “RX” as we approach the device that is receiving the signal. If we’re lucky, the lines are labelled something more useful like “FromMCUToPC” or whatever.

But how are the TX+/- vs RX+/- pairs in USB 3.x connectors handled? Based on my interpretation of the USB Type-C Spec, the “naming flip” happens within the USB cable. (I haven’t check thoroughly, but it seems to be the same for Type-A and -B connectors and cables too.)

More specifically, a device transmits into the TX+/- pins (A2, A3*) of a type-C receptacle, which connects to identically named pins in the type-C plug on the cable. But within the cable, pins A2 and A3 at one end of the cable are not routed to pins A2 and A3 at the other end of the cable. Instead, pins A2 and A3 (named TX1+ and TX1-) at one end of the cable are wired through to pins B10 and B11 (named RX1+ and RX1-) at the other end of the cable.

This allows designers of USB 3.0 devices to be pretty naïve and ignore the inherent ambiguity of the “TX” and “RX” naming of the pins — it’s always named with respect to the “nearest” device (i.e., the device that isn’t at the other end of the cable.) In other words, always connect “TX” to “TX”.

That is, unless you have a male plug soldered directly to your board! That what I did, naively connecting the TX pins of a male Type-C plug to the TX pins of the device on the board. USB 2.0 was working, but USB 3.0 wasn’t. After a day of debugging, I realized this was the mistake.

It’s normally the responsibility of the cable to “switch” the TX and RX pins at either end of the cable. But more generally, it’s actually the responsibility of the male plug — whether that’s the male plug on a standard cable, or a male plug soldered directly to a circuit board. One way to figure out what to do is to fully map out how the wiring would work if you had a receptacle and a male-to-male cable — and once that is fully figured out, then carefully factor the cable and receptacle away. But if I’ve figured it out correctly, this is the (abridged) pinout you should be using in that scenario (for single-lane, e.g. USB 3.2 Gen 2x1):

  • CC (A5) — 5.1k to GND
  • “TX1+”/”TX1-” (A2, A3) — USB 3.x data entering your PCB — so should be wired to RXp/RXn on your IC. (Positive and negative can be switched if you like).
  • “RX1+”/”RX1-” (B10, B11) — USB 3.x data leaving your PCB — so should be wired to TXp/TXn on your IC. (Positive and negative can be switched if you like).
  • “D+”/”D-” (A6, A7) — USB 2.0 data, bidirectional. Wired to Dp/Dn on your IC. (Positive and negative must not be switched).

(Incidentally, it’s the responsibility of the receptacle to observe what’s going on on the CC1/CC2 pins and use a mux to “unflip” the TX1 vs TX2 lines and RX1 vs RX2 lines accordingly. One of the benefits of designing a device with a captive male cable or a male plug soldered directly to the board is that you get to control the position of the CC lines yourself, so you don’t need the muxes.)

One final trick: if you’re designing a USB hub, just do a sanity check where you see what would happen if you plugged one of your hubs into another of your hubs. If I had checked that, I would have noticed that the TX lines were plugged into the TX lines, and might have realised the conflict!

* Assuming the CC line of the cable is presented to A5.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *