fread blocks on device data read?

João Rasta freakforever at gmail.com
Tue Aug 17 16:13:09 UTC 2010


read() is not working as well with the uart in interrupt mode. It blocks the
same way as fread. I have set the termios parameters the same way as in the
RTEMS version with the uarts in polling mode so this is not the cause.  What
can i be missing? Any suspicious configuration?

I'm configuring RTEMS with

#define CONFIGURE_INIT
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS           2


#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS    10
#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE        (10*1024)
#define CONFIGURE_INIT_TASK_ATTRIBUTES                RTEMS_FLOATING_POINT

#define CONFIGURE_MAXIMUM_POSIX_THREADS             10
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES                10
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES    8
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES            8
#define CONFIGURE_MAXIMUM_POSIX_KEYS                5
#define CONFIGURE_MAXIMUM_POSIX_TIMERS                5
#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS        8
#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES        8



Best,
JM

On Tue, Aug 17, 2010 at 5:00 PM, Eric Norum <wenorum at lbl.gov> wrote:

> On Aug 17, 2010, at 8:56 AM, João Rasta wrote:
>
> > You mean setting termios struct and use tcsetattr() to set the
> parameters? tcsetattr() only accepts the file descriptor ID as an int, not a
> FILE * pointer which is returned by fopen()..
>
> Right.
> In many cases you're better off using the low level open/read/write calls
> with serial ports anyway since the buffering performed by the stdio routines
> just gets in the way.
>
> >
> > Anyway it was working with the uart in polling mode so it should work
> also in interrupt mode without changing any RTEMS parameter right?
>
> I don't know enough about the implementation of the serial port driver to
> answer this.
>
> --
> Eric Norum
> wenorum at lbl.gov
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20100817/e85a1647/attachment-0001.html>


More information about the users mailing list