drivers: serial: uart driver for stm32U5 suspends dma channel

When DMA transfer is enabled on the stm32U5,
the UART Tx channel must be suspended before stopping.
This will let the on-going transfer ends properly

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2022-10-04 17:18:42 +02:00 committed by Carles Cufí
commit e00f91da41

View file

@ -1377,6 +1377,9 @@ static int uart_stm32_async_tx_abort(const struct device *dev)
data->dma_tx.counter = tx_buffer_length - stat.pending_length;
}
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32u5_dma)
dma_suspend(data->dma_tx.dma_dev, data->dma_tx.dma_channel);
#endif /* st_stm32u5_dma */
dma_stop(data->dma_tx.dma_dev, data->dma_tx.dma_channel);
async_evt_tx_abort(data);