From 1b2942ffeeb4bcc3f93f15d84aff840723f4413e Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Wed, 5 Apr 2023 16:09:27 +0200 Subject: [PATCH] drivers: serial: stm32U5 uart driver do not toggle the DMA Tx request Errata sheet of the stm32U5 (ES0499) recommends to avoid clearing the DMAT bit with LL_USART_DisableDMAReq_TX to re-start a DMA transfer on the UART Tx block. The function becomes empty. This is also seen for stm32H5. Signed-off-by: Francois Ramu --- drivers/serial/uart_stm32.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index ed82d91d15..8762c61380 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -1088,9 +1088,19 @@ static inline void uart_stm32_dma_tx_enable(const struct device *dev) static inline void uart_stm32_dma_tx_disable(const struct device *dev) { +#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32u5_dma) + ARG_UNUSED(dev); + + /* + * Errata Sheet ES0499 : STM32U575xx and STM32U585xx device errata + * USART does not generate DMA requests after setting/clearing DMAT bit + * (also seen on stm32H5 serie) + */ +#else const struct uart_stm32_config *config = dev->config; LL_USART_DisableDMAReq_TX(config->usart); +#endif /* ! st_stm32u5_dma */ } static inline void uart_stm32_dma_rx_enable(const struct device *dev)