All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] RT Serial, rt_dev_read blocking problem
@ 2009-04-17 14:49 Dehann Fourie
  2009-04-17 15:09 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Dehann Fourie @ 2009-04-17 14:49 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1534 bytes --]

Hi,

I am having trouble with reading data from the serial port. I initially
followed the RT Serial example from captain. I changed the read task to a
periodic 20ms task, from which I read from the serial port (rtser0). This is
all that the rt_task is doing. The serial port config is:

static const struct rtser_config
<http://www.xenomai.org/documentation/trunk/html/api/structrtser__config.html>
read_config = {
        .config_mask       = 0xFFFF,
        .baud_rate         = 57600,
        .parity            = RTSER_NO_PARITY,
        .data_bits         = RTSER_8_BITS,
        .stop_bits         = RTSER_1_STOPB,
        .handshake         = RTSER_NO_HAND,
        .fifo_depth        = RTSER_DEF_FIFO_DEPTH,
        .rx_timeout        = RTSER_DEF_TIMEOUT,
        .tx_timeout        = RTSER_DEF_TIMEOUT,
        .event_timeout     = RTSER_DEF_TIMEOUT,
        .timestamp_history = RTSER_RX_TIMESTAMP_HISTORY,
        .event_mask        = RTSER_EVENT_RXPEND,
};

I am reading data into a buffer, char buf[300]. I am able to read data but
the task is repeating at a rate of about 50ms. Execution also only returns
from the rt_dev_read() call when 300 chars have been read, but the external
hardware is only sending a couple of chars (+-35) at a rate of 171Hz. Is the
rt task maybe blocking? How can I get it to only read the available chars in
the serial buffer and then return to my program?

I am on a Geode 500MHz single board computer with kernel 2.6.23 and xeno
2.4.3.

Thanks in advance.

Kind regards,

-- 
Dehann Fourie

[-- Attachment #2: Type: text/html, Size: 1918 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] RT Serial, rt_dev_read blocking problem
  2009-04-17 14:49 [Xenomai-help] RT Serial, rt_dev_read blocking problem Dehann Fourie
@ 2009-04-17 15:09 ` Gilles Chanteperdrix
  2009-04-19  8:51   ` Dehann Fourie
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2009-04-17 15:09 UTC (permalink / raw)
  To: Dehann Fourie; +Cc: xenomai

Dehann Fourie wrote:
> Hi,
> 
> I am having trouble with reading data from the serial port. I initially
> followed the RT Serial example from captain. I changed the read task to a
> periodic 20ms task, from which I read from the serial port (rtser0). This is
> all that the rt_task is doing. The serial port config is:
> 
> static const struct rtser_config
> <http://www.xenomai.org/documentation/trunk/html/api/structrtser__config.html>
> read_config = {
>         .config_mask       = 0xFFFF,
>         .baud_rate         = 57600,
>         .parity            = RTSER_NO_PARITY,
>         .data_bits         = RTSER_8_BITS,
>         .stop_bits         = RTSER_1_STOPB,
>         .handshake         = RTSER_NO_HAND,
>         .fifo_depth        = RTSER_DEF_FIFO_DEPTH,
>         .rx_timeout        = RTSER_DEF_TIMEOUT,

Did you try to set .rx_timeout = RTSER_TIMEOUT_NONE here ? I may be
completely wrong because I never used the serial driver, but it looks
like what you are looking for.

> I am on a Geode 500MHz single board computer with kernel 2.6.23 and xeno
> 2.4.3.

Some issues with FPU on Geode were fixed recently, so, you should use
Xenomai 2.4.7, using the latest I-pipe patch which ship with this
version, and apply the commit 3a23967f3cc8d6881d8e3280130bbc431195aa31
from head.

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] RT Serial, rt_dev_read blocking problem
  2009-04-17 15:09 ` Gilles Chanteperdrix
@ 2009-04-19  8:51   ` Dehann Fourie
  2009-04-19  9:16     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Dehann Fourie @ 2009-04-19  8:51 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1995 bytes --]

Hi Gilles,

Thanks a lot. Will give it a try. I have tried  .rx_timeout =
RTSER_TIMEOUT_NONE before, but then I was not able to read any data. I am
assuming the data expired before I had read it. This was on a different
config however, so I will try it again.

Please excuse my lack of knowledge but I am not following you on:
-  ... and apply the commit 3a23967f3cc8d6881d8e3280130bbc431195aa31
-     from head.

Thanks again and kind regards,
Dehann

