by TorKlingberg · 9y ago · 0 comments
If you work on embedded devices you will still encounter serial/RS-232 all the time. Often through USB-to-serial chips, which only adds to the challenge because they are mostly unreliable crap. Then there are about 30 parameters to configure on a TTY. About half do absolutely nothing, a quarter completely breaks the signal giving you silence or line noise, the final quarter only subtly breaks the signal, occasionally corrupting your data.
Still, there is nothing like injecting a bootloader directly to RAM over JTAG, running that to get serial and upload a better bootloader, writing it to flash and finally getting ethernet and TCP/IP up.
Still, there is nothing like injecting a bootloader directly to RAM over JTAG, running that to get serial and upload a better bootloader, writing it to flash and finally getting ethernet and TCP/IP up.
I'm happy to have gotten mostly rid of this. Gone are the days of choosing motherboards based on the LPT support, and praying that the JTAG drivers would work on an OS upgrade.
It's still there, and not going anywhere - the only thing that's past is LPT. Last time I used a Linux-grade Atmel SoC, it had a USB-CDC interface but the chain was still the same: boot from mask ROM, get minimal USB bootloader, load a bootstrap binary to SRAM, use that to initialize external DRAM, then load a flashing applet to DRAM, run it, use that to burn u-boot to flash, and then fire up u-boot's Ethernet & TFTP client to start a kernel from an external server and mount rootfs over NFS. Considering the amount of magic, it worked amazingly well. The whole shebang was packaged into a zip file with a single BAT to double-click and let it do the magic.
As for COM and LPT - FTDI and J-Link changed the embedded landscape forever, and thanks for that.
disclaimer: I'm friends with the BMP manufacturer.
So your sensors can talk across the internet.
From `man socat', which runs on Linux:
(socat PTY,link=$HOME/dev/vmodem0,raw,echo=0,wait-slave
EXEC:'"ssh modemserver.us.org socat - /dev/ttyS0,non-block,raw,
echo=0"')
generates a pseudo terminal device (PTY) on the client that can
be reached under the symbolic link $HOME/dev/vmodem0. An appli-
cation that expects a serial line or modem can be configured to
use $HOME/dev/vmodem0; its traffic will be directed to a modem-
server via ssh where another socat instance links it with
/dev/ttyS0.Does anyone know the reasons why USB was not made backward compatible with RS-232? It would only take a very short negotiation to determine if both endpoints support USB.
To expand a bit, the typical fully compliant RS232 setup has a special level translation IC (for example the MAX232) to deal with the huge voltage range and convert it to something more low voltage digital logic friendly. And that IC usually requires power supply levels that the typical cheap USB device would not have, which means it would have to add more circuits to generate them, adding even more cost to the hardware.
And the USB committee probably figured to be not fully compliant with RS232 would just confuse people, and damage hardware, so it was better to be not compliant at all.
But...
> And the USB committee probably figured to be not fully compliant with RS232 would just confuse people, and damage hardware, so it was better to be not compliant at all.
...you are sadly right.
Man that job was frustrating, but it sure was a lot of fun!
It's a mess at the moment, because there are unauthorized clones of both FTDI and Prolific, and both companies release drivers that purposefully don't work (or worse...brick them) on the clones. But, there's not really a way for the end buyer to know for sure they are buying the real thing.
I use them because they'll go down to 45 baud for antique Teletype machines. They're popular for Arduino applications, and there are lots of cheap breakout boards with 0.100 pins for Arduino interfacing.
I guess on the surface the big thing I really like is device differentiation. Do CP2102Ns have unique serial numbers, or can that free utility burn in info I can use to differentiate?
Going a bit deeper, can I bitbang with it?
(For an interesting side story, search for "ftdigate". At some point FTDI decided they're fed up with copycats and released a new driver pack (through automatic Windows Update) that bricked counterfeit chips. This led to a lot of angry people and number of amusing situations, including someone jokingly submitting a patch to Linux to do the same.)
And with the emergence of USB-CDC, it's not nearly as necessary as it used to be, since most modern OSes support that now.
... whaaa? They're probably the biggest company in that market, closely followed by Prolific (PL2303).
> ...and their chips tended to implement CDC in variously broken ways
No, their chips implement a proprietary protocol. Not CDC at all.