How to clear UART's RX_buffer in stm32f030cct6
Hello Forum,
I am using stm32f030cct6 and Quectel L86 GPS module for my application.
I am doing coding on STMCubeIDE, using HAL libraries.
The GPS module is in continuously receiving data mode.
I am receiving that data on uart in a buffer.
Max size of buffer i kept is 1500, which is sufficient.
My main question is that while receiving the data i need to clear the previously stored data from buffer.
For a while it receives variation in data but after some time it keep same data till reset of MCU.
I want to clear the previous data as it receives fresh data each second.
Can anyone tell me how to do that?
This is the data that received on UART
$PMTK011,MTKGPS*08
$PMTK010,001*2E
$PMTK011,MTKGPS*08
$PMTK010,002*2D
$GPRMC,064512.498,V,,,,,0.00,0.00,270121,,,N*4B
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
$GPGGA,064512.498,,,,,0,0,,,M,,M,,*49
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79
$GLGSV,1,1,00*65
$GPGLL,,,,,064512.498,V,N*7B
$GPTXT,01,01,02,ANTSTATUS=OPEN*2B
$GPRMC,064513.498,V,,,,,0.00,0.00,270121,,,N*4A
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
$GPGGA,064513.498,,,,,0,0,,,M,,M,,*48
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79
$GLGSV,1,1,00*65
$GPGLL,,,,,064513.498,V,N*7A
$GPTXT,01,01,02,ANTSTATUS=OPEN*2B