NeoGPS Library Compatibility
Posted: Tue Jul 07, 2020 12:44 pm
Hi everyone,
I'm using an STM32F103C series board and have been trying and failing to get the NeoGPS library to work on it. I've got it working on an Arduino Nano, and so far I've never had an issue running Arduino Nano code on my STM32, but this one doesn't seem to like it.
This code is from the example folder NMEAloc.ino and I've stripped it back a bit. Like I said this works fine on the Nano but nothing comes through on the STM32. I know the GPS is working because when I reset the STM32, I get 1 packet of GPS data through the Serial monitor before the code has full booted up. Then the initialising statement is printed then nothing else. I tried moving the GPS to Serial2 with no luck.
If anyone had any ideas I could try or places to look that would be really useful!
Many thanks.
I'm using an STM32F103C series board and have been trying and failing to get the NeoGPS library to work on it. I've got it working on an Arduino Nano, and so far I've never had an issue running Arduino Nano code on my STM32, but this one doesn't seem to like it.
Code: Select all
// Description: This program only parses an RMC sentence for the lat/lon.
// When uploading remove Tx line of GPS from Rx of Nano,
// Can print Lat & Long to screen in 1.4mS
#include <NMEAGPS.h>
#define gpsPort Serial
#define GPS_PORT_NAME "Serial"
#define DEBUG_PORT Serial
int32_t Lat, Long;
static NMEAGPS gps; // This parses the GPS characters
void setup()
{
DEBUG_PORT.begin(38400);
while (!DEBUG_PORT);
DEBUG_PORT.println( F("Looking for GPS device on " GPS_PORT_NAME) );
DEBUG_PORT.flush();
gpsPort.begin(38400);
}
void loop(){
//
while (gps.available(gpsPort)) {
gps_fix fix = gps.read();
if (fix.valid.location) {
DEBUG_PORT.print(fix.latitudeL());
DEBUG_PORT.print(", ");
DEBUG_PORT.println(fix.longitudeL());
//DEBUG_PORT.print( fix.speed_mph(), 2 );
}
}
}
If anyone had any ideas I could try or places to look that would be really useful!
Many thanks.