UART FIFO Size & CTS Threshold

66 views
Skip to first unread message

Lee Armstrong

unread,
Dec 10, 2015, 1:56:55 PM12/10/15
to BeagleBoard
Hi all,

Been looking through the kernel source for 4.1 with Debian 8.1 and trying to work out some of the things on the UARTs, but I can't seem to find the code!
  • What is the FIFO UART buffer size and is it configurable?
  • What is the FIFO trigger size for the CTS line to assert and is this configurable as well?
Thanks!

Lee

Robert Nelson

unread,
Dec 10, 2015, 2:00:08 PM12/10/15
to Beagle Board
On Thu, Dec 10, 2015 at 12:56 PM, Lee Armstrong <l...@pinkfroot.com> wrote:
> Hi all,
>
> Been looking through the kernel source for 4.1 with Debian 8.1 and trying to
> work out some of the things on the UARTs, but I can't seem to find the code!
>
> What is the FIFO UART buffer size and is it configurable?

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/8250_omap.c#n1130

> What is the FIFO trigger size for the CTS line to assert and is this
> configurable as well?


Regards

--
Robert Nelson
https://rcn-ee.com/

Lee Armstrong

unread,
Dec 10, 2015, 2:07:10 PM12/10/15
to BeagleBoard
Thanks Robert.

64 for the FIFO is what I suspected but couldn't see the CTS threshold. Was that 48?

Also these look pretty hard coded into the kernel. Anyone know a way of setting these after a compilation or how to compile in with other values?

Lee

Lee Armstrong

unread,
Dec 11, 2015, 12:20:41 PM12/11/15
to BeagleBoard
Anyone know what the RTS/CTS thresholds are for the 8250_omap driver that I am pretty sure the BBB uses by default?

I can't work it out!  I know that the signalling of RTS is working as I see it go high on the scope but I need to know how many bytes it is safe to send before an overrun happens again!

Peter Hurley

unread,
Dec 11, 2015, 1:59:13 PM12/11/15
to beagl...@googlegroups.com
On 12/11/2015 09:20 AM, Lee Armstrong wrote:
> Anyone know what the RTS/CTS thresholds are for the 8250_omap driver
> that I am pretty sure the BBB uses by default?
>
> I can't work it out! I know that the signalling of RTS is working as
> I see it go high on the scope but I need to know how many bytes it is
> safe to send before an overrun happens again!

The serial core + 8250_omap driver automatically prevent tx fifo
overflow; you don't have to worry about overrunning the fifo when
writing.

Are you observing overruns at the receiver with CRTSCTS on?
Is there a message or are you observing data corruption?
Is the receiver also a BBB or something else?
What baud rate are you using?

Regards,
Peter Hurley

Lee Armstrong

unread,
Dec 11, 2015, 2:02:08 PM12/11/15
to beagl...@googlegroups.com
Hi Peter,

It is on the RX side of things into the BBB and I am seeing the RTS signal goign across to our hardware.  I think the threshold is 48 out of the 64 buffer from looking at and experimenting.  

3Mbps is the baud rate and yes we were seeing an overrun and then corruption of the FIFO.  RTS seems to be working now that we have worked it out that the throttling happens at 48.

Lee

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/xzxFvnIg_Uc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Hurley

unread,
Dec 11, 2015, 2:12:28 PM12/11/15
to beagl...@googlegroups.com
Hi Lee,

On 12/11/2015 11:01 AM, Lee Armstrong wrote:
> Hi Peter,
>
> It is on the RX side of things into the BBB and I am seeing the RTS
> signal goign across to our hardware. I think the threshold is 48 out
> of the 64 buffer from looking at and experimenting.
>
> 3Mbps is the baud rate and yes we were seeing an overrun and then
> corruption of the FIFO. RTS seems to be working now that we have
> worked it out that the throttling happens at 48.>
> Lee

There are some issues at 3Mbaud, most likely related to dma.
Could be silicon. See here:

https://lkml.org/lkml/2015/12/3/442

Lee Armstrong

unread,
Dec 11, 2015, 2:13:52 PM12/11/15
to beagl...@googlegroups.com
Thanks Peter,

Yeah DMA mode was no go for us at this speed.  That really did just create spurious data.

FIFO mode with hardware flow control seems to be stable right now.

Thanks for coming back to me!

Lee

Peter Hurley

unread,
Dec 11, 2015, 2:19:42 PM12/11/15
to beagl...@googlegroups.com
On 12/11/2015 11:13 AM, Lee Armstrong wrote:
> Thanks Peter,
>
> Yeah DMA mode was no go for us at this speed. That really did just create spurious data.
>
> FIFO mode with hardware flow control seems to be stable right now.

Is the sender auto-CTS?

Lee Armstrong

unread,
Dec 11, 2015, 6:25:57 PM12/11/15
to beagl...@googlegroups.com
The other end is our own board and so signals cts all the time.

I think it is fine now that we have ascertained that the trigger is 48 out of 64
Reply all
Reply to author
Forward
0 new messages