On Fri, Apr 17, 2009 at 5:09 PM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Dehann Fourie wrote:
> > Hi,
> >
> > I am having trouble with reading data from the serial port. I initially
> > followed the RT Serial example from captain. I changed the read task to a
> > periodic 20ms task, from which I read from the serial port (rtser0). This
> is
> > all that the rt_task is doing. The serial port config is:
> >
> > static const struct rtser_config
> > <
> http://www.xenomai.org/documentation/trunk/html/api/structrtser__config.html
> >
> > read_config = {
> >         .config_mask       = 0xFFFF,
> >         .baud_rate         = 57600,
> >         .parity            = RTSER_NO_PARITY,
> >         .data_bits         = RTSER_8_BITS,
> >         .stop_bits         = RTSER_1_STOPB,
> >         .handshake         = RTSER_NO_HAND,
> >         .fifo_depth        = RTSER_DEF_FIFO_DEPTH,
> >         .rx_timeout        = RTSER_DEF_TIMEOUT,
>
> Did you try to set .rx_timeout = RTSER_TIMEOUT_NONE here ? I may be
> completely wrong because I never used the serial driver, but it looks
> like what you are looking for.
>
> > I am on a Geode 500MHz single board computer with kernel 2.6.23 and xeno
> > 2.4.3.
>
> Some issues with FPU on Geode were fixed recently, so, you should use
> Xenomai 2.4.7, using the latest I-pipe patch which ship with this
> version, and apply the commit 3a23967f3cc8d6881d8e3280130bbc431195aa31
> from head.
>
> --
>                                             Gilles.
>



-- 
Dehann Fourie

[-- Attachment #2: Type: text/html, Size: 2725 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] RT Serial, rt_dev_read blocking problem
  2009-04-19  8:51   ` Dehann Fourie
@ 2009-04-19  9:16     ` Gilles Chanteperdrix
  2009-04-23  7:02       ` Dehann Fourie
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2009-04-19  9:16 UTC (permalink / raw)
  To: Dehann Fourie; +Cc: xenomai

Dehann Fourie wrote:
> Hi Gilles,
> 
> Thanks a lot. Will give it a try. I have tried  .rx_timeout =
> RTSER_TIMEOUT_NONE before, but then I was not able to read any data. I am
> assuming the data expired before I had read it. This was on a different
> config however, so I will try it again.
> 
> Please excuse my lack of knowledge but I am not following you on:
> -  ... and apply the commit 3a23967f3cc8d6881d8e3280130bbc431195aa31
> -     from head.

Xenomai has a git repository now. See http://git.xenomai.org/
3a23967f3cc8d6881d8e3280130bbc431195aa31 is the identifier of a commit.

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] RT Serial, rt_dev_read blocking problem
  2009-04-19  9:16     ` Gilles Chanteperdrix
@ 2009-04-23  7:02       ` Dehann Fourie
  2009-04-23  9:15         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Dehann Fourie @ 2009-04-23  7:02 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]

Hi Gilles,

Just for informations sake. I am still on xeno 2.4.3, but setting
.rx_timeout to RTSER_TIMEOUT_NONE has fixed the problem. Many thanks.

Dehann

On Sun, Apr 19, 2009 at 11:16 AM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Dehann Fourie wrote:
> > Hi Gilles,
> >
> > Thanks a lot. Will give it a try. I have tried  .rx_timeout =
> > RTSER_TIMEOUT_NONE before, but then I was not able to read any data. I am
> > assuming the data expired before I had read it. This was on a different
> > config however, so I will try it again.
> >
> > Please excuse my lack of knowledge but I am not following you on:
> > -  ... and apply the commit 3a23967f3cc8d6881d8e3280130bbc431195aa31
> > -     from head.
>
> Xenomai has a git repository now. See http://git.xenomai.org/
> 3a23967f3cc8d6881d8e3280130bbc431195aa31<http://git.xenomai.org/%0A3a23967f3cc8d6881d8e3280130bbc431195aa31>is the identifier of a commit.
>
> --
>                                             Gilles.
>



-- 
Dehann Fourie

[-- Attachment #2: Type: text/html, Size: 1488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] RT Serial, rt_dev_read blocking problem
  2009-04-23  7:02       ` Dehann Fourie
@ 2009-04-23  9:15         ` Gilles Chanteperdrix
  0 siblings, 0 replies; 6+ messages in thread
From: Gilles Chanteperdrix @ 2009-04-23  9:15 UTC (permalink / raw)
  To: Dehann Fourie; +Cc: xenomai

Dehann Fourie wrote:
> Hi Gilles,
> 
> Just for informations sake. I am still on xeno 2.4.3,

The git commit probably applies cleanly to Xenomai 2.4.3.


> but setting
> .rx_timeout to RTSER_TIMEOUT_NONE has fixed the problem. Many thanks.

Good news.

-- 
                                                 Gilles.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-23  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-17 14:49 [Xenomai-help] RT Serial, rt_dev_read blocking problem Dehann Fourie
2009-04-17 15:09 ` Gilles Chanteperdrix
2009-04-19  8:51   ` Dehann Fourie
2009-04-19  9:16     ` Gilles Chanteperdrix
2009-04-23  7:02       ` Dehann Fourie
2009-04-23  9:15         ` Gilles Chanteperdrix

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.