This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GNSS Restart After Single Shot

I am using the GNSS Sample in SDK 1.8.99 to test sleep/wake cycles.

The GNSS example is correctly operating in single shot mode by setting the interval to 0.  After getting a single fix, execution ceases and current draw drops.

I created a kernel timer based on https://devzone.nordicsemi.com/f/nordic-q-a/59164/internal-rtc-example with the objective of waking the 9160 from idle,  Within my timer function I stop and start the gnss based on the guidance from here, https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_modem/doc/gnss_interface.html#gnss-interface

I have these lines in my timer function,  

printk("Timer function execution\n");

if (nrf_modem_gnss_stop() != 0) {
LOG_ERR("Failed to stop GNSS in timed reset");
return -1;
}

if (nrf_modem_gnss_start() != 0) {
LOG_ERR("Failed to start GNSS in timed reset");
return -1;
}

However, the gnss is not restarting/reacquiring a fix even though the print statement from my timer is printed to the serial and no error messages are printed either.  I can tell gnss is off both from the current draw not increasing an no updated NMEA/fix info on the terminal. 

What other steps are required to restart the gnss?  Would I have a different result if I put the system to sleep directly with __WFI() vs using the built in sleep from the GNSS lib?

Thanks!

  • Hello David,

    What other steps are required to restart the gnss?  Would I have a different result if I put the system to sleep directly with __WFI() vs using the built in sleep from the GNSS lib?

    I’m honestly not quite sure why you are not able to restart the GNSS, but I wonder if this could have something to do with stopping/starting the GNSS in a kernel timer expiry function.

    Does it make any difference if you offload the calls of the GNSS functions to a system workqueue handler instead, as illustrated here?

    Another alternative might be to just add the restart of the GNSS in the polling event for new available PVT data.

    Regards,

    Markus

Related