Termios: Non-blocking read() working? .-
Sebastian E. Garcia
sg-listas at slabs.com.ar
Fri Jun 8 19:31:12 UTC 2012
After some tests, I'm in doubt if this feature of Termios is implemented
Environment: Target LEON3/GRLIB 4113 ; RTEMS 4.10 ; RCC 1.2.0. Termios
configured in raw mode for an APBUART.
(I recently made a similar post to the LEON_SPARC mailing list)
Have one UART receiving binary data packets. Periodically, I need
to read the Rx SW buffer, as fast as possible. A GPIO IRQ releases a
semaphore, signaling that a whole new (<150bytes) packet arrived.
The behaviour I intend is the following: BSP/Termios filling the SW
buffer using UART's Rx IRQ. And a periodic access to this SW buffer
using a non-blocking read() function called from a given task,
(requesting more than 150bytes).
Can't achieve a non-blocking read of more than one byte at a time.
The blocking Termios configuration variants seems to work OK with read().
For the (desired) non-blocking operation, I've tried opening with
O_NONBLOCK parameter, and setting Termios with VMIN=VTIME=0.
But the output of the read() function is always 1 byte long when I set
these non-blocking configs.
I suspect there's something with the interaction between the BSP driver
and Termios, I may be forgetting some configuration, or simply this
feature was not implemented.
Any pointers, known-good non-blocking configuration, or workaround will
be greatly appreciated, before diving into RTEMS code.
More information about the users