pxa320: change uart configuration

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Jan 14 06:24:32 EST 2010


On Thu, Jan 14, 2010 at 11:52:25AM +0100, Judith Baumgarten wrote:
> Zitat von Russell King - ARM Linux <linux at arm.linux.org.uk>:
>
>> On Tue, Jan 12, 2010 at 06:30:00PM +0100, Judith Baumgarten wrote:
>>> I want to change the uart configuration of the pxa serial ports in order
>>> to be able to connect to different devices. The problem is, that it jumps
>>> back to its initial configuration, when it receives some data. I used
>>> stty of busybox 1.14.3 as well as the termios-structure to change the
>>> configuration, but it always remained the same. I could protect some
>>> configurations by using the TIOCSLCKTRMIOS ioctl, but the baudrate still
>>> jumps back.
>>
>> Something will be changing it back.  A getty maybe?
>
> We have no getty on our system. Inittab contains just the following entries:
>
> ::sysinit:/etc/init.d/rcS
> ttyS0::respawn:-/bin/sh
> ttyS1::respawn:-/bin/sh
> tty1::respawn:-/bin/sh
> tty2::respawn:-/bin/sh
> ::ctrlaltdel:/bin/umount -a -r
>
> and a "ps ax | grep tty" has no result.

You have two shells - one on ttyS0 and one on ttyS1.  While these are
running on these ports, they will want to control the settings - so
if you try to make use of these two serial ports, you're going to
cause confusion.

Firstly, the shells will fight you with your termios settings.  Secondly,
any received characters will be delivered randomly between the shell and
your program - some characters will be seen by the shell, others will
be seen by your program.

This is just something you do not want to do.  If you want to control a
port, you need exclusive access to it - which means not starting any
other program on the port.  In the case of serial ports, there's a
locking mechanism for programs for serial ports (getty, uucp, minicom,
etc) which involves creating lock files - eg, /var/lock/LCK..ttyS0.

http://tldp.org/HOWTO/Serial-HOWTO.html#toc14.2

covers some of the issues there.



More information about the linux-arm-kernel mailing list