qi: use "\r\n" in serial console?

Harald Koenig koenig at tat.physik.uni-tuebingen.de
Fri Jun 24 18:16:54 CEST 2011


On Jun 24, Timo Juhani Lindfors wrote:

> so clearly Qi and Linux are sending different line endings.
> 
> Can somebody else with a debug board confirm?

in your linux console, run "stty -a" and in this output look for "onlcr" or "-onlcr" !

for my (non-openmoko) linux this gives

	stty -a | grep onlcr
	opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
	                    ^^^^^

where the man page explains

       * [-]onlcr
              translate newline to carriage return-newline


that's why a single \n results on \r\n on a real terminal, this is 
standard unix termial behaviour for the last decades.
and it's standard unix that you can change this settings -- just try

    stty -onlcr


so yes, \r\n *is* the correct output at the "more physical" layer...


have fun,

Harald
-- 
"I hope to die                                      ___       _____
before I *have* to use Microsoft Word.",           0--,|    /OOOOOOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen.        <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
                                                       \/\/\/\/\/\/\/\/\/
Harald Koenig                                           //  /     \\  \
koenig at tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^



More information about the community mailing list