Termios Problem

Joel Sherrill joel at OARcorp.com
Fri Sep 28 17:53:20 UTC 2001


    
Thought I would move this back to the list.  :)

Thomas Doerfler wrote:

> Hello Mike,
> 
>> I traced the problem to the following functions.  The 
> 
> transmit interrupt
> 
>> handler
>> 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.
> 
> 
> If I got you right, then the termios tx buffer pointers and 
> t_dqlen run somewhat out of sync. I think this might happen, 
> when you call rtems_termios_dequeue_characters() with a "len" 
> parameter, that is bigger than it should be. Keep in mind, 
> that you always should set the "len" parameter to the number 
> of bytes that have been actually sent out. So when you have 
> sent three bytes, len should be 3 (and not the maximum number 
> of characters that the hardware is able to send out in after 
> one service). When you get "empty" transmit interrupts (maybe 
> they signal, that the transmitter IS empty, and not HAS JUST 
> BECOME empty), then you should not call 
> rtems_termios_dequeue_characters() at all. 
> 
> Hm. Maybe that helps a bit. I am currently working with rtems-
> 4.5.0, so there is no coldfire bsp included. If you like, you 
> can send me the coldfire "console" module and I might have a 
> look at it (out of curiosity).
> 
> Bye,
> 	Thomas.
> 
>> 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.
> 
>> Thanks
>> Mike Siers
>> 
>> 
>> 
> 
> --------------------------------------------
> IMD Ingenieurbuero fuer Microcomputertechnik
> Thomas Doerfler           Herbststrasse 8
> D-82178 Puchheim          Germany
> email:    Thomas.Doerfler at imd-systems.de
> PGP public key available at: http://www.imd-
> systems.de/pgp_key.htm
> 

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




More information about the users mailing list