r00x
Posts: 41
Joined: Mon Feb 04, 2013 11:05 am

Enable UART flow control by default (on boot?)

Thu Nov 03, 2016 11:31 pm

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
and

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!

fdufnews
Posts: 289
Joined: Fri Oct 07, 2011 5:37 pm

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

Fri Nov 04, 2016 9:12 pm

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>.

ttyS<n>[,options]
ttyUSB0[,options]
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
alternative.

r00x
Posts: 41
Joined: Mon Feb 04, 2013 11:05 am

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

Fri Nov 11, 2016 3:01 pm

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?

Return to “Advanced users”