Forum Discussion
Altera_Forum
Honored Contributor
21 years agoI have performed some more analysis on the standard Altera Avalon Uart as well as a Cal Avalon Uart that is the same basic design, except it contains FIFO's.
Regardless of which uart I use, I see performance problems. The symptoms of these problems are dropped characters due to overflow. Using SignalTap, I've found that a lot of interrupts are being generated. The NIOSserial.c driver is supposed to read all characters out of a FIFO (if it exists) without the need for another interrupt to be generated. I believe this basically works. However, I have found some behavior that I think might be a problem. The NIOSserial.c driver unmasks the trdy bit quite often. The effect of this is an interrupt is immediately generated by the UART. This interrupt indicates that the transmit buffer is empty and the uart is ready to receive more characters for transfer. I can understand how this would be important, but it seems like it is causing more interrupts than necessary. I would like to get some opinions on whether or not this could be fixed in the driver. I have observed the following behavior when receiving a single character with the standard Altera Avalon Uart. First, I open the port for reading <div class='quotetop'>QUOTE </div> --- Quote Start --- "cat /dev/ttyS1 > /tmp/dump.txt &"[/b] --- Quote End --- The following routines are called in the driver rs_open() startup() transmit_chars() Then, I use an external terminal connected to this port to send a single character. A serial cable connects ttyS1 on the external machine to ttyS1 on the ukit development board. <div class='quotetop'>QUOTE </div> --- Quote Start --- echo "A" > /dev/ttyS1[/b] --- Quote End --- Using printk's, I've traced the flow to the following: receive_chars() transmit_chars() rs_write() transmit_chars() rs_write() transmit_chars() The only thing that can cause the transmit_chars() routine to be called is an interrupt where the trdy bit is set. This interrupt will only be generated by the UART when the ie_trdy bit is set (interrupt enable for trdy). It seems to me that the transmit_chars() routine is getting called way to often for this driver to be efficient. Can somebody help me out here? Has anybody else experienced this problem? Thanks.