Close

Serial to serial

A project log for Central Scrutinizer: a serial adapter for M1/M2/M3

Open source serial adapter / reboot controller for Apple Silicon Macs

mazmaz 10/17/2023 at 09:540 Comments

These days, a serial adapter is widely understood as a way to convert a TTL serial stream to a more "modern" (read: more pointlessly complicated) protocol. And that's what the Central Scrutinizer does in its most basic incarnation by converting the serial stream to USB CDC. 

However, the good old RS232 is still alive and kicking, specially outside of the embedded environments My test farm, for example, is largely composed of machines that have RS232 interfaces which I connect to my (home made) console server.

There is also a trust issue: It is easier to integrate a pure serial device conforming to the RS323 spec than a USB device running untrusted firmware and potentially capable of tripping interesting bugs on the host side. BadUSB anyone? Of course, *I* trust my code. Who else does? Rhetorical question!

For all these reasons, it is sometimes desirable to trade the convenience of a USB serial port for the robustness and trust of a RS232 connection.

Exposing a Mac serial port over RS232 shouldn't be a big deal: a couple of level shifters, and that'd be it. However, if you want the current behaviour of multiplexing control (such as the reset capability) and data planes over the same channel, you need some on-board processing. Which is fine, as the Pico has two UARTs, and we can use the second one for the upstream connection.

I was looking at fitting a MAX3232 on the Central Scrutinizer when I discovered this add-on board that seems designed for it: https://www.waveshare.com/wiki/Pico-2CH-RS232 A MAX3232, all the required passives, and a bunch of visually annoying LEDs. What's not to like? And it is available almost everywhere (eBay, Pi Hut...).

A couple of software hacks later (all pushed out onto the git repo), we have a full serial to serial bridge. Look Ma, no USB! Well, you still need to apply some 5v somewhere, so you actually need a USB connection. But it can be to a dumb (and trusted) power supply, without any data involved. Oh, and the SW automatically guesses that the RS232 board is connected, so the same build works in all conditions.

A slightly different hack would be to use both RS232 channels and split the control plane from the data stream. Not sure if there is an interest for that though.

In any case, it is pretty amusing to see a modern Mac being accessible over an RS232 connection!

Discussions