Home
Name Modified Size InfoDownloads / Week
user_nmealib 2018-04-20
readME.c 2018-04-20 2.3 kB
readME.txt 2018-04-20 2.3 kB
test.c 2018-04-20 1.9 kB
Totals: 4 Items   6.5 kB 0
DESCRIPTTION:
this project is based on NMEA library form:
http://nmea.sourceforge.net/
,and is suitable for STM32 applications(maybe other MCUs,but I haven't tested yet).I deleted unnecessary files and moved all the sources and header files in 'inc' and 'src' folder,all you need to do to include this library is copy the user_nmealib folder to your STM32 project root folder,add the whole folder to your KEIL project,then add   ..\user_nmealib\inc in the include path,and add #include "../user_nmealib/inc/nmea.h" in your main.c file.

HOW TO USE THIS LIBRARY:
you can download the original library:http://nmea.sourceforge.net/
,and check how the parsing process is inited,called,and how the infomation is stored in the main.c file in nmealib->samples->parse folder,and there's even a GPS data sample,you can use it to test your program.
if you're using usart IDLE interrupt in your program,the data you received is not separated into rows with a '$'at the beginning of each row,which means the parser could not recognize the sentences.so,you should manually separate the sentences with '\n'.you can find this process in test.c

the original library is pretty good,and can parse 5 different NMEA sentences,much better than the library I previously used,and what's more,it's versatile!I rearranged the folders and files,and did some modifications.BUT!there seems to be a bug in the original library,as long as the GPS module is FIXED,everything works fine,but when my NEO-6M module is not FIXED,like,when I put my whole set indoors,the sentences send back to UART omit '0' between commas,and here the wierd thing comes,the memory usage increases continuously,and fills the whole HEAP,then my program crashed.the parse function uses malloc() and free() pairs to get memory spaces,but when error occured in parsing process,like incorrect data format or missing data in the sentence to be parsed,it didn't free some of the allocated pointers!and everything looks fine when you're parsing correct sentences!so I added NMEA_free(node->pack);in the 'else' process,you can find them in parser.c with comment://modified.

I only used and modified the parsing function in the library,and there're a lot more to be explored,maybe you would like a try,have fun!

Source: readME.c, updated 2018-04-20