STM32F4 + UART + DMA + IDLE detection + High Rates + Variable Length Messages = CHAOS!
Hi!
I have an INS that sends the following frames:
- Frame 1 of 60 bytes every 40 ms
- Frame 2 of 70 bytes every 20 ms
- Frame 3 of 32 bytes every 1s
- Frame 4 (unwanted, but impossible to deactivate) of almost 500 bytes every 2s.
I am implementing receive with Normal DMA, 115200 baudrate and IDLE detection, but I have the following problems:
1) The frames I do want are smaller than 100 bytes, but if I declare the receive buffer that size, the reception stops.
2) For that reason I have declared the buffer with a size of 500.
3) As the buffer length is 500, when the callback (TC, I ignore HT) is executed, I observe the content and there are mixed frames. I would expect that whenever IDLE is detected it will hit the callback and write to buffer position 0, but I don't know what's going on.
4) I lose frame 3, which is the smallest and least frequent.
Any suggestion?
Thanks a lot!
