Skip to content

Commit 0468c5f

Browse files
wojciechslenskacfriedt
authored andcommitted
drivers: serial: stm32: don't disable DMA in circular mode
When cyclic mode is enabled, do not disable RX. This mode ensures continuous availability of RX buffers. Signed-off-by: Wojciech Slenska <[email protected]>
1 parent 301b20a commit 0468c5f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/serial/uart_stm32.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,9 @@ static void uart_stm32_async_rx_timeout(struct k_work *work)
19621962
*/
19631963
unsigned int key = irq_lock();
19641964

1965-
if (data->dma_rx.counter == data->dma_rx.buffer_length) {
1965+
/* When cyclic DMA is used, do not disable the RX on timeout */
1966+
if (data->dma_rx.dma_cfg.cyclic == 0 &&
1967+
data->dma_rx.counter == data->dma_rx.buffer_length) {
19661968
uart_stm32_async_rx_disable(dev);
19671969
} else {
19681970
uart_stm32_dma_rx_flush(dev, STM32_ASYNC_STATUS_TIMEOUT);

0 commit comments

Comments
 (0)