Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2022 21:51:25 -0800
From:      Mychaela Falconia <mychaela.falconia@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        FreeBSD questions <freebsd-questions@freebsd.org>, Kyle Evans <kevans@freebsd.org>
Subject:   Re: Unwanted auto-assertion of DTR & RTS on serial port open
Message-ID:  <CA%2BuuBqYCF0dHsqkDEW2F3FJpQosr0-AHgRm9E6GXuPqZa%2Be4gA@mail.gmail.com>
In-Reply-To: <CA%2BuuBqbE0=-416GaOO8UoBRUB1bJAia_XGHRbOSk6TP7%2Bp4BRw@mail.gmail.com>
References:  <CA%2BuuBqZ=PJMcuWj%2Bz3kGAy0bG=1S8oRXUAaO13PPqTea%2BoS04Q@mail.gmail.com> <b3ca19e-e7b2-92b6-dba1-d9734c2b3a11@nber.org> <CA%2BuuBqbJtZFfPm-jMou9A=57-MGbRHKPzKu2aYn%2B-=A0rSQiPQ@mail.gmail.com> <55AF97D3-5212-4A58-9942-3207A176C179@nimnet.asn.au> <CANCZdfpOEkOxcBsvW7NdGd9i99bo5Dn2LjJUyAV9mex_NHcJVw@mail.gmail.com> <CA%2BuuBqZ-Dpktqi4XFv1D5MA=L8X_Feq3Fo%2BFZoF_gjqrnWVL=A@mail.gmail.com> <CAFYkXj=-PLWCv=vtuco0CqET7J%2B4Cbvcyp0D3t6FM1Rxp9Kv8Q@mail.gmail.com> <CA%2BuuBqbE0=-416GaOO8UoBRUB1bJAia_XGHRbOSk6TP7%2Bp4BRw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello everyone,

I got a happy conclusion to this thread: I just did a test install of
FreeBSD 13.1-RELEASE on a spare laptop, and I tested the CNO_RTSDTR
feature of interest to me.  I used this FT2232D breakout board for my
test:

https://pldkit.com/index.php?_route_=other/ft2232d-module

I connected a USB cable between the FreeBSD machine and the test board
- yup, FreeBSD recognized the FT2232D USB device and created
/dev/cuaU[01] and /dev/ttyU[01], as well as .init and .lock devices.
I then connected my oscilloscope probe to FT2232D ADBUS4 output
(Channel A DTR) and set the scope to trigger on this line going low,
as in below 2.0 V.  Then I did this test command sequence:

stty -f /dev/cuaU0.init -rtsdtr
cat /dev/null > /dev/cuaU0

And the scope never triggered, i.e., DTR output never went low!  In
contrast, if I omit the .init device stty -rtsdtr step, then DTR does
go low (remember, it's LVCMOS, not RS-232 here) when the regular
device is opened.  So the CNO_RTSDTR feature in FreeBSD really does
fully solve the problem of unwanted DTR & RTS assertion - but it works
thusly only because FreeBSD has those .init devices, hence a mindless
port of the CNO_RTSDTR termios flag to Linux, as one Linux maintainer
was proposing, would NOT work in a satisfactory manner - because Linux
lacks ttyXX.init and ttyXX.lock devices.

FreeBSD is now the first - and so far only - Unix-style OS that makes
it possible to operate on serial ports without auto-asserting DTR and
RTS, fixing the design flaw that goes back to 1970s UNIX.  I shall now
take this data point and go back to Linux kernel maintainers, and
start mounting the pressure on them to accept one of the numerous
already existing patch proposals that would enable the same capability
in Linux.

M~



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BuuBqYCF0dHsqkDEW2F3FJpQosr0-AHgRm9E6GXuPqZa%2Be4gA>