From 7388970c858b72e53d7d2b85f271d5187fae21e4 Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Tue, 28 Nov 2023 06:46:17 +0100 Subject: [PATCH] serial: stm32: do not clear TC flag in async mode The Transfer Complete flag (TC) is used to check if a transfer is complete. This mechanism is used before suspending the UART module to make sure that all data are sent before the suspend procedure. The UART ISR clears this flag after completion of a async transfer which causes a hang during UART device suspend setup. There is just no need to clear this flag in ISR, it is cleared every time we start a new async transfer. Signed-off-by: Dawid Niedzwiecki --- drivers/serial/uart_stm32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index 097ba70c1b6..f2c05da357e 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -1257,7 +1257,6 @@ static void uart_stm32_isr(const struct device *dev) LL_USART_IsActiveFlag_TC(config->usart)) { LL_USART_DisableIT_TC(config->usart); - LL_USART_ClearFlag_TC(config->usart); /* Generate TX_DONE event when transmission is done */ async_evt_tx_done(data);