[En-Nut-Discussion] Possible BUG in ARM usart driver or crt routines

Ole Reinhardt ole.reinhardt at embedded-it.de
Tue Sep 1 17:25:58 CEST 2009


Hi all,

I just discovered a strange bug, which I suppose to live anywhere in the
usart code. Eventually it's arm specific, perhaps also in the main usart
device driver code.

I'm using NutOS 4.6.0 with some extra bugfixes on an ethernut3 board.

In my special case I set the TX buffer size to a specific value. Let's
say 8. When I then try to send out a larger data buffer with fwrite I
recognise that packages of always 8 Bytes (same size as the usart tx
buffer size) are repeated...

Example:

I'll send the following buffer:

"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

What is send out:

"abcdefgabcdefg..."

So the first 8 bytes are repeated twice, next followed by some more or
less randomly new startpoint in the buffer.

My code looks like this:

[...]
_ioctl(_fileno(uart0), UART_SETTXBUFSIZ, &txbuf_port0);
[...]

int pos = 0;
u_char buffer[100] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789äöüÄÖÜß?!
\"§$%&/()={[]}\\,.-_<>|#'~+*'....";

do {
    pos += fwrite(&buffer[pos], 1, 100 - pos, uart0);
} while (pos < 100);

Has anybode noticed this behaviour too? Or have I missed any more recent
bugfixes?

Regards,

Ole Reinhardt


-- 
 _____________________________________________________________
|                                                             |
| Embedded-IT                                                 |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|_____________________________________________________________|




More information about the En-Nut-Discussion mailing list