PCIe For Hackers: External PCIe And OCuLink [Hackaday]

View Article on Hackaday

We’ve seen a lot of PCIe hacks on Hackaday, and a fair few of them boil down to hackers pulling PCIe somewhere it wasn’t meant to be. Today, we routinely can find PCIe x1, x2 and x4 links sitting around in our tech, thanks to the proliferation of things like NVMe SSDs, and powerful cheap SoCs that make PCIe appear at your fingertips.

In the PCIe For Hackers series, we’ve talked about PCIe and how cool it is, all the benefits it has for hackers, gave you layout and interconnection rules, and even went into things like PCIe switches and bifurcation. However, there’s one topic we didn’t touch much upon, and that’s external PCIe links.

Today, I’d like to tell you about OCuLink – a standard that hackers might not yet know as an option whenever we need to pull PCIe outside of your project box, currently becoming all that more popular in eGPU space. Essentially, OCuLink is to PCIe is what eSATA is to SATA, and if you want to do an eGPU or an external “PCIe socket”, OCuLink could work wonders for you.

Respectable Capabilities

Just like any high-speed standard, PCIe has some tight requirements when things get fast. Even though PCIe is known to be not as sensitive to lower-quality links due to its link training and generation downgrade abilities, at higher link speeds, even through-hole vs SMD sockets can make a difference. So, if you want to go high-throughput, you want proper cabling and connectors, intended for out-of-chassis use – and OCuLink gives you all of this, at a low price.

OCuLink is pretty unprecedented when it comes to officially supported hardware for pulling PCIe links externally. There’s Thunderbolt, sure, but it has to convert PCIe into packets on a Thunderbolt link, so you can’t do a no-nonsense direct wireup and need proprietary tech, making you spend $100 or upwards on each end of the link. Your SoC likely doesn’t have Thunderbolt support, and that’s a good thing given just how much of a walled garden it still is.

OCuLink can give you a 4x or 8x PCIe link using 4i and 8i options respectively, with cheap connectors, reliable cables, plus, a lively and growing ecosystem. It is also a good demonstration of what you need to pull PCIe outside of comfortable enclosures it typically inhabits, and, it’s a reasonably open standard for all it provides. Let’s dig in!

Accessible Mechanics

First of all, what you want for such a standard is a well-defined pinout, a friendly connector, and abundance of connectors and cables in the real world. OCuLink hits all of these points, and, there’s a trove of hardware on places like Aliexpress and Amazon. If you have an M.2 M-key socket with a 4x link free, you can easily pull it out of your device through an OCuLink cable – there are $20 M.2 cards with OCuLink sockets on them. The same goes for desktop PCIe slots – there’s no shortage of cheap adapters.

From the looks of it, you wouldn’t want to crimp your own OCuLink cable – and you don’t have to. There’s cables easily available online, too, in different lengths and link widths – SFF-8611 and SFF-8612 are good keywords for anything OCuLink. They’re seriously cheap, you can get one for $10-$20. The cables are quite a bit more stiff than USB-C Thunderbolt-capable cables. Nevertheless, they’re easy to use, and there are even latching connectors in case you don’t want sudden disconnect.




OCuLink connectors look a bit like DisplayPort, and, they’re easy to find online. Just like USB-C, they have two sides, top and bottom, and the pin pitch makes it a requirement to do a two-row connector. You won’t see a SMD + THT version like we often get with USB-C sockets, sadly – you’ll have to do “pads under the package” stenciling and reflow. That said, it’s well within the range of a standard hot air gun and a bit of paste, or maybe even just iron-tinned pads and some flux!

Some Extra Circuitry

There are no power rails in the OCuLink pinout, which makes sense – that would’ve been an entire rabbit hole, given how varied PCIe devices can be. You’ll want to take care of power separately, and the same might just be the case for the REFCLK clock pair – it’s not included in the standard pinout. It’s possible to get REFCLK through OCuLink cables, and there are pinouts that use VSP pins for clock, so if your downstream device can’t recover clock from PCIe data, that’s what you might end up doing.

If you want to pull PCIe over a longer distance and make it more hotplug-friendly, you will also want a PCIe retimer. It will recondition your PCIe signal, helping it recover from any losses caused by the cable and the connectors involved. Often, a retimer will also provide some ESD protection as a bonus – if you want to do hotplug, remember that PCIe goes directly to a CPU/chipset/SoC as a rule and it usually has less strong ESD diodes, which makes it a pretty ESD-sensitive part of a system!

There’s also documentation from PCI-SIG themselves that you might be able to find online if you want it; on the practical side, there are many community-aggregated resources. Plus, people are doing DIY OCuLink adapters more and more, and the pictured adapter is open-source, even! I hope that, whoever reads this, takes care to open-source their projects – reference designs are always useful and allow everyone to build increasingly cool things!

Ever Growing And Worth Knowing

In production, OCuLink has been used a lot in modern servers, where it’s not uncommon to want PCIe half a meter away from the chipset, wired up to something like a bay full of NVMe drives. As tech trickles down, it’s also gaining more adoption in laptop space! Currently, it’s being used by eGPU tinkerers, with people adding OCuLink sockets to devices like GPD mini laptops, or full laptops like the Lenovo Thinkbook, with the latter sporting a third-party adapter option that hijacks a Logitech receiver socket Lenovo added in.

You can still put PCIe over USB3, HDMI and USB-C cables – that’s what we used to do before OCuLink! And, if you want a reference for how to do it right, taught by a modern-day ecosystem that does high-bandwidth connection without breaking a sweat, the list of OCuLink projects is only becoming larger – which is why you deserve knowing about it as an option.