From 46999f94748403c0c9ff5f5387d40daffe650a33 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 30 May 2018 00:45:07 -1000 Subject: [PATCH] kinetis:kinetis_lowputc fix BRFA calculation effecting baudrate Previous BRFA was not cleared and or-ed into new BRFA, hence buadrate was wrong. Where Baud Rate Fractional Divisor (BRFD) UART baud rate = clock / (16 * (SBR + BRFD)) --- arch/arm/src/kinetis/kinetis_lowputc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/kinetis/kinetis_lowputc.c b/arch/arm/src/kinetis/kinetis_lowputc.c index 670f6fb69d..39aa21599c 100644 --- a/arch/arm/src/kinetis/kinetis_lowputc.c +++ b/arch/arm/src/kinetis/kinetis_lowputc.c @@ -698,7 +698,7 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud, /* Set the BRFA field (retaining other bits in the UARTx_C4 register) */ - regval = getreg8(uart_base+KINETIS_UART_C4_OFFSET) & UART_C4_BRFA_MASK; + regval = getreg8(uart_base+KINETIS_UART_C4_OFFSET)& ~UART_C4_BRFA_MASK; regval |= ((uint8_t)brfa << UART_C4_BRFA_SHIFT) & UART_C4_BRFA_MASK; putreg8(regval, uart_base+KINETIS_UART_C4_OFFSET);