Page 1 of 1

Enable UART flow control by default (on boot?)

Posted: Thu Nov 03, 2016 11:31 pm
by r00x
Hi there,

I've spent a few hours searching for answers but my Google-Fu is terrible, it seems (or perhaps this isn't possible)...

I have a Pi Model B on which I want to set the Pi's UART to 115,200 baud and enable RTS/CTS by default. I'd like this to be effective on boot. This is so I can see the console output on an RS-232 display which is attached to the UART.

The Pi defaults to 115,200 baud anyway it seems (cmdline.txt) but the display can't keep up and is trying to notify the Pi as such by way of flow control. The result is lots of garbled/missed characters!

How can I enable flow control from boot? The best I can seem to do is enable it after the Pi has already booted, by way of running

Code: Select all

./rpirtscts on

Code: Select all

stty -F /dev/ttyAMA0 crtscts
If I enable it manually, the display works great, I just need it set that way by default. Any suggestions appreciated!

Re: Enable UART flow control by default (on boot?)

Posted: Fri Nov 04, 2016 9:12 pm
by fdufnews
From here (kernel parameters) I found this concerning console arguments to put in cmdline.txt:
console= [KNL] Output console device and options.

tty<n> Use the virtual console device <n>.

Use the specified serial port. The options are of
the form "bbbbpnf", where "bbbb" is the baud rate,
"p" is parity ("n", "o", or "e"), "n" is number of
bits, and "f" is flow control ("r" for RTS or
omit it). Default is "9600n8".

See Documentation/serial-console.txt for more
information. See
Documentation/networking/netconsole.txt for an

Re: Enable UART flow control by default (on boot?)

Posted: Fri Nov 11, 2016 3:01 pm
by r00x
It didn't seem to work... thanks very much for finding that info though!

I've confirmed that, if I use rpirtscts to enable flow control, it is indeed enabled and obeyed by the Pi. However I can't get this to work on boot still.

So following your findings I tried the likes of "115200r" and also "115200n8r" for the console in cmdline.txt, but in both cases although the speed seemed correct, flow control was ignored and there was lots of mess on the screen.

Is there a chance this is working and enabling flow control, but not enabling the GPIO30/31 pins required to use it? Could that be why it doesn't work?

If so, how to force those pins to default to CTS/RTS?