2019-10-02 10:08 PM
UART DMA receive unknown length of data (maximum data length 64 bytes) but in every message terminate with 3.5 char times silent interval ( MODBUS RTU FRAMING) so to detect silent interval i'm using IDLE interrupt occur before new message start.
When IDLE interrupt occur i want reset DMA receive data buffer and want new data start at buffer[0] location ( NOT OVER WRITE OF DATA LIKE CIRCULAR BUFFER) how can i do this?
or any other way to detect MODBUS RTU frame end (silent char interval).
2019-10-02 11:49 PM
Move the received data in the idle timeout interrupt handler, and reset the rx index pointer.
You will need to have reception handling independant of (modbus command) evaluation.
>... but in every message terminate with 3.5 char times silent interval ( MODBUS RTU FRAMING) ...
At least in theory.
The realityis that existing devices on the market do not always conform well to the 0,5/3,3 character time rule.
2019-10-03 06:04 AM
You'd presumably have to reconfigure the DMA, ie suspend and change pointers/counts, or just reinitialize the DMA.