This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DSR latency


Roland Caßebohm <roland.cassebohm@visionsystems.de> writes:

> Hello,
> 
> I'm using an ARM7TDMI system (Samsung S3C4510A).
> My problem is that sometimes the time between an ISR and a DSR is very long. 
> I'm using external UARTs (16550) and with higher baudrates I lose characters. 
> There characters are read in the DSR routine of the serial driver (generic 
> 16x5x). So if DSR latency is to long, the FIFO of the UART overruns. I have 
> seen DSR latency of more than 1ms sometimes (with oscilloscope).
> With help of the kernel instrumentation I have found out, that such long 
> delays happen if the UART interrupt comes in concurens with the system clock 
> DSR and this calls some alarm calls.

The trace you supplied shows the UART DSR is delayed by about 200µs,
which is still less than one character time at 38400bps. The 16x5x
FIFO should be able to absorb this slight jitter with no
problem. Normally we only see things like this in FIFO-less UARTs.

Do you have any alarm functions that may take up to a millisecond to
run? If so consider moving that function to a thread and just kicking
the thread from the alarm function.

> 
> Is there any option to give the UART DSR a higher priority as the system clock 
> DSR?

No, DSRs shouldn't need prioritizing like that. They should be short.

> Otherwise I think about changing the serial driver to read the character in 
> the ISR and working in block transfer mode.
> 

We have in the past put a software FIFO between the ISR and DSR, but
only for FIFO-less devices. The 16x5x should never need it.


The 1ms DSR latency you have seen is worrying, there's nothing is eCos
that should be absorbing all that time. There must be something else
going on. Either there is some software in a DSR which should not be
there, or interrupts are being missed in the hardware, or maybe
something is disabling interrupts for a long time. Are you sure that
the 16x5x FIFOs are actually working? 


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]