All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Yigal Goldberger <yigal_gold@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] serial com errors
Date: Sun, 13 Dec 2009 16:12:41 +0100	[thread overview]
Message-ID: <4B250469.2070204@domain.hid> (raw)
In-Reply-To: <801038.31731.qm@domain.hid>

Yigal Goldberger wrote:
> Hi Again,
> 
> I hope it's not too long and tiring ...
> But the relevant code (I think...) is the initialization stage , and the select and read loop that blocks and reads .
> 
> 
> The problem is as follows :
> I have 2 threads listening on two different serial coms . running the same code below . Using select to block and wait for bytes to be available on the port , and then reading them with the read function .
> These 2 threads are Xenomai threads with priority higher then the thread that is responsible of working on the data .
> I see that when reaceiving with BAUDRATES lower than 115200 (38400) no problem occures , and when receving on both port with BAUDRATE 115200 , I get errors in the received bytes ( which is identified by a wrong checksum ,and sometimes with a "No more room in flip buffer" printout on the console as well as errno 11 (EAGAIN) ) . When I added a 10 mili second sleep to the executing thread (the thread that uses the data )the problem seems to disappear .
> 
> 
> Below is the 2 code parts that Initialize the file descriptor of the reading thread , and the reading select - read loop :
> 
> 
> The code  creating the file descriptor :
> 
> 
> fd = open (devname, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK );

By the way, depending on the value of "devname" here, the file
descriptor may or may not be related to a real-time driver. And I
suspect in your case, it is not, because I do not think things like
cfsetispeed/cfsetospeed work with the real-time 16550 driver (the only
serial driver which is part of xenomai distribution).

-- 
					    Gilles.


      parent reply	other threads:[~2009-12-13 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07  9:57 [Xenomai-help] serial com errors Yigal Goldberger
2009-12-13 15:05 ` Gilles Chanteperdrix
2009-12-13 15:12 ` Gilles Chanteperdrix [this message]

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=4B250469.2070204@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=xenomai@xenomai.org \
    --cc=yigal_gold@domain.hid \
    /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.