Showing results for 
Search instead for 
Did you mean: 

STM32H7 UART Tx with DMA (and StdPeripheralLibrary)

Associate III


using STM32CubeIDE 1.13.2 with V1.11.1
Sending some bytes over uart with DMA works so far, but i am wondering, why it is not possible to use DMA-TransferComplete Callback for this normal-mode transmission.

Directly in the lib-function "UART_DMATransmitCplt" i can see that the callback "HAL_UART_TxCpltCallback" is definitely not called if i use DMA_Normal mode (only in circular mode, of course).


Is this a bug, or is this intentionally left?
How can i get an callback if a normal DMA-Transfer is completed, i don't want to poll the DMA-Flags.


thanks an best regards

Associate III

later on I found out, that the DMA_complete IT enables the UART_TX_complete IT. This one is triggered after the end of the transfer.
But now there are both ISRs to configure and to process. Why is it done this ineffcient way (2 ISR-Calls)?

Pavel A.
Evangelist III

@AZorn.1 Because the DMA TX complete interrupt occurs when the DMA moved the last byte to the UART. But then the UART becomes busy sending the byte, it takes time. The UART TX complete interrupt indicates final completion of TX. Indeed this is extra overhead, and in your application it may be redundant - like, you can start another DMA TX immediately after the DMA interrupt (UART TX data register already is good to write).