Bug with MPC55XX eSCI serial port byte size and parity?

Joel Sherrill joel.sherrill at oarcorp.com
Sat Aug 23 13:56:39 UTC 2014

That all sounds very reasonable and since you have the hardware, you can check that it works. The interactive termios test is good for manually cycling through all the various settings. Change them on the target, then your comma program, see if the output is still right and then check another setting.


On August 23, 2014 8:19:59 AM CDT, Peter Dufault <dufault at hda.com> wrote:
>I think the behavior of the esci.c serial port driver in
>libcpu/powerpc/mpc55xx/esci/esci.c is incorrect.  I'm basing this
>partly on this page:
>The eSCI itself supports 8 and 9 bits of data with and without parity.
>I think TERMIOS CS7 and CS8 selects the number of data bits, and when
>parity is enabled you get an additional parity bit.  So CS7 with parity
>sends 8 bits, and CS8 with parity sends 9 bits.
>The existing driver rejects all character sizes except CS8 and allows
>enabling parity, but when you enable parity it sends 7 data bits and 1
>parity bit, which I think is incorrect behavior.
>The following settings can be supported using the 8 bit data setting on
>the eSCI (leaving the "M" bit in the device control register clear),
>essentially what the driver is doing now except it is always forcing
>you to specify "CS8":
>8 bits, no parity, 1 stop bit (8N1):
>options.c_cflag &= ~(PARENB|CSTOPB|CSIZE);
>options.c_cflag |= CS8;
>7 bits, even parity, 1 stop bit (7E1):
>options.c_cflag &= ~(PARODD|CSTOPB|CSIZE);
>options.c_cflag |= CS7|PARENB;
>7 bits, odd parity, 1 stop bit (7O1):
>options.c_cflag &= ~(CSTOPB|CSIZE);
>options.c_cflag |= CS7|PARENB|PARODD;
>The following settings can't currently be set, but can be supported by
>using the 9 bit data setting on the eSCI (setting the "M" bit in the
>control register):
>8 bits, even parity, 1 stop bit (8E1):
>options.c_cflag &= ~(PARODD|CSTOPB|CSIZE);
>options.c_cflag |= CS8|PARENB;
>8 bits, odd parity, 1 stop bit (8O1):
>options.c_cflag &= ~(CSTOPB|CSIZE);
>options.c_cflag |= CS8|PARENB|PARODD;
>All other settings would be illegal, since the eSCI supports no other
>sizes and only supports a single stop bit.
>Does this sound correct?  I'll prepare a patch.
>I verified that by setting the M bit you get 8 data bits plus 1 parity
>bit.  A client of mine bumped into this problem trying to send data to
>a device that required 8 data bits plus parity, and it couldn't be done
>with the existing interface.
>Peter Dufault
>HD Associates, Inc.      Software and System Engineering
>users mailing list
>users at rtems.org

More information about the users mailing list