[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a problem with serial port (can't post in mail-list)

I received this personally and am forwarding it to the list.

I sent David info on why he might not have been able to post.


David García wrote:
Hi, I've tried to post my doubt in the rtems-users@rtems.com <mailto:rtems-users@rtems.com> mailing list but I'm not really sure if it has been send correctly as there was no feedback and my post doesn't appear in the website.

Is for that I'm writting to you directly becaus I'm having some problems with rtems, and I explain it below:

We are trying to do a migration from a Linux application to RTEMS v4.6 using the pc386 BSP. The application runs well under Linux but under RTEMS does not run well.

The cross compiler does not report an error but at runtime the code hangs.

We think the code hangs when we do the following call to ioctl:

"ioctl(fdes, FIONREAD, (int)&unread)"

- fdes is the file descriptor that we have obtained by opening the serial port COM1, which is registered in the system with the name "/dev/ttyS1". Since the function open "/dev/ttyS1",O_RDWR | O_NONBLOCK | O_NOCTTY) does not result in an error we assume that the drivers have been initialized correctly. We used the TT1_DRIVER_TABLE_ENTRY, defined in the file tty_drv.h, to add the appropriate entry to the device driver table of the RTEMS configuration.

- (int)&unread is the pointer to an integer were we want to obtain the unread bytes.

We have seen that FIONREAD definition in ioccom.h differs from the one that is defined in the ioctls.h header of linux libraries.

We suspect that is when we call the function ioctl that the application fails, and the systems hangs up.

The question is: should we do the ioctl call differently? Or could the problem be in a different point of the application?

Any sugestion will be wellcome.

If you would like more information please do not hesitate to email back.

Thank you very much for your patience.

Best regards


David García Antón


Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985