I'm trying to read data from a GPS module that send packets with different lengths. I connected the rx line to another pin and enabled an interrupt on it, in this way I can "timeout" the end of packet (packets are one per second, plenty of time between a pair).
I set-up DMA on UART (tried both circular and normal) because I don't need UART interrupt to read data. I would like to read data on timeout, but after the read I need to reset the state of DMA in order to empty the buffer and restart writing from index 0. I need to know the dat tranfered too.
I'm using an STM32F101 device with HAL library version 1.4.0.
No luck with examples from ST nor documentation around internet.
Thanks for your help.