Hi,
we have sort of an odd problem. On some of our Q2698 we never get a GPS Position.
When i investigated the problem, i found that after
gps_init(GPS_HWTYPE_GPSONE, gps_ev_hldr, NULL) return GPS_OK
there are no callbacks coming back. Usually i see some timers calling repeatatly for GPS.
At first i figured there must be aproblem in flash memory so i deleted all flash objects.
But the problem persists even after erasing all object in flash an reflashing the Q2698 with the Firmware and Bootloader below.
I wonder if SiWi knows of this issue and can offer a workaround.
Bootloader: Version SWI6200T_02.02.04.07ABT R2881 CNSZXD00000132; Build Date 2013/12/20 10:43:54
Firmware: Version R7.52.0.A1.201401021703; Build Date 010214 17:03; Checksum 0xAE3E7F98
Here is my GPS Code:
void InitGPS()
{
gps_status_e ret = gps_init(GPS_HWTYPE_GPSONE, gps_ev_hldr, NULL);
trace_GPSError(ret);
}
void gps_ev_hldr(gps_event_e eEvent, void* pEventData)
{
gps_status_e ret;
switch(eEvent)
{
case GPS_INIT_EVENT:
TRACE((TL_GPS, "GPS_INIT_EVENT"));
ret = gps_start(GPS_HOT_START);
trace_GPSError(ret);
break;
case GPS_INIT_ERROR_EVENT:
TRACE((TL_GPS, "GPS_INIT_ERROR_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_START_EVENT:
TRACE((TL_GPS, "GPS_START_EVENT"));
ret = gps_nmeaSetOpts(GPS_OPT_NMEA_HANDLER, nmeaHdlr, GPS_OPT_NMEA_LIST, GPS_NMEA_RMC_EN, GPS_OPT_END);
trace_GPSError(ret);
break;
case GPS_START_ERROR_EVENT:
TRACE((TL_GPS, "GPS_START_ERROR_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_STOP_EVENT:
TRACE((TL_GPS, "GPS_STOP_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_STOP_ERROR_EVENT:
TRACE((TL_GPS, "GPS_STOP_ERROR_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_SLEEP_EVENT:
TRACE((TL_GPS, "GPS_SLEEP_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_SLEEP_ERROR_EVENT:
TRACE((TL_GPS, "GPS_SLEEP_ERROR_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_RELEASE_EVENT:
TRACE((TL_GPS, "GPS_RELEASE_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_RELEASE_ERROR_EVENT:
TRACE((TL_GPS, "GPS_RELEASE_ERROR_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_ERROR_EVENT:
TRACE((TL_GPS, "GPS_ERROR_EVENT"));
gps_valid_fix = FALSE;
break;
case GPS_ABORT_EVENT:
TRACE((TL_GPS, "GPS_ABORT_EVENT"));
gps_valid_fix = FALSE;
break;
}
}
void nmeaHdlr(u16 nmeaBufferSize, ascii* pNmea)
{
TRACE((TL_GPS, pNmea));
char* posNL = strchr(pNmea, '\r');
if (posNL != NULL)
{
*posNL = '\0';
}
strncpy(_Nmea, pNmea, sizeof(_Nmea));
if (strstr(pNmea, ",V,") == NULL)
{
gps_valid_fix = TRUE;
}
else
{
gps_valid_fix = FALSE;
}
}