Termios Problem

Mike Siers mikes at poliac.com
Fri Sep 28 15:51:01 UTC 2001

I am working on a Coldfire 5206e BSP and I noticed a problem that
I think needs to be fixed in the termios code.

I setup a simple test program that is just trying to talk with an external
modem.  The program just sends out the "AT\r" string and waits to receive
the "OK" response string.  Once it receives the OK response, it then
sends another "AT" command.  I also have setup a PC with two serial
ports between the Coldfire and the modem.  The PC just displays all the
data that is sent between the two devices.

The test works perfectly the first time.  The PC displays the three
transmitted characters and the modem's response.  But the second transmit
request actually sent 16 characters to the modem.  Most of these
characters were NULL.

I traced the problem to the following functions.  The transmit interrupt
was calling the function rtems_termios_dequeue_characters().  This function
increments a dequeue length variable and then calls the function
rtems_termios_refill_transmitter().  The problem is that when the transmit
buffer is empty, the dequeue length variable is not reset to zero.  So the
next valid transmit request was sending extra data.  Resetting the dequeue
length variable to zero, fixes the problem.

Any thoughts?  Should this problem be fixed with a simple change to
the termios code?  Or should I have to make the fix in the BSP code
to ensure that transmit iterrupts are not enabled when the buffer is empty.

Mike Siers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20010928/93a0b0f7/attachment.html>

More information about the users mailing list