This is the mail archive of the ecos-discuss@sourceware.org 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: Serial communication issues


OK, not 100% clear, but I've narrowed it down to the interrupt driven
DMA receiver in at91_serial.c.

I used the default values for the HW serial driver, with a receive
buffer of 128 bytes, and a receive chunk size of 1 byte.

After adding a bunch of CYG_TRACE calls, which didn't affect the
timings too much, I captured a trace where it had dropped two bytes.

Analyzing the trace and source, I suspect that the ISR/DSR handling of
the DMA receiver isn't glitch free when done in the midst of incoming
data.

With this knowledge, I changed my receive chunk size to 6 bytes, and
the issue has gone away, for this particular use case. Not yet sure if
it is going to show up again later or not.. :/


Btw, there are a few rough edges in the trace handling when set to
halt after filling the trace buffer.
First, when printing a halted trace buffer (i.e. it is full), it will
go into an endless loop.
This from the fact that the loop variable i is set to 0 before the end
test when it has reached the last entry.
Moving the if (i == BUFFER_SIZE) test to the head of the loop instead
of at the bottom solves this (so the while test is done first, then
the if test).

Secondly, there is no way to restart the tracing once it has been
halted. I find this rather limiting, so I dropped the old_halted
variable in cyg_trace_print() so that the trace is restarted after
printing the contents of the trace buffer.

I'll consider posting this as a patch to the bugzilla database...

Cheers,
Andreas

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


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