STM32H7 UART DMA recieve issue
Hello,
I have been trying to establish the UART communication using DMA. To implement that I referred to https://community.st.com/t5/stm32-mcus-products/stm32h7-uart-dma-receive-unknown-length-of-data/m-p/86869#M11292 post. I am trying to implement DMA using ReceivetoIdle method.
The problem I am facing is that for first communication the DMA buffer is correctly reading the data, but for the consecutive communications the DMA data read are incorrect. It seems that the data is not getting flushed. I will explain this with the below example.
1. Let's say my first transaction is "HelloWorld". The buffer correctly reads this data.
2. Now if I send "HelloWhirpool", the buffer read is "HelloWhrld". And this issue continues.
I tried resetting the DMA buffer but it won't help. I even checked the MPU configuration and address. When I checked the DMA read buffer size in the callback function void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size), the size is read correctly as expected. I am using X-CTU terminal for testing the uart interface.
Also I tried using ReceivetoIdle for IT method, and this method was working fine.
Could you please tell exactly where I could have gone wrong. Why the DMA buffer is not correctly reading the Data correctly.
-Regards
