From: dev.c0debabe@gmail.com (Stefan Schoenleitner)
To: linux-arm-kernel@lists.infradead.org
Subject: at91sam9260 on linux 2.6.31 with at91 patchset: UART looses bytes when receiving packets
Date: Sat, 31 Oct 2009 15:00:54 +0100 [thread overview]
Message-ID: <4AEC4316.3050008@gmail.com> (raw)
In-Reply-To: <4AEC1D8D.7020209@gmail.com>
Hi,
I added some debug code to the atmel_serial.c kernel driver now.
The result is that the kernel *correctly receives* all bytes from the "bad" packet:
kernel: hexdump(): 30 bytes
kernel: 0000 61 00 1a 01 01 c0 3c 22 cd 3c 36 4b 13 ae 56 99 .a.....<".<6K..V
kernel: 0010 00 21 e4 29 84 0d c3 6a 95 17 6f 4d 9f c7 .!.)...j..oM..
But in the application the 0x13 byte is never received:
hexdump(): 4 bytes
0000 61 00 1a 01 a...
read chunk of 25 bytes
hexdump(): 25 bytes
0000 01 c0 3c 22 cd 3c 36 4b ae 56 99 00 21 e4 29 84 ...<".<6K.V..!.)
0010 0a c3 6a 95 17 6f 4d 9f c7 ..j..oM..
Is it possible that the byte 0x13 is somehow filtered out ?
If so, why does the same code work then on the PC but not on the ARM board ?
I suspect that my raw terminal setup is missing something ?
--------------------------------------------------------------------------
// set format 8N1
newtio.c_cflag &= ~CSIZE; // Mask the character size bits
newtio.c_cflag &= ~PARENB;
newtio.c_cflag &= ~CSTOPB;
newtio.c_cflag &= ~CSIZE;
newtio.c_cflag |= CS8; // Select 8 data bits
// use hardware flow control (RTC/CTS)
newtio.c_cflag |= CRTSCTS;
// raw input
newtio.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
// raw ouput
newtio.c_oflag &= ~OPOST;
// enable receiver and local mode
newtio.c_cflag |= (CLOCAL | CREAD);
newtio.c_cc[VTIME]=0;
newtio.c_cc[VMIN]=1;
--------------------------------------------------------------------------
cheers,
stefan
next prev parent reply other threads:[~2009-10-31 14:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-30 17:25 at91sam9260 on linux 2.6.31 with at91 patchset: UART looses bytes when receiving packets Stefan Schoenleitner
2009-10-30 22:08 ` Gerard Kam
2009-10-31 11:20 ` Stefan Schoenleitner
2009-10-31 14:00 ` Stefan Schoenleitner [this message]
2009-10-31 14:16 ` Russell King - ARM Linux
2009-10-31 14:24 ` Stefan Schoenleitner
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=4AEC4316.3050008@gmail.com \
--to=dev.c0debabe@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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.