SLUG Mailing List Archives
Re: [SLUG] Serial write problem
- To: Jim Donovan <jimd@xxxxxxxxxxxxx>
- Subject: Re: [SLUG] Serial write problem
- From: Amos Shapira <amos.shapira@xxxxxxxxx>
- Date: Sat, 22 May 2010 21:51:25 +1000
- Cc: slug@xxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=aZU8ugs8RemhKrasbc+bkVb5AbKOKlvLpd41BCYUPBc=; b=VCv3v1UI1LXCPBHcKt42ZrTnd8zh2955hoD8Jui0TUua45iEqeOMKjOFooxB2zaMg2 AcpawxkTkZkh80DA/BPKVhVZyTkda8gctFzzMBPubl+wnOvG14BWi5orcweJFgYBIi/3 Qp9gr76GnJXH5VK4SM41zwu6+1vFfHmMwYrJU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=A9Yeqet0FRM3iZ1zyD7/LPjaeJtqKWFS2i64N0mnmz2/lIpU2nOIvjlmOEDCAv19cT 6xIn9h7iaPla/rQswnnfQHFaKw1a2UnZHqjxj5qFqpygHAdKRPIPpMZ5ZAUMk+dYSFtp 4xo5hH7InqJzhpHK4hYyOuQ352R4wlxPynCoY=
On 22 May 2010 20:46, Jim Donovan <jimd@xxxxxxxxxxxxx> wrote:
> I have been working with a single-board computer (TS-7250, using the built-in linux) which, about three times per second, sends 8-byte messages out through COM2 to another device. Very occasionally (it can go 20 hours without failing) a message doesn't all get transmitted. Only 7 of the eight bytes get sent. On these occasions, the status returned by write(2) is "Resource temporarily unavailable".
What line discipline is the tty driver in? raw? cooked?
What do you see on the other side?
Looking at tty(4) now I see that things progressed hugely since I last
programmed serial terminals, so I'm not up to date with all the API's
but I assume the principles of serial communications are still similar
- there could be (usually should be) some flow-control and checksum
mechanism going on between the two sides which might interfere with
the flow (flow control could be either using STOP and START bytes
(^Q/^S) or lowering the signal on one of the lines).
> It seems reasonable to try another write(2) to transmit the eighth byte. However, it crashes without returning. We tried with COM1 and the same thing happened. This is illogical - we are not using handshaking and the UART has no way of knowing what is going on at the other end of the line or even whether there is anything there. I have dumped termios and the control registers immediately before the crash; no corruption or other abnormality is evident.
How do you define a "crash"? The program explodes? The UART stops
responding? The entire single board kernel crashes? what?
Can you give more details from the control registers and the other
data you gathered?
> Before I try a different linux (cut-down debian Potato is available), does anyone have any simpler suggestions?
> Jim Donovan
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html