From: Jan Kiszka <jan.kiszka@domain.hid>
To: Vikesh Rambaran <vikesh.rambaran@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] rtserial interface stalls
Date: Sat, 21 Mar 2009 10:02:44 +0100 [thread overview]
Message-ID: <49C4AD34.7010303@domain.hid> (raw)
In-Reply-To: <1237563537.9844.150.camel@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]
Vikesh Rambaran wrote:
> On Fri, 2009-03-20 at 12:46 +0100, Jan Kiszka wrote:
>> Vikesh Rambaran wrote:
>>> ...
>>> Alternative tried (after a bit of debugging)
>>> -----------------
>>>
>>> Changed serialConfig.tx_timeout = RTSER_DEF_TIMEOUT;
>>> to serialConfig.tx_timeout = RTDM_TIMEOUT_NONE;
>>>
>>> Task 2 then runs continuously. Writing to rtser0 returns valid number of
>>> bytes written but no data appears on serial port pin. At the same time
>>> rtser1 functions normally.
>> Without feedback from the device about its tx queue state you may
>> quickly overload it this way (definitely if written bytes > fifo length).
>>
>
> The idea is to write data into the devices' circular buffer and return
> immediately. If there is not enough place in the buffer, i expected
> the write call to return an error code or fewer bytes than that which
> was requested. That would indicate a buffer overrun condition which can
> be flagged at application level. This way the task will not be delayed
> and other important functionality can be executed in a deterministic
> way.
>
> The data transmitted on each serial channel is less than 150 bytes at
> 115200kb/s with the task having a fixed period of 20mS. This should not
> overflow default 4k buffers of the 16550A driver.
>
> Well that's the plan:) Did i perhaps misunderstand the implementation
> for the tx_timeout ?
>
No, I agree your approach is valid, and even non-blocking write should
behave as you expected. I actually forgot that the uart driver is that
smart - at least in theory. Something else is fishy.
When you switch to non-blocking, is there no data at all written, or
does transmission stop roughly around where blocking write would stop
the writer?
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2009-03-21 9:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-20 10:56 [Xenomai-help] rtserial interface stalls Vikesh Rambaran
2009-03-20 11:46 ` Jan Kiszka
2009-03-20 15:38 ` Vikesh Rambaran
2009-03-21 9:02 ` Jan Kiszka [this message]
2009-03-21 16:26 ` vikesh rambaran
[not found] ` <b131c9f0903230122r713d131x7bb516ed9d00a42a@domain.hid>
2009-04-06 9:30 ` vikesh rambaran
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=49C4AD34.7010303@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=vikesh.rambaran@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.