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

Re: Serial port ttys0 and ttys2



Thanks Johan for your help,
I'm doing some test about your message,

I read the file : ET100LX_07_DMA_011019.pdf

DMA Channel 0/1 (Priority highest) : Network
DMA Channel 2/3                    : Async serial port P2 (ttyS2)
DMA Channel 4/5                    : ?
DMA Channel 6/7                    : Async serial port P0 (ttyS0)
DMA Channel 8/9 (Priority lowest)  : ?

Why this c program run very well on the ttyS0 and not on the ttyS2 ?
Logicaly the ttyS2 must be the best !


Johan Adolfsson a écrit:
> Hi,
> Please see my comments below:
> 
> ----- Original Message ----- 
> From: "Frossard Philippe" <p.frossard@xxxxxxx.ch>
> To: <jonashg@xxxxxxx.com>
> Cc: "Dev-etrax" <dev-etrax@xxxxxxx.com>
> Sent: Wednesday, August 18, 2004 11:42 AM
> Subject: Re: Serial port ttys0 and ttys2
> ...
> 
> 
>>CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS=5
> 
> 
> You could try changing to:
> CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS=1
> 
> 
>>The test on ttyS2 :
>>===================
>>I made a c program (See the previous message in this thread).
>>
>>If you send a file about 1Mbytes on the ttyS2 with minicom program, the 
>>number of byte receive is not correct (I have only one Telnet connection 
>>to the axis board ! / I don't use Ftp or Http in the same time).
>>
>>The messages on ttyS0 :
>>=======================
>>handle_descr_data: Too much pending incoming serial data! Dropping 256 
>>bytes.
>>handle_descr_data: Too much pending incoming serial data! Dropping 256 
>>bytes.
>>...
>>
>>-- 
>>Philippe Frossard
> 
> 
> I believe the debug output indicates that the application is not 
> reading data fast enough, and might be busywaiting for data
> and thus starving the CPU.
> You could try skipping the usleep() in your program or even better
> use a select() call to wait until data is avalable or use blocking 
> reads instead (skip the O_NONBLOCKING flag in open()).
> (or use flow control although I don't think that should be needed for
>  an application that uses select())
> 
> Maybe worth nothing:
> * Your read() will probaly just return max 4096 bytes since thats 
>   what the tty buffers are.
> * An usleep(5000) will probably sleep in at least 10 msec.
> 
> You could also try adding:
>  flush_to_flip_buffer(info);
> at the end of the receive_chars_dma() function in 
> os/linux/arch/cris/drivers/serial.c
> but I don't think that's the problem for you.
> 
> Let us know if it helps.
> 
> /Johan
> 
> 

-- 
Philippe Frossard