diff options
author | Yuuki NAGAO <wf.yn386@gmail.com> | 2025-09-15 14:04:37 +0900 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-09-18 22:36:16 +1000 |
commit | c4d99f34ae4bbec075550acff680f31364708580 (patch) | |
tree | 45c027ee6c8458d9ea34e8382b88c4ffdbcbe4ec | |
parent | 7cbe083b2c8d58ae3e0128b28f001934d45cff35 (diff) |
stm32/uart: Fix LPUART init failure with low baudrate.
UART prescaler value should set up correctly to initialize LPUART with low
baudrate for STM32G0/G4/H5. This can be implemented similarly to
STM32H7/N6/WB.
Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
-rw-r--r-- | ports/stm32/uart.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/stm32/uart.c b/ports/stm32/uart.c index d0c5819b2..63de8cc6f 100644 --- a/ports/stm32/uart.c +++ b/ports/stm32/uart.c @@ -673,7 +673,7 @@ bool uart_init(machine_uart_obj_t *uart_obj, huart.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; #endif - #if defined(STM32H7) || defined(STM32N6) || defined(STM32WB) + #if defined(STM32G0) || defined(STM32G4) || defined(STM32H5) || defined(STM32H7) || defined(STM32N6) || defined(STM32WB) // Compute the smallest prescaler that will allow the given baudrate. uint32_t presc = UART_PRESCALER_DIV1; if (uart_obj->uart_id == PYB_LPUART_1) { |