Skip to main content
Visitor II
April 13, 2020
Solved

DMA and UART not triggering completion INT sometimes

  • April 13, 2020
  • 5 replies
  • 1664 views

Hi,

I'm using serial communication with DMA and sometimes the transmission complete interrupt is not triggered (HAL_UART_TxCpltCallback) the issue happens every few minutes, or every several hundred transmissions.

I saw https://community.st.com/s/question/0D50X00009XkfArSAJ/dmausart-on-stm32f407vg-tc-interrupt-sometimes-not-triggered and I think it may be related: I am putting variable length messages into the DMA and I wonder whether there's constraints in the length that can be set.

I have tested for some time now triying to find a pattern and in all cases the data packet length was pretty small, whenever the DMA stopped triggering the interrupt, the lengths were 17, 11, 5, 5, 3, 5 (6 different tests).

So the questoin is, is there any limitation in the data length to set into the DMA?

For sending, I'm using HAL's HAL_UART_Transmit_DMA()

Best regards.

    This topic has been closed for replies.
    Best answer by waclawek.jan

    The 'F3's DMA does not have FIFO.

    There's no particular length limitation for USART/DMA. I believe it's coincidental that you see problems with odd lengths.

    JW

    5 replies

    Super User
    April 13, 2020

    The issue in the linked thread is related to FIFO. Do you use FIFO in DMA? Read out and post the DMA registers' content in case of problematic length.

    JW

    murAuthor
    Visitor II
    April 13, 2020

    I don't know, I'm using the automatic configuration from stm32cubeIDE. I know I'm using the DMA in Normal mode with an increment size of a byte.

    I tried browsing for FIFO in the reference manual of my device (stm32f334r8, RM0364) and FIFO was only mentioned along DMA in the SPI section. Is it the same FIFO?

    Super User
    April 13, 2020

    The 'F3's DMA does not have FIFO.

    There's no particular length limitation for USART/DMA. I believe it's coincidental that you see problems with odd lengths.

    JW

    murAuthor
    Visitor II
    April 14, 2020

    Indeed, the interrupt was not triggered because the transfer was not started. The source was a race condition in my code. Thanks for your time.

    BR.

    Super User
    April 14, 2020

    Thanks for coming back with the solution.

    JW