2020-04-13 08:20 AM
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.
Solved! Go to Solution.
2020-04-13 02:26 PM
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
2020-04-13 09:58 AM
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
2020-04-13 12:47 PM
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?
2020-04-13 02:26 PM
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
2020-04-14 07:57 AM
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.
2020-04-14 12:11 PM
Thanks for coming back with the solution.
JW