ts-7000
[Top] [All Lists]

RE: [ts-7000] Re: Flushing an RX buffer.

To: <>
Subject: RE: [ts-7000] Re: Flushing an RX buffer.
From: "Jongsoo Kim" <>
Date: Tue, 5 Jan 2010 11:04:31 -0500


Jon

Just a comment. And I could be wrong.

I read TS7500 manual about xuart ( I copied below). It uses 4Kbye of FIFO buffer shared by 8 serial. 4KB is very big size of buffer for 4800 bps of GPS stream. In their description, this is larger enough to prevent buffer overflow with all 8 ports running at 203400 bps.    I am curious to know if 4800bps is input speed of FIFO and then what is output speed of FIFO.  If input and output are the same speed, then this may be a source of your problem of old data sitting long time in buffer.  Even if you continuously retrieve the 4K buffer @ 4800bps, it will take 6.7 second to pass thru. It seems to me a routine program must pull data continuously out of FIFO buffer…  And if I am correct, this will be a problem for me as I need to keep freshness of data within 0.5 second.  I want to know if I can control output speed of buffer or I can reduce the size of FIFO.

 

2.8.6 XUART Control from Userspace

XUART TTL serial ports are also implemented entirely from userspace. The 8 serial ports have a single shared 4kByte receive FIFO which makes real time interrupt latency response less of a concern and in actual implementation, the serial ports are simply polled at 100Hz and don't even use an IRQ. Even with all 8 ports running at 230400 baud, it is not possible to overflow the receive FIFO in 1/100th of a second. The "xuartctl --server" daemon is started by default in the INITRD linuxrc file which sets up listening TCP/IP ports for all 8 XUART channels on ports 7350-7357. An application may simply connect to these ports via localhost (or via the network) and use the serial ports as if they were network services. The default mode is "8N1" and default baud rate is 115200-- should the default need to be changed, modifying the linuxrc line that invokes the XUART server can be changed from:

   xuartctl --server

 

 

Jongsoo

 

From: [ On Behalf Of Jon L
Sent: Tuesday, January 05, 2010 9:53 AM
To:
Subject: [ts-7000] Re: Flushing an RX buffer.

 

 



--- In ts-7000%40yahoogroups.com, "Jon L" <> wrote:
>
>
>
> --- In ts-7000%40yahoogroups.com, "Jon L" <jleslie48@> wrote:
> >
> > Ok, I finally got an RS232 uart to work properly on the TS-7500 (the fpga program needed to be upgraded to revision x03)
> >
> > but whats interesting is the RX buffer of the uart fills so long as data is coming in and queues up.
> >
> > So what is the best way to dump this data for the freshest? For example say I have a GPS hooked up to a uart, and its constantly spewing data which I don't care about. Now say all of a sudden I want the next gps data; I don't want wade through the entire /dev/gpsuart file to get to the last data; I want to be able to reset /dev/gpsuart, and have it fill fresh when I want it.
> >
> > Any ideas?
> >
> >
> >
> > Also what happens if I ignore the Gps data for a loooong time, what is the buffer limit on the /dev/gpsuart as set up by
> >
> > xuartctl ???
> >
>
>
> ok, I hooked up my GPS to the /dev/gpsuart and it receives the data just fine, but the problem is the queueing of the data.
>
> If I ignore the RX for minutes, the buffer fills to around 12,285 bytes (any Idea the significance of this amount?) That is fine but if I dump the buffer with say "cat /dev/gpsuart >/dev/null" It seems that I just get the next section of gps data. There is still a hidden queue of the data somewhere queuing up rather than dumping on the floor.
>
> I tried "tail /dev/gpsuart" but that only gives me the "tail" of the 12,285 section. I was hoping that tail would move the pointer to the end of everything. The only thing I've gotten to work so far is if I:
>
> "tail -f /dev/gpsuart" then wait xxx seconds until I see the data streaming (much slower than the regular tail to screen) and I know I'm tailing the current data coming in.
>
> This is not a good way to do this as that "wait xxx seconds" is not guaranteed to empty and I don't know how to even calculate the xxx, or how to program "wait until I seed the data streaming"
>
> I'm also concerned about where all this data is being stored, I mean what if I don't get to tail -f for days? is this going to grow forever?
>
>
>
> any ideas?
>

Ok, so re-issuing the xuartctl --port 0 --server command resets the buffer. That's all that I need. there is some cleanup to be done, as when you re-issue the xuartctl command, the old one still remains, but that not too hard to handle here is the script I use to restart the UART0 port:

ts7500:/home/jon/programs/sjinn# cat uart_setup.sh
#!/bin/sh
XUARTID=`pgrep -f "xuartctl --port 0"`
kill $XUARTID
PAR1=`xuartctl --port 0 --server --speed 4800 2>&1 |cut -d= -f2`
echo $PAR1
ln -sf $PAR1 /dev/testuart
XUARTID=`pgrep -f "xuartctl --port 0"`
echo $XUARTID
ts7500:/home/jon/programs/sjinn#



__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU