RTEMS | bsp/arm/tms570: fix SCI termios ignore framing flags bug (!1220)
Pavel Pisa (@ppisa)
gitlab at rtems.org
Tue Apr 28 08:52:51 UTC 2026
Pavel Pisa started a new discussion on bsps/arm/tms570/console/tms570-sci.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1220#note_149160
> bauddiv = ( TMS570_VCLK_HZ + baudrate / 2 ) / baudrate;
> ctx->regs->BRS = bauddiv ? bauddiv - 1 : 0;
>
> - ctx->regs->GCR1 |= TMS570_SCI_GCR1_SWnRST | TMS570_SCI_GCR1_TXENA |
> - TMS570_SCI_GCR1_RXENA;
> + // Bring the SCI out of reset and always enable TX
> + ctx->regs->GCR1 |= TMS570_SCI_GCR1_SWnRST | TMS570_SCI_GCR1_TXENA;
> +
> + // Check CREAD to see if we should also enable RX
> + if ( ( t->c_cflag & CREAD ) != 0 ) {
> + ctx->regs->GCR1 |= TMS570_SCI_GCR1_RXENA;
> + }
Rx enable only when `CREAD == 1` is correct according to to the authoritative spec
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/termios.h.html
But it should be checked that it is correctly set in BSP and RTEMS termios by default and not cleaned by mistake in some of the termios set callers in RTEMS source tree. It can be problem for some user if the keeping it one or clear by mistake occurs.
So I am for change, but check rest of the RTEMS sources the first.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1220#note_149160
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260428/eca9cae7/attachment-0001.htm>
More information about the bugs
mailing list