diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 18e65f1d9a..327e515b5f 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -981,6 +981,8 @@ static void up_setspeed(struct uart_dev_s *dev) } else { + DEBUGASSERT(usartdiv8 >= 8); + /* Perform mysterious operations on bits 0-3 */ brr = ((usartdiv8 & 0xfff0) | ((usartdiv8 & 0x000f) >> 1));