From 2b6d0757f91c141fbb7b3021bab3ca41a321b976 Mon Sep 17 00:00:00 2001 From: Vincent Dupont Date: Mon, 4 Feb 2019 14:25:59 -0800 Subject: [PATCH] cpu/stm32_common: fix DMA releasing in UART driver --- cpu/stm32_common/periph/uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/stm32_common/periph/uart.c b/cpu/stm32_common/periph/uart.c index 7a932b088cc4..7bd3fd6426ef 100644 --- a/cpu/stm32_common/periph/uart.c +++ b/cpu/stm32_common/periph/uart.c @@ -306,12 +306,12 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len) dev(uart)->CR3 |= USART_CR3_DMAT; dma_transfer(uart_config[uart].dma, uart_config[uart].dma_chan, data, (void *)&dev(uart)->TDR_REG, len, DMA_MEM_TO_PERIPH, DMA_INC_SRC_ADDR); - dma_release(uart_config[uart].dma); /* make sure the function is synchronous by waiting for the transfer to * finish */ wait_for_tx_complete(uart); dev(uart)->CR3 &= ~USART_CR3_DMAT; + dma_release(uart_config[uart].dma); } return; }