Closed diggit closed 6 years ago
Hi, That would be a bit of a kludge. Maybe you could just preprocess the data slightly and insert NUL terminators where needed, like this?
char *line = buff;
while (*line) {
char *newline = strpbrk(line, "\r\n");
if (newline) { *newline = '\0'; }
minmea_parse(line);
if (newline)
line = newline+1;
else
break;
}
PS. Be aware that STM32F1 is known to generate EMI that disrupts GPS receiver operation. Here's an arcane thread on an arcane Polish forum:
https://www.elektroda.pl/rtvforum/topic1541960.html
I've verified it and indeed, just doing flash fetches on STM32F103 is enough to significantly interfere with GPS. You can test it yourself by running the following code on an MCU and bringing it close to any GPS antenna (including, for example, smartphone antenna):
while (1) {
asm("nop");
asm("nop");
asm("nop");
/* lots of repetitions, at least 16 of them */
asm("nop");
}
We had a product where the interference was in range of 10dB (a lot in GPS world). If possible, try to mitigate it by 1. moving idle loop to RAM, 2. moving MCU away from GPS antenna/receiver.
Tanks for suggestion about NUL teminators. That is probably cleaner way to go. I just wanted to minimize MCU usage. There are other things that need to be taken care of in time.
Current design is based on STM32F7. GNSS receiver is placed away from MCU and external active antenna is used so there should not be problem. Reception is stable and strong. Thanks for info, I'll keep it in mind for more minimalistic designs in future.
STM32F7 should fare much better; it's only F1 that causes trouble. Good luck with the project!
Hi, I am using your library on STM32 and Ublox Neo-M8P. All received messages are in one string. There are no NULL terminations. To make minmea work directly with such block, I had to do few changes in minmea.c.
Here is diff:
I had to:
I can make these changes configurable using preprocessor conditionals. Are you interested in merging such changes?
You saved me a lot of time, neat library!