* RT_PREEMPT and Serial Port
@ 2008-04-04 7:57 Mauricio A. Araya L�pez
2008-04-04 15:42 ` Nelson Castillo
2008-04-12 20:08 ` mgross
0 siblings, 2 replies; 8+ messages in thread
From: Mauricio A. Araya L�pez @ 2008-04-04 7:57 UTC (permalink / raw)
To: linux-rt-users
Hi all,
I've been searching on the web (and in the rt-wiki) for the current
status of the real-time support for devices. For instance
the serial port, CAN Bus, etc.
I am doing some experiments to check if RT_PREEMPT could be an option to
a control system that is using RTAI nowadays.
If not, maybe it is a good thing to develop myself, so if anyone can
comment anything about this, it will be very helpfull to start.
Thanks!
--
Mauricio Araya L.
ACS-UTFSM Team Leader, cel: 0-81564903
Est. Magister en Ciencias de la Informatica UTFSM, Valparaiso, Chile
counter.li.org: #249395, http://www.inf.utfsm.cl/~maray
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RT_PREEMPT and Serial Port
2008-04-04 7:57 RT_PREEMPT and Serial Port Mauricio A. Araya L�pez
@ 2008-04-04 15:42 ` Nelson Castillo
2008-04-12 20:08 ` mgross
1 sibling, 0 replies; 8+ messages in thread
From: Nelson Castillo @ 2008-04-04 15:42 UTC (permalink / raw)
To: Mauricio A. Araya López; +Cc: linux-rt-users
On Fri, Apr 4, 2008 at 2:57 AM, Mauricio A. Araya López
<maray@inf.utfsm.cl> wrote:
> Hi all,
>
> I've been searching on the web (and in the rt-wiki) for the current
> status of the real-time support for devices. For instance
> the serial port, CAN Bus, etc.
Hi Mauricio.
I had a nice experience with a RS485 bus (half-duplex). The ideal setup
is to use automatic RTS control. I tried using manual control of this
signal with and without PREEMPT_RT. With PREEMPT_RT I
managed to receive the response of the device in the bus.
Without the patch I would miss the response
(even if it took as much as a few milliseconds).
I don't know about specific support in drivers, but I had a good experience
with this patch and a serial device.
Regards,
Nelson.-
--
http://arhuaco.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RT_PREEMPT and Serial Port
2008-04-04 7:57 RT_PREEMPT and Serial Port Mauricio A. Araya L�pez
2008-04-04 15:42 ` Nelson Castillo
@ 2008-04-12 20:08 ` mgross
2008-04-12 23:34 ` Mauricio A. Araya L�pez
1 sibling, 1 reply; 8+ messages in thread
From: mgross @ 2008-04-12 20:08 UTC (permalink / raw)
To: Mauricio A. Araya L�pez; +Cc: linux-rt-users
On Fri, Apr 04, 2008 at 03:57:53AM -0400, Mauricio A. Araya L�pez wrote:
> Hi all,
>
> I've been searching on the web (and in the rt-wiki) for the current
> status of the real-time support for devices. For instance
> the serial port, CAN Bus, etc.
>
> I am doing some experiments to check if RT_PREEMPT could be an option to
> a control system that is using RTAI nowadays.
>
> If not, maybe it is a good thing to develop myself, so if anyone can
> comment anything about this, it will be very helpfull to start.
I was just doing this and fell into a tangent looking at USB2Serial
issues with RT applications.
FWIW I was able to get +/- 30usec jitter from a serial port experiment
where I programmed a PIC to push 5 bytes over the serial line every
20ms. I had a blocking read from a FIFO pthread that would wake up
and call gettimeofday, which I used to measure the jitter. It was
very impressive. I'm pretty confident that *if* you use a hardware
serial port (no-USB) you will be able to implement effective PID
controls with a real time pthread program running on a RT-preempt
kernel.
um on common desktop PC hardware like what I used anyway.
--mgross
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RT_PREEMPT and Serial Port
2008-04-12 20:08 ` mgross
@ 2008-04-12 23:34 ` Mauricio A. Araya L�pez
2008-04-13 17:37 ` Wolfgang Grandegger
2008-04-13 18:00 ` mgross
0 siblings, 2 replies; 8+ messages in thread
From: Mauricio A. Araya L�pez @ 2008-04-12 23:34 UTC (permalink / raw)
To: mgross; +Cc: linux-rt-users
On Sat, Apr 12, 2008 at 01:08:37PM -0700, mgross wrote:
> On Fri, Apr 04, 2008 at 03:57:53AM -0400, Mauricio A. Araya L�pez wrote:
> > Hi all,
> >
> > I've been searching on the web (and in the rt-wiki) for the current
> > status of the real-time support for devices. For instance
> > the serial port, CAN Bus, etc.
> >
[...]
> FWIW I was able to get +/- 30usec jitter from a serial port experiment
> where I programmed a PIC to push 5 bytes over the serial line every
> 20ms.
My results are similar. A 30 usec jitter it seems to be the limit,
but indeed the jitter is less, because the latency is near the
10 usec. But, that is "on average", because I've run several
test during long time periods, and my worst jitter is like 5 msec!,
which is too much. Maybe it is a hardware problem, but I am using
no swap, no usb and no DMA, and I dont know which other thing
i should disable to not have this huge random jitter.
(Obviosly I am locking the memory to have no paging)
> I had a blocking read from a FIFO pthread that would wake up
> and call gettimeofday, which I used to measure the jitter.
I have the same idea, but using clock_gettime which use timespec
(nanoseconds) like nanosleep.
> It was
> very impressive. I'm pretty confident that *if* you use a hardware
> serial port (no-USB) you will be able to implement effective PID
> controls with a real time pthread program running on a RT-preempt
> kernel.
In summary, i am reading from other computer the data sent by a serial
port, and almost always I have a 30-40 usec jitter, but sometimes
I get a single point where the jitter is like 1-5 msec. The strange
thing is that the sender shows perfect timing (less that 30 usec),
but the reader get these strange jumps. I am downloading the last
kernel to check the serial port driver code: the patch -rt do something
with the serial port? or generally some hardware related pacth?
--
Mauricio Araya L.
ACS-UTFSM Team Leader, cel: 0-81564903
Est. Magister en Ciencias de la Informatica UTFSM, Valparaiso, Chile
counter.li.org: #249395, http://www.inf.utfsm.cl/~maray
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RT_PREEMPT and Serial Port
2008-04-12 23:34 ` Mauricio A. Araya L�pez
@ 2008-04-13 17:37 ` Wolfgang Grandegger
2008-04-13 20:54 ` Mauricio A. Araya L�pez
2008-04-13 18:00 ` mgross
1 sibling, 1 reply; 8+ messages in thread
From: Wolfgang Grandegger @ 2008-04-13 17:37 UTC (permalink / raw)
To: Mauricio �; +Cc: mgross, linux-rt-users
Mauricio � wrote:
> On Sat, Apr 12, 2008 at 01:08:37PM -0700, mgross wrote:
>> On Fri, Apr 04, 2008 at 03:57:53AM -0400, Mauricio A. Araya L�pez wrote:
>>> Hi all,
>>>
>>> I've been searching on the web (and in the rt-wiki) for the current
>>> status of the real-time support for devices. For instance
>>> the serial port, CAN Bus, etc.
>>>
> [...]
>
>> FWIW I was able to get +/- 30usec jitter from a serial port experiment
>> where I programmed a PIC to push 5 bytes over the serial line every
>> 20ms.
> My results are similar. A 30 usec jitter it seems to be the limit,
> but indeed the jitter is less, because the latency is near the
> 10 usec. But, that is "on average", because I've run several
> test during long time periods, and my worst jitter is like 5 msec!,
> which is too much. Maybe it is a hardware problem, but I am using
> no swap, no usb and no DMA, and I dont know which other thing
> i should disable to not have this huge random jitter.
> (Obviosly I am locking the memory to have no paging)
>
>> I had a blocking read from a FIFO pthread that would wake up
>> and call gettimeofday, which I used to measure the jitter.
>
> I have the same idea, but using clock_gettime which use timespec
> (nanoseconds) like nanosleep.
>
>> It was
>> very impressive. I'm pretty confident that *if* you use a hardware
>> serial port (no-USB) you will be able to implement effective PID
>> controls with a real time pthread program running on a RT-preempt
>> kernel.
>
> In summary, i am reading from other computer the data sent by a serial
> port, and almost always I have a 30-40 usec jitter, but sometimes
> I get a single point where the jitter is like 1-5 msec. The strange
> thing is that the sender shows perfect timing (less that 30 usec),
> but the reader get these strange jumps. I am downloading the last
> kernel to check the serial port driver code: the patch -rt do something
> with the serial port? or generally some hardware related pacth?
Just to be sure, the interrupt thread of your serial port is running at
a higher priority than the others.
Wolfgang.
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RT_PREEMPT and Serial Port
2008-04-12 23:34 ` Mauricio A. Araya L�pez
2008-04-13 17:37 ` Wolfgang Grandegger
@ 2008-04-13 18:00 ` mgross
2008-04-13 18:56 ` Arnaldo Carvalho de Melo
1 sibling, 1 reply; 8+ messages in thread
From: mgross @ 2008-04-13 18:00 UTC (permalink / raw)
To: Mauricio A. Araya L�pez; +Cc: linux-rt-users
On Sat, Apr 12, 2008 at 07:34:28PM -0400, Mauricio A. Araya L�pez wrote:
> On Sat, Apr 12, 2008 at 01:08:37PM -0700, mgross wrote:
> > On Fri, Apr 04, 2008 at 03:57:53AM -0400, Mauricio A. Araya L�pez wrote:
> > > Hi all,
> > >
> > > I've been searching on the web (and in the rt-wiki) for the current
> > > status of the real-time support for devices. For instance
> > > the serial port, CAN Bus, etc.
> > >
> [...]
>
> > FWIW I was able to get +/- 30usec jitter from a serial port experiment
> > where I programmed a PIC to push 5 bytes over the serial line every
> > 20ms.
> My results are similar. A 30 usec jitter it seems to be the limit,
> but indeed the jitter is less, because the latency is near the
> 10 usec. But, that is "on average", because I've run several
> test during long time periods, and my worst jitter is like 5 msec!,
> which is too much. Maybe it is a hardware problem, but I am using
> no swap, no usb and no DMA, and I dont know which other thing
> i should disable to not have this huge random jitter.
> (Obviosly I am locking the memory to have no paging)
How long did you need to run it to hit a 5msec jitter?
My tests where only for a few min while I test compiled the kernel a
few times to see if that would effect things.
>
> > I had a blocking read from a FIFO pthread that would wake up
> > and call gettimeofday, which I used to measure the jitter.
>
> I have the same idea, but using clock_gettime which use timespec
> (nanoseconds) like nanosleep.
>
> > It was
> > very impressive. I'm pretty confident that *if* you use a hardware
> > serial port (no-USB) you will be able to implement effective PID
> > controls with a real time pthread program running on a RT-preempt
> > kernel.
>
> In summary, i am reading from other computer the data sent by a serial
> port, and almost always I have a 30-40 usec jitter, but sometimes
> I get a single point where the jitter is like 1-5 msec. The strange
> thing is that the sender shows perfect timing (less that 30 usec),
> but the reader get these strange jumps. I am downloading the last
> kernel to check the serial port driver code: the patch -rt do something
> with the serial port? or generally some hardware related pacth?
>
> --
> Mauricio Araya L.
> ACS-UTFSM Team Leader, cel: 0-81564903
> Est. Magister en Ciencias de la Informatica UTFSM, Valparaiso, Chile
> counter.li.org: #249395, http://www.inf.utfsm.cl/~maray
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RT_PREEMPT and Serial Port
2008-04-13 18:00 ` mgross
@ 2008-04-13 18:56 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-04-13 18:56 UTC (permalink / raw)
To: mgross; +Cc: Mauricio A. Araya L�pez, linux-rt-users
Em Sun, Apr 13, 2008 at 11:00:08AM -0700, mgross escreveu:
> On Sat, Apr 12, 2008 at 07:34:28PM -0400, Mauricio A. Araya L�pez wrote:
> > On Sat, Apr 12, 2008 at 01:08:37PM -0700, mgross wrote:
> > > On Fri, Apr 04, 2008 at 03:57:53AM -0400, Mauricio A. Araya L�pez wrote:
> > > > Hi all,
> > > >
> > > > I've been searching on the web (and in the rt-wiki) for the current
> > > > status of the real-time support for devices. For instance
> > > > the serial port, CAN Bus, etc.
> > > >
> > [...]
> >
> > > FWIW I was able to get +/- 30usec jitter from a serial port experiment
> > > where I programmed a PIC to push 5 bytes over the serial line every
> > > 20ms.
> > My results are similar. A 30 usec jitter it seems to be the limit,
> > but indeed the jitter is less, because the latency is near the
> > 10 usec. But, that is "on average", because I've run several
> > test during long time periods, and my worst jitter is like 5 msec!,
> > which is too much. Maybe it is a hardware problem, but I am using
> > no swap, no usb and no DMA, and I dont know which other thing
> > i should disable to not have this huge random jitter.
> > (Obviosly I am locking the memory to have no paging)
>
> How long did you need to run it to hit a 5msec jitter?
>
> My tests where only for a few min while I test compiled the kernel a
> few times to see if that would effect things.
And have you guys tried with a ftrace/latency trace enabled kernel? It
would be really interesting to know what happens in this 5ms :-)
- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RT_PREEMPT and Serial Port
2008-04-13 17:37 ` Wolfgang Grandegger
@ 2008-04-13 20:54 ` Mauricio A. Araya L�pez
0 siblings, 0 replies; 8+ messages in thread
From: Mauricio A. Araya L�pez @ 2008-04-13 20:54 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: linux-rt-users
On Sun, Apr 13, 2008 at 07:37:47PM +0200, Wolfgang Grandegger wrote:
> Mauricio � wrote:
> > In summary, i am reading from other computer the data sent by a serial
> > port, and almost always I have a 30-40 usec jitter, but sometimes
> > I get a single point where the jitter is like 1-5 msec. The strange
> > thing is that the sender shows perfect timing (less that 30 usec),
> > but the reader get these strange jumps. I am downloading the last
> > kernel to check the serial port driver code: the patch -rt do something
> > with the serial port? or generally some hardware related pacth?
>
> Just to be sure, the interrupt thread of your serial port is running at
> a higher priority than the others.
>
Yes, the priority is 80 and a FIFO scheduler, the other threads have 70.
In QNX it works as it should. I will try the writer in linux, and the
reader in QNX to check what is happenig.
--
Mauricio Araya L.
ACS-UTFSM Team Leader, cel: 0-81564903
Est. Magister en Ciencias de la Informatica UTFSM, Valparaiso, Chile
counter.li.org: #249395, http://www.inf.utfsm.cl/~maray
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-04-13 20:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-04 7:57 RT_PREEMPT and Serial Port Mauricio A. Araya L�pez
2008-04-04 15:42 ` Nelson Castillo
2008-04-12 20:08 ` mgross
2008-04-12 23:34 ` Mauricio A. Araya L�pez
2008-04-13 17:37 ` Wolfgang Grandegger
2008-04-13 20:54 ` Mauricio A. Araya L�pez
2008-04-13 18:00 ` mgross
2008-04-13 18:56 ` Arnaldo Carvalho de Melo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.