Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

trouble setting up serial console

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Bouwser
Posts: 13
Joined: 2014-09-04 14:12

trouble setting up serial console

#1 Post by Bouwser »

Hello,
I recently installed Debian 9 Linux version 4.9.0-4-amd64 on an ARK1123 SBC. I am trying to get a serial console to work and am having trouble. It only "sorta" works. When I connect the serial port of my SBC to a laptop and run a terminal program, I see the grub boot menu and then I seen some of the startup messages, but I never get to the login prompt. I know it is booting because a monitor plugged into the VGA port reaches a login prompt.

Any help is greatly appreciated,
Brent


Below is my grub file. I also have run "grub-mkconfig -o /boot/grub/grub.cfg" after editing the file.

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0, 115200"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"


Here is the output that I see on the terminal screen after the grub menu.
Loading Linux 4.9.0-4-amd64 ...
Loading initial ramdisk ...
[ 15.271547] 00:03: ttyS0 at I/O 0x240 (irq = 11, base_baud = 115200) is a 16550A
[ 15.299764] 00:05: ttyS1 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 15.308025] hpet: number irqs doesn't agree with number of timers
[ 15.314285] Linux agpgart interface v0.103
[ 15.318711] AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>
[ 15.324786] AMD IOMMUv2 functionality not available on this system
[ 15.331574] i8042: PNP: No PS/2 controller found. Probing ports directly.
[ 16.368035] i8042: No controller found
[ 16.371877] tsc: Refined TSC clocksource calibration: 1333.333 MHz
[ 16.378417] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x13381e82524, max_idle_ns: 440795248224 ns
[ 16.389062] mousedev: PS/2 mouse device common for all mice
[ 16.394843] rtc_cmos 00:00: RTC can wake from S4
[ 16.399767] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
[ 16.405982] rtc_cmos 00:00: alarms up to one month, y3k, 242 bytes nvram
[ 16.412787] intel_pstate: Intel P-state driver initializing
[ 16.419208] ledtrig-cpu: registered to indicate activity on CPUs
[ 16.428329] NET: Registered protocol family 10
[ 16.434834] mip6: Mobile IPv6
[ 16.437859] NET: Registered protocol family 17
[ 16.442382] mpls_gso: MPLS GSO support
[ 16.447734] microcode: sig=0x30679, pf=0x1, revision=0x901
[ 16.453570] microcode: Microcode Update Driver: v2.01 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[ 16.462966] registered taskstats version 1
[ 16.467195] zswap: loaded using pool lzo/zbud
[ 16.472233] ima: No TPM chip found, activating TPM-bypass!
[ 16.478728] rtc_cmos 00:00: setting system clock to 2018-02-22 19:15:42 UTC (1519326942)

Bouwser
Posts: 13
Joined: 2014-09-04 14:12

Re: trouble setting up serial console

#2 Post by Bouwser »

Found my solution. Setting the Baud Rate in the grub file does not actually change the baud rate of the serial port. The serial port has to have its baud rate set independently. This can be done manually with the stty -F /dev/ttyS0, but this setting does not save through a reboot. The default baud rate is 9600. My options were either to use the default baud rate of 9600 or cause the baud rate to change on start up. 9600 is really slow, so I choose to cause the baud rate to change on startup.
The correct way to do this seems to change every 18 months, so Google is filled with many outdated ways of doing this. The way that worked for me in Debian Stretch is to create a file in /etc/udev/rules.d called serial_console.rules, that said this...

KERNEL=="ttyS1", RUN+="/bin/stty -F /dev/ttyS0 115200 raw -echo"

Post Reply