cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_UART_TxCpltCallback not getting called

ypiotrp
Senior

Hi,

I have a problem with HAL_UART_TxCpltCallback not getting called after UART transmission using DMA. I set the DMA in Normal mode. I also turned on the UART global interrupt in CubeMX. Actually the USART1_IRQHandler gets called after I send some string over UART. Stepping through the code shows that the HAL_UART_TxCpltCallback is not called because the USART_ISR_TC bit in UART->SR register is not set. I don't know why is that? Maybe I configured something wrong?

Thanks for your help 🙂

2 REPLIES 2

Which STM32?

You may want to start with polled USART implementation, and only after that works, proceed with DMA.

> because the USART_ISR_TC bit in UART->SR register is not set.

Do you see characters being transmitted at the Tx pin?

Read out and check/post the USART and DMA registers content.

JW

ypiotrp
Senior

Hi Jan, thanks for your answer!

I tried to run my UART driver on Nucleo-F429ZI (STM32F429ZI) and on DiscoveryF3. On both boards I get the same results.

I try to send a 5 char text once per second. The text only get send once and after that the Tx stays silent because the HAL_UART_Transmit_DMA exits with HAL_BUSY (becasue huart->gState is set to HAL_UART_STATE_READY).

I'm gonna send you the USART and DMA registers content first thing in the morning

Regards, Piotr