diff --git a/arch/arm/src/stm32h7/stm32_serial.c b/arch/arm/src/stm32h7/stm32_serial.c index 2fd9ae40769..537abe3f6a6 100644 --- a/arch/arm/src/stm32h7/stm32_serial.c +++ b/arch/arm/src/stm32h7/stm32_serial.c @@ -3376,9 +3376,11 @@ static void up_dma_txavailable(struct uart_dev_s *dev) /* Only send when the DMA is idle */ - nxsem_wait(&priv->txdmasem); - - uart_xmitchars_dma(dev); + int rv = nxsem_trywait(&priv->txdmasem); + if (rv == OK) + { + uart_xmitchars_dma(dev); + } } #endif