Labels

31/05/2011

Disable gumstix overo console login message on ttyS2

In my design, I need to use second serial port (ttyS2) on overo.
I connected SDA3 (pin 24 on chestnut43 board) to WinXP hyperterminal, and booted up Overo.
I saw all booting messages are showing in hyperterminal.

----------------------------------------------------------- 
Login timed out after 60 seconds.                                               
                                                                                
.-------.                                                                       
|       |                  .-.                                                   
|   |   |-----.-----.-----.| |   .----..-----.-----.                             
|       |     | __  |  ---'| '--.|  .-'|     |     |                             
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |                             
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'                             
                -'  |                                                           
                '---'                                                           
                                                                                
The Angstrom Distribution overo ttyS2                                           
                                                                                
Angstrom 2010.7-test-20101005 overo ttyS2                                       
                                                                                
overo login: root                                                               
 |  '  | | | |                                                                   
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'                             
                -'  |                                                           
                '---'                                                           
                                                                                
The Angstrom Distribution overo ttyS2                                           
                                                                                
Angstrom 2010.7-test-20101005 overo ttyS2                                       
... 
... 

-------------------------------------------------------------------- 

Then, I run my program (written by Qt), the hyperterminal shows as follow: 

-------------------------------------------------------------------------- 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
... 
... 
------------------------------------------------------------------------- 

in the meantime, the string which sent from Qt program also shows in the screen. 
I only want ttyS2 send the information from my program, not other messages.

With help from Nabble forum, the following is my solution:

Those messages are from the kernel.  U need to change the "console" uboot environment variable, otherwise the kernel will print messages on that serial port.

Take a look at uboot environment variable. to do this ,  boot gumsix, pushed any key to stop it booting from MMC. Then use "printenv" list all u-boot variables. 
------------------------------------------ 
Overo # printenv 
bootcmd=if mmc init; then if run loadbootscript; then run bootscript; else if run loaduimagei 
baudrate=115200 
loadaddr=0x82000000 
console=ttyS2,115200n8 
vram=12M 
dvimode=1024x768MR-16@60 
nandargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.d2 
loadbootscript=fatload mmc 0 ${loadaddr} boot.scr 
bootscript=echo Running bootscript from mmc ...; source ${loadaddr} 
loaduimage=fatload mmc 0 ${loadaddr} uImage 
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr} 
nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr} 280000 400000; boot} 
dieid#=0ef000040000000004035c140d002011 
ethact=smc911x-0 
bootdelay=2 
defaultdisplay=lcd43 
i2cspeed=3,100 
bootargs=console=ttyS2,115200n8 i2c_bus=${i2cspeed} vram=12M omapfb.mode=dvi:1024x768MR-16@6t 
mmcargs=setenv bootargs console=${console} i2c_bus=${i2cspeed} vram=12M omapfb.mode=dvi:1024t 
stdin=serial 
stdout=serial 
stderr=serial 

Environment size: 1279/131068 bytes 
--------------------------------------------- 

the "console=ttyS2,115200n8" means send console login messages to ttyS2.

After that, take a look at /etc/inittab in mmc system on 2G SD card.
-------------------------------------------------
# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:5:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
S:2345:respawn:/sbin/getty 115200 ttyS2
# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  :::
#

1:2345:respawn:/sbin/getty 38400 tty1
-------------------------------------------------------

The last line sets up a login on tty1.  If you have a keyboard (eg. USB keyboard via a powered HUB)  and display connected, then you'd be able to login using those.  I am using a chestnut43 board with LCD, and i can use tty1 on a couple of occasions when I messed up the networking.

the command to change console environment variable are follows:

# setenv console tty1 
# saveenv 
The console setting is passed to the kernel at boot time.  It Only tells the kernel where to send messages;  It does not have anything to do with login terminals as that is handled by inittab and getty.  I can use tty1 because it allows me to see the kernel messages on the LCD during boot. 

No comments:

Post a Comment