hi,

with option RTSER_RTIOC_WAIT_EVENT in rt_dev_ioctl(), this function returns
un number -110 (Connection timed out)
with option RTSER_RTIOC_GET_STATUS in rt_dev_ioctl(), this function returns
un number 0 (not message)

Anyway, currently it works without  rt_dev_ioctl(), i can see rt_dev_read()
wait data event (with debug mode) while giving the period of write
task,  for exemple  = two seconds.

so can i remove the funtion rt_dev_ioctl?


On Fri, Mar 30, 2012 at 3:31 PM, Wolfgang Grandegger <w...@grandegger.com>wrote:

> On 03/30/2012 01:15 PM, Minh GIANG wrote:
> > hello,
> >
> > after testing a lot of time, i have one port which doesn't work well in
> > writing (material problem i think). Now it works in writing and reading
> > with one condtion that i have to remove the function
> > "err=rt_dev_ioctl(...)" because it returns error.
>
> Hm, what does rt_dev_ioctl() return?
>
> > could you tell me the interet of this function? i think that rt_dev_read
> is
> > enough to read the message.
>
> Well, the ioctl waits for certain events and informs the task when they
> occur. "cross_link.c" actually waits for the RTSER_EVENT_RXPEND meaning
> that RX data are available. So, the sub-sequent read will/must work. You
> do not need to call that ioctl but the read directly. But I doubt that
> the read return successfully.
>
> Maybe the interrupt service routine does detect errors due to hardware
> problems:
>
>
> http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/serial/16550A.c#213
>
> and that's why the interrupt counter increases.
>
> You could check that by setting RTSER_EVENT_ERRPEND or reading the
> status using the ioctl request RTSER_RTIOC_GET_STATUS.
>
> Wolfgang.
>
> > On Fri, Mar 30, 2012 at 10:45 AM, Minh GIANG <giang.hm...@gmail.com>
> wrote:
> >
> >> hello,
> >> thanks for your response. i compile cross-link program in ECLIPSE C++ so
> >> my command in setting configuration is
> >> command :   g++
> >> All options:   -l/usr/xenomai/include -O3 -wall -c -fmessage-length=0
> >>
> >> i connected 2 serial port of my computer by one cable in order to make
> the
> >> test. The write task works well but the other task is blocked by
> rt_dev_ioctl(...).as
> >> i already mentionned and when i removed rt_dev_ioctl, the "rt_dev_read"
> >> function return 0
> >> I did what you said, but it doesn't work yet
> >>
> >> On Fri, Mar 30, 2012 at 8:43 AM, Wolfgang Grandegger <w...@grandegger.com
> >wrote:
> >>
> >>> On 03/29/2012 05:26 PM, Minh GIANG wrote:
> >>>> i want to revive the topic over the problem RTSER_RTIOC_WAIT_EVENT
> >>>> while compiling cross-link.c program. I cann't resolve my problem
> >>>> after doing some solution given by the others
> >>>>
> >>>> Loading module:
> >>>>
> >>>> insmod ./xeno_16550A.ko io=0x3f8,0x2f8 irq=4,3 tx_fifo=10,20
> >>>
> >>> Hm, is a FIFO size of 20 supported by the hardware? For a first try I
> >>> would drop "tx_fifo=10,20" (using the default of 16 for both uarts).
> >>>
> >>>> start_index=0 (i have two serial ports on my pc)
> >>>>
> >>>> running crosslink test:
> >>>>
> >>>> main : write-file opened
> >>>> main : write-config written
> >>>> main : read-file opened
> >>>> main : read-config written
> >>>> main : write-task created
> >>>> main : read-task created
> >>>> main : starting write-task
> >>>> main : starting read-task
> >>>>  Nr |   write->irq    |    irq->read    |   write->read   |
> >>>> -----------------------------------------------------------
> >>>> read_task: error on RTSER_RTIOC_WAIT_EVENT, Connection timed out
> >>>> read_task: error on RTSER_RTIOC_WAIT_EVENT, Connection timed out
> >>>>
> >>>> ...
> >>>>
> >>>>
> >>>>
> >>>> running test:
> >>>>
> >>>> cat /proc/xenomai/irq
> >>>>
> >>>> IRQ         CPU0
> >>>>   3:        1089         rtser1
> >>>>   4:        5155         rtser0
> >>>
> >>> You get interrupts, at least, but not the same amount, strange. What
> >>> cross-link command options do you use?
> >>>
> >>> Wolfgang.
> >>>
> >>
> >>
> >
>
>
_______________________________________________
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help

Reply via email to