On Wed, Oct 25, 2023 at 1:35 PM Morgan Aldridge <morg...@makkintosshu.com>
wrote:

> On Tue, Oct 24, 2023 at 5:52 AM Crystal Kolipe <kolip...@exoticsilicon.com>
> wrote:
>
>> On Mon, Oct 23, 2023 at 11:37:10PM -0400, Morgan Aldridge wrote:
>> > I have experimented with the following with no change in the underlying
>> > issue of the terminal showing the login prompt, but each character input
>> > causing the login prompt to be resent:
>>
>> If you short the tx/rx lines at the DE-9 end and then access the serial
>> device using /usr/bin/cu on the OpenBSD machine, does your input
>> reliably each back to you?  Or are some characters lost or garbled?
>>
>> (Obviously remove or disable the ttys line for this test.)
>>
>
> Excellent suggestions!
>
> I have since found the pinouts for the serial cable and successfully
> confirmed the wiring, no shorts to ground or other pins, and no odd
> resistance on any of the connections. That's a good start.
>
> On the terminal, keeping the same 9600 8N1 settings, but enabling local
> echo, and shorting the TX/RX pins gets me duplicated input with no odd
> characters or breaks (AFAICT).
>
> On the OpenBSD side (with getty disabled on the tty, of course), I ran `cu
> dr -l ttyU1 -s 9600` and jumped the TX/RX pins, and confirmed that the
> characters entered were received back without any breaks or odd characters
> (though there's no local echo.) I confirmed that cu(1) is just not echoing
> locally by un-jumping the TX/RX pins and seeing that I did _not_ receive
> the characters entered.
>
>
>> You might need to short rts/cts and dtr/dsr as well depending on your
>> hardware handshaking setup.
>>
>
> I _think_ I have not enabled hardware handshaking, but will test this
> next. Also, having just typed this out, I realize I forgot to test using
> cuaU1 with cu(1), in addition to ttyU1.
>

I haven't gotten to more physical testing yet, but have taken a quick peek
at ukspan.c (see [0]) and noticed that ukspan_param() has a nice,
reassuring "/* XXX flow control? */" comment. That and the fact that it's
not handling any of the flow control related c_cflag masks such as CLOCAL,
CCTS_OFLOW, CRTS_IFLOW, or MDMBUF (see termios(4), specifically [1])
certainly implies that my fiddling with any of those options in /etc/ttys
has not been having any effect. If that's the case, I have some development
work to do... after my aforementioned remaining troubleshooting.

I've not worked on drivers before (aside from adding some device IDs), but
this looks like about the most straight-forward introduction that could
possibly be laid out in front of me.

[0] <
http://cvsweb.openbsd.org/src/sys/dev/usb/ukspan.c?rev=1.4&content-type=text/x-cvsweb-markup
>
[1] <http://man.openbsd.org/termios.4#Control_Modes>

Morgan

Reply via email to