I have a problem when I connect P9.24 (ttyO1.TX) with P9.26 (ttyO1.RX),
If I send data on serial port like this : echo 1 > /dev/ttyO1
And read data on serial port like this : cat /dev/ttyO1
The command output a lot of data indefinitely … and my ssh link doesn’t respond,
If I remove the jumper the system come back …
What wrong ?
Same problem with ttyO2,
Same problem with ttyO1 connected to ttyO2
I’m using kernel 3.8.13-bone69 (trying also 40 and 47) with debian 7.7,
I have the same problem too on the 3.18.1 kernel.
It can be fixed by initialising the port first, with something like:
stty -F /dev/ttyO1 raw clocal -crtscts -echo
The initial state for all ttys in Linux is ECHO.
When you setup loopback, you need to turn echo off.
stty -a -F /dev/ttyO1 will show you the current termios settings for the port.
See "man termios" for the manual on Linux terminal control.
I forgot this ...
I do this in my program
struct termios conf;
conf.c_lflag &= ~(ICANON | ECHO | ISIG);
Thank you very much.