cancel
Showing results for 
Search instead for 
Did you mean: 

DMA and UART not triggering completion INT sometimes

mur
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

5 REPLIES 5

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

mur
Associate III

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?

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

mur
Associate III

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.

Thanks for coming back with the solution.

JW