From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Karch, Joshua" <jkarch@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] serial port overrun problem RT TASK
Date: Thu, 24 Apr 2008 08:43:24 +0200 [thread overview]
Message-ID: <18448.11276.526008.229326@domain.hid> (raw)
In-Reply-To: <51B669A8A7D2914E9AB2B3F40AC6553E646F21@domain.hid>
Karch, Joshua wrote:
> Gilles, (and anyone else who has had overrun errors or has experience with the Xenomai serial port driver)
>
> It seems that even though I turned off fprintf and even though I stopped logging to disk, I still get the same number of overrun errors. I broke the loop down to the bare basics.
>
> my task now consists of the following
>
> Task was launched as follows:rt_task_create(&read_task, "read_task", 0, 51, 0);
>
>
> void sensor::mainloop()
> {
>
>
> //set up serial read
> struct rtser_event rx_event;
> rtser_status_t serstatus;
> int numread,err;
>
> while(1)
> {
> if(exitprogram) //
> break;
>
> err = rt_dev_ioctl(read_fd, RTSER_RTIOC_WAIT_EVENT, &rx_event);
>
As I already said, using read with timeout directly without first
calling ioctl leads to a better latency because of the fewer system
calls.
> if (err)
> {
> printf(RTASK_PREFIX
> "error on RTSER_RTIOC_WAIT_EVENT, %s\n",
> strerror(-err));
> err = rt_dev_ioctl(read_fd, RTSER_RTIOC_GET_STATUS, &serstatus);
> printf(RTASK_PREFIX "Error code line_status=%d modem_status=%d\n",serstatus.line_status, serstatus.modem_status);
>
> }
>
> else
> {
> numread = rt_dev_read(read_fd, buf, 1);
> {
> printf(RTASK_PREFIX "error on rt_dev_read, code %d %s\n",numread,
> strerror(-numread));
> err = rt_dev_ioctl(read_fd, RTSER_RTIOC_GET_STATUS, &serstatus);
> printf(RTASK_PREFIX "Error code line_status=%d modem_status=%d\n",serstatus.line_status, serstatus.modem_status);
> continue;
> }
> else
> {
> err = rt_dev_ioctl(read_fd, RTSER_RTIOC_GET_STATUS, &serstatus); //if data received normally, make sure 96 was received, 98 = overrun
> if(!serstatus.line_status==96)
> printf(RTASK_PREFIX "Error code line_status=%d modem_status=%d\n",serstatus.line_status, serstatus.modem_status);
> }
On compilers I know if () { } else { } else {} does not even
compile. Are you sure you are showing us the code you are really running
? Have you tried T_WARNSW as I suggested in a previous mail ?
At what frequency do characters arrive on the serial line ? Did you try
to run the latency test with the same frequency to see if Xenomai on
your hardware is able to support this frequency ? Try latency -t 1 or -t
2 to see if switching to kernel-space would improve situation. Do you
observe unexpected peaks (such as those caused by SMIs) when running
latency ?
Is not it possible to enable hardware buffering so as to receive more
than one character at a time when overflow occurs ?
If you need ultra-high frequencies, you should probably write some part
of your application (at least the real-time control loop) in
kernel-space.
--
Gilles.
next prev parent reply other threads:[~2008-04-24 6:43 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-22 22:46 [Xenomai-help] Xenomai serial port c++ code and / or xeno-- (xenomm-0.0.1) install problem Karch, Joshua
2008-04-23 0:12 ` Gilles Chanteperdrix
[not found] ` <51B669A8A7D2914E9AB2B3F40AC6553E646F15@domain.hid>
2008-04-23 13:58 ` [Xenomai-help] Xenomai serial port c++ code and / or xeno--(xenomm-0.0.1) " Gilles Chanteperdrix
2008-04-23 14:25 ` Karch, Joshua
2008-04-23 14:30 ` Gilles Chanteperdrix
2008-04-23 15:43 ` Karch, Joshua
2008-04-23 18:10 ` Gilles Chanteperdrix
[not found] ` <51B669A8A7D2914E9AB2B3F40AC6553E646F1D@afsexc01.aurora.aero>
2008-04-23 21:20 ` [Xenomai-help] FW: " Karch, Joshua
2008-04-23 21:28 ` [Xenomai-help] " Gilles Chanteperdrix
2008-04-23 21:36 ` Karch, Joshua
2008-04-23 22:14 ` [Xenomai-help] serial port overrun problem RT TASK Karch, Joshua
2008-04-24 6:43 ` Gilles Chanteperdrix [this message]
2008-04-24 7:04 ` Jan Kiszka
2008-04-24 14:16 ` Karch, Joshua
2008-04-24 14:30 ` Gilles Chanteperdrix
2008-04-24 16:58 ` Karch, Joshua
2008-04-24 17:16 ` Gilles Chanteperdrix
2008-04-24 22:37 ` [Xenomai-help] serial port overrun problem RT TASK geode latencies too high Karch, Joshua
2008-04-24 22:59 ` Gilles Chanteperdrix
2008-04-25 16:04 ` [Xenomai-help] Geode Latency Problem (Was: serial port overrun problem) Karch, Joshua
2008-04-25 16:12 ` Gilles Chanteperdrix
2008-04-24 13:59 ` [Xenomai-help] serial port overrun problem RT TASK Karch, Joshua
2008-04-24 14:01 ` Gilles Chanteperdrix
[not found] ` <51B669A8A7D2914E9AB2B3F40AC6553E646F52@domain.hid>
[not found] ` <18454.9396.476627.446653@domain.hid>
[not found] ` <51B669A8A7D2914E9AB2B3F40AC6553E646F54@domain.hid>
[not found] ` <48162C69.6040101@domain.hid>
[not found] ` <18454.12323.344999.258031@domain.hid>
[not found] ` <51B669A8A7D2914E9AB2B3F40AC6553E646F55@domain.hid>
[not found] ` <48163EE7.5000604@domain.hid>
[not found] ` <18454.17297.451664.334250@domain.hid>
[not found] ` <48164652.5090102@domain.hid>
[not found] ` <2ff1a98a0804290252j1c9dc444kffb345ebaeb123d@domain.hid>
[not found] ` <48187366.2060006@domain.hid>
2008-04-30 18:13 ` [Xenomai-help] Segfault Problems with Message Queues Karch, Joshua
2008-04-30 18:31 ` Philippe Gerum
2008-04-30 18:41 ` Karch, Joshua
2008-04-30 18:48 ` Philippe Gerum
2008-04-30 19:22 ` Karch, Joshua
2008-04-30 18:36 ` Philippe Gerum
2008-04-30 19:19 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18448.11276.526008.229326@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=jkarch@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.