2017-11-23 03:01 AM
Hello everyone, I am using STM32L072CZ board to get data from GPS on USART1 but when I try to store it onto a buffer, I am losing data bytes. I am putting a small code snippet here, not the final version but somewhere what I am trying to do
for(int i=0;i<500;i++)
{
buffer[i]=USART1->RDR;
}
for(int i=0;i<500;i++)
{
LPUART1->TDR=buffer[i];
}
I am losing most of my data during this process. Please help.
#stm32l0-stm32l0-discovery #gps #usart1-commun #serial-port #communicationSolved! Go to Solution.
2017-11-23 04:31 AM
You can't just jam data into the registers. You need to wait on TXE or RXNE bits to assert in SR or ISR register.
2017-11-23 04:31 AM
You can't just jam data into the registers. You need to wait on TXE or RXNE bits to assert in SR or ISR register.
2017-11-23 04:53 AM
And GPS (I assume NMEA0183) has strings of variable length, with defined start and end characters.
Not gonna be that simple.
2017-11-23 08:16 AM
for(int i=0; i<500; i++)
{
buffer[i] = USART1->RDR;
}�?�?�?�?
Think: