Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 May 2010 17:05:11 GMT
From:      Mayo Jordanov <mayo@oyam.ca>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/147082: Serial ports unusable
Message-ID:  <201005261705.o4QH5Bt2016094@www.freebsd.org>
Resent-Message-ID: <201005261710.o4QHA0Da073369@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         147082
>Category:       misc
>Synopsis:       Serial ports unusable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 26 17:10:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Mayo Jordanov
>Release:        RELENG_8_0, RELENG_8
>Organization:
>Environment:
FreeBSD test.local 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #0: Tue May 25 16:16:39 PDT 2010     root@test.local:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Trying to setup a terminal console on FreeBSD, I ran into problems where the console seems to be offline. I've hunted around and the problem may be related to getty and/or uart.

First, I've enabled serial console in /etc/ttys modifying the ttyu0 line to be:
ttyu0	"/usr/libexec/getty std.9600"	vt100	on secure

checking ps axl, it seems that ttyu0 remains in ttydtd.

Any attempt to talk on that serial line failed. Following that, the setup was changed to
ttyu0	"/usr/libexec/getty 3wire.9600"	vt100	on secure

after the change to 3wire, the 3wire consoles are in ttyin wait state.

That did not get me very far, as almost nothing would make it through to/from the console. However, going through different configurations, I've noticed sometimes when I did `kill -HUP 1`, few characters would make is over to the machine running terminal application. Also, with the 3wire setup, plugging in and unplugging USB devices, the messages generated by kernel when a device gets plugged and uplugged would make it over to the listening machine.

Also, at some point I enabled all 4 ttyu consoles (the machine has 4 com ports), and changing all from std.9600 to 3wire.9600 followed by `kill -HUP 1` would only update ttyu0, having to kill ttyu{1,2,3} manually.

Next, I've changed loader.conf and boot.config to run over serial. In this case, there are no problems, and everything including the boot loader is visible over the serial up to the point where getty (presumably) is started. Following this, running shutdown/reboot, the serial terminal is re-activated at some point and I see the tail-end of the shutdown messages over serial terminal as well.

Next, I've tried simple experiment of connecting just two serial terminals together. Text written on the machine that works never made it to the FreeBSD, and vice versa. When the two machines were connected, checking status of the serial line in kermit on at the terminal application resulsts in:
 Device: /dev/cu.KeySerial1
Speed 9600
 Terminal echo: remote
 Terminal bytesize: 8
 Command bytesize: 8
 Parity: none
 Autodownload: on
 Session log: (none)
 Carrier Detect      (CD):  Off
 Dataset Ready       (DSR): On
 Clear To Send       (CTS): On
 Ring Indicator      (RI):  Off
 Data Terminal Ready (DTR): On
 Request To Send     (RTS): On


and on the FreeBSD side resulsts in:
 Device: /dev/cuau3
Speed 9600
 Terminal echo: remote
 Terminal bytesize: 8
 Command bytesize: 8
 Parity: none
 Autodownload: on
 Session log: (none)
 Carrier Detect      (CD):  Off
 Dataset Ready       (DSR): Off
 Clear To Send       (CTS): Off
 Ring Indicator      (RI):  Off
 Data Terminal Ready (DTR): On
 Request To Send     (RTS): On


Please note that the machine used to test against the FreeBSD machine is known to work with serial terminals on number of computers and devices. I've also tried using secondary machine with same results.

I've tried number of terminal appications, including cu, minicom, kermit, and screen. Kermit settings were:
set port /dev/cuauX
set speed 9600
set carrier-watch off
set flow-control none

As for hardware information on the machine, it is Advantech ARK-3360. The serial ports are detected as:
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
uart0: console (9600,n,8,1)
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
uart1: [FILTER]
uart2: <16550 or compatible> port 0x3e8-0x3ef irq 11 on acpi0
uart2: [FILTER]
uart3: <16550 or compatible> port 0x2e8-0x2ef irq 10 on acpi0
uart3: [FILTER]


>How-To-Repeat:
1) Edit /etc/ttys, do the ttyu0 line reads:
ttyu0	"/usr/libexec/getty std.9600"	vt100	on secure
2) kill -HUP 1
3) Try connecting to it with terminal application

OR
Connect two machines with a serial cable, run terminal application on both. Typing in one should show up on the other.
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005261705.o4QH5Bt2016094>