cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_UART_Transmit_DMA, transfer complete without to use the Transfer completed callback

Hi, after having used HAL_UART_Transmit_DMA is there a way to know if all data were been sent by polling something, in order to not use the callback?

3 REPLIES 3
Simon.T
ST Employee

Hello @Denis Gottardello​ ,

When you said you don't want to use the callback. You mean you don't want to use an interrupt to know if the DMA has sent all the data ?

Hi, I don't want to use the callback. I just want to check a uart state or value, if there is one, to know how much bytes have to been send and if the buffer is completely sent.

The HAL_IRQ_handler is customer oriented but is not mandatory to use it.

That's mean the way to not use the callback function is to rewrite the ISR (Read and clear register bit) like in the USART_Communication_TxRx_DMA LL example.

Nevertheless, if you want to poll something, the DMA is not the best option. The goal of the DMA is to be used as not blocking mode and checking the transfer or status through an ISR.