This is a 40 year old problem that has no solution. All we would need to do is agree on exactly how to do it and set it as a standard.
https://www.eevblog.com/forum/microcontrollers/smart-auto-ba...
This is a 40 year old problem that has no solution. All we would need to do is agree on exactly how to do it and set it as a standard.
https://www.eevblog.com/forum/microcontrollers/smart-auto-ba...
(2) The solution existed for a long time: get a logic analyzer or a scope, then look at the signal. This is pretty simple and very cheap, as sub-MHz logic analyzers are like $10 today.
(3) That said, last time I had an unknown device I was too lazy to find my scope and connect it.. it was much easier to me to try a few bitrates using regular UART util output started to make sense, especially since it's often easy to tell if the bitrate is a bit off or way off.
Everybody uses a USB dongle now to talk to these things anyway, so there’s no reason to stay electrically or logically compatible with RS-232.
Many 1-wire are RS-232 implementations over a "1" wire.
I have my eye on Sony 8K TV and it has RS-232.
If I look at a common MCU, my choices are UART, SPI and I2C. Out of those, UART is the only interface which can easily handle printf-style debug messages without additional protocols. I can manage something with SPI or I2C in a pinch, but this would be non-standard and require special software on PC side. If I really hate UART for some reason I can set up SPI master, but this will just require 2 extra wires and a very special host adapter (all the ones I saw are master-mode).
More expensive micros have CAN and Ethernet. Ethernet is nice but needs magnetics, probably overkill for debug port; plus once you have Ethernet on-board no one is happy with raw frames, so you end up with ARP, DHCP, IP, TCP and lots of memory usage. CAN is pretty cool, but developer tools are overpriced and very bad, and most larger SOCs do not have support for it. Plus you still have to select baudrate for it :)
Sadly, there does not seem to be anything "new" people could agree too... The combined inertia of billions of microcontrollers will keep UART alive forever.
... but hey, if I were a head of R&D for microcontroller company, I'd totally design my own debug protocol. It'd be pulse based (to allow random clock rates but also keep line quiet when there is no output), potentially capacitively coupled (because I hate ground loops), use single signal wire + ground (because debug channel does not need full duplex), have integrated "packet end" mark and predefined packet types for text logs and binary TLV. It'd also have fully open debug tools. But I am not designing my own chips, so I am just using UART.
Microcontrollers do have their own proprietary serial debug protocols. ARM SWD, for example, has been around for almost 15 years. It’s “proprietary”, but being ARM that means it’s in billions of chips from many manufacturers. It does require a clock line, though.
https://www.ti.com/lit/wp/spmy004/spmy004.pdf
I’m suggesting something much simpler though, just keep the UARTs and stick a Manchester encoder/decoder in between.
With UART, you have a single integer to guess, maybe one of the 10 options. And guessing it simple, as data flows even when nothing is connected, so you can trivially find it on the PCB and scope it.
With Ethernet, you have vastly more thing to guess. Starting with Ethernet pinout, then IP address, then port, protocol and authentication. And in most cases, you are not going to be able to passively listen and get useful debug information - while I can theoretically imagine an embedded system configured with netconsole in broadcast mode, I've never seen such configuration in practice.
Yes, Ethernet is very nice if device works, but it's pretty unusable for embedded / early boot debugging.