Skip to main content
Explorer II
April 13, 2021
Question

HAL_UART_TxCpltCallback not getting called

  • April 13, 2021
  • 2 replies
  • 833 views

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 :)

    This topic has been closed for replies.

    2 replies

    Super User
    April 13, 2021

    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

    ypiotrpAuthor
    Explorer II
    April 13, 2021

    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