- This topic has 1 reply, 1 voice, and was last updated 8 years, 4 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Mastering STM32 book support forum › HAL_UART_TxCpltCallback called only for DMA in circular mode
Tagged: HAL UART DMA
HAL_UART_Transmit_DMA and HAL_UART_Receive_DMA differ in that for the receive version, the callback HAL_UART_RxCpltCallback is always called, whereas for the transmit version, HAL_UART_TxCpltCallback is called only when DMA is set to circular mode, see implementation of UART_DMATransmitCplt in stm32f4xx_hal_uart.c.
Why the difference and how do I know when TX is done?
You write it at page 282: one should enable the UART interrupt and HAL_UART_TxCpltCallback is called once at the end of the DMA transfer, independently on the DMA mode, whether normal mode of circular.