[PATCH] TMS570 console driver, SCI frame error (baudrate calculation error)

zack zakthertemsdev at gmail.com
Mon Jul 10 01:02:26 UTC 2023


---
 bsps/arm/tms570/console/tms570-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Fixes #4903
diff --git a/bsps/arm/tms570/console/tms570-sci.c b/bsps/arm/tms570/console/tms570-sci.c
index 768770a4c8..59a0b7e6f1 100644
--- a/bsps/arm/tms570/console/tms570-sci.c
+++ b/bsps/arm/tms570/console/tms570-sci.c
@@ -311,7 +311,7 @@ bool tms570_sci_set_attributes(
   /* Apply baudrate to the hardware */
   baudrate *= 2 * 16;
   bauddiv = (BSP_PLL_OUT_CLOCK + baudrate / 2) / baudrate;
-  ctx->regs->BRS = bauddiv? bauddiv - 1: 0;
+  ctx->regs->BRS = bauddiv? bauddiv - 2: 0;
 
   ctx->regs->GCR1 |= TMS570_SCI_GCR1_SWnRST | TMS570_SCI_GCR1_TXENA |
                      TMS570_SCI_GCR1_RXENA;
-- 
2.34.1



More information about the devel mailing list