Skip to main content
Denis Gottardello
Associate III
Sep 16, 2022 7:30 AM UTC
Question

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?

This topic has been closed for replies.

3 replies

Simon.T
ST Employee
Sep 16, 2022 9:07 AM UTC

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 ?

Simon.T
ST Employee
Sep 16, 2022 9:58 AM UTC

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.

Denis Gottardello
Associate III
Sep 16, 2022 9:14 AM UTC

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.