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: MPC8xx SMC serial problem




Gary Thomas wrote:
On Fri, 2006-01-27 at 13:00 +0000, Will Wagner wrote:
Hi All,

Been testing serial comms with parity enabled. Always get the data sent but occasionally (~25%) I get spurious data as well.

Looking at it in the debugger it appears the buffer descriptor doesn't hold valid data but it is being passed to the driver anyway. The control flags of the buffer descriptor show that there has been a parity error but this is never checked in the function quicc_smc_serial_DSR, it only checks that the buffer is ready for processing not that there wasn't an error.

I think a change like this would fix the problem:

while (rxbd != rxlast) {
if ((rxbd->ctrl & (QUICC_BD_CTL_Ready | QUICC_BD_CTL_Frame | QUICC_BD_CTL_Parity)) == 0) { // Check if data error
for (i = 0; i < rxbd->length; i++) {
(chan->callbacks->rcv_char)(chan, rxbd->buffer[i]);
}



I don't see how this adds any protection/testing, unless Ready/Frame are
*not* set when Parity is. (I've never seen parity errors on this interface, so I'm not sure)

Indeed I'm seeing the ready bit not set (Which is really badly named and should be labeled not empty), but the parity error bit set.



Do you really want to pass in bogus data if there were errors?

No and I believe my change prevents this.



Also need to add QUICC_BD_CTL_Frame & QUICC_BD_CTL_Parity to the list of defines in ppc8xx.h

Does this make sense? Has anyone else seen this problem? Presumably need to apply the same change to the SCC DSR?

If you do get this worked out, a proper patch would be in order. Prose quoting of modified code doesn't help much (and typically won't be moved into the repository)

Will test my changes and try to build a patch.



Also, just out of curiosity, what platform/target is this on?

It's a custom 133MHz 866 board.




-- ------------------------------------------------------------------------ Will Wagner will_wagner@carallon.com Senior Project Engineer Office Tel: 0207 371 2032 Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA ------------------------------------------------------------------------


-- 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]