2021-05-17 06:32 AM
Hello,
We are using an USART connection in DMA mode and get the same symptoms as in https://community.st.com/s/question/0D50X00009XkfArSAJ/dmausart-on-stm32f407vg-tc-interrupt-sometimes-not-triggered but the FIFO is disabled.
After a while and in conditions very hard to reproduce (seems random), we cannot use DMA transfer anymore as the BUSY flag on HUART is not reseted. However, DMA is in READY state. We have to manually detect when it's not reseted after a while and reset it manually, which is very dirty (and we don't know if it's the correct way to do it).
We use this DMA both for RX and TX, communicating with another device which runs one of our softwares.
It happens more frequently when we put more load on the CPU, even if completely unrelated to the communication tasks (which handles DMA in our application).
We've been tracking the interruptions with breakpoints everywhere but we couldn't figure out how it could miss to reset the flag upon completion of TX transfer.
Thanks for you help,
Thomas
2021-05-17 07:24 AM
To be more precise, we are stuck with these states:
handle.gState = HAL_UART_STATE_BUSY_TX
handle.RxState = HAL_UART_STATE_BUSY_RX
handle.hdmatx.State = HAL_DMA_STATE_READY
handle.hdmarx.State = HAL_DMA_STATE_BUSY
In our case, it is stuck because gState is BUSY, which forbids to send new data on DMA. However, DMA is in ready state for Tx.