A-GPS almanac request

What are the conditions under which the `sv_mask_alm` field in `struct nrf_modem_gnss_agps_data_frame` will stop being 0xFFFFFFFF?

I am providing almanac data for SV's 2-32 (generated from nRF Cloud today) by writing with `NRF_MODEM_GNSS_AGPS_ALMANAC`.

The modem is continuously getting a good location fix (<5 meters) within 10 seconds after restarting, implying that it has a good idea of current time, almanacs and ephemeris.

However each time the modem restarts, the `sv_mask_alm` field is still set to 0xFFFFFFFF.

Printing out the almanac expiry times for each SV from `nrf_modem_gnss_agps_expiry_get` confirms that the modem thinks the almanac data is valid for the next 2 weeks.

[00:16:49.185,699] <inf> act_gnss: Fix started
[00:16:49.185,699] <inf> act_gnss: Providing almanac assistance ffffffff
[00:16:49.265,625] <inf> act_gnss: Providing time assistance (1376279646)
[00:16:49.266,143] <inf> act_gnss: Providing location assistance (APP)
[00:16:49.269,561] <wrn> act_gnss: EXP: 00000023 7200 0
[00:16:49.269,561] <wrn> act_gnss: A EXP: 144162 1353761 1353761 1353761
[00:16:49.269,592] <wrn> act_gnss: A EXP: 1353761 1353761 1353761 1353761
[00:16:49.269,592] <wrn> act_gnss: A EXP: 1353761 1353761 1353761 1353761
[00:16:49.269,622] <wrn> act_gnss: A EXP: 1353761 1353761 1353761 1353761
[00:16:49.269,622] <wrn> act_gnss: A EXP: 1353761 1353761 1353761 1353761
[00:16:49.269,622] <wrn> act_gnss: A EXP: 1353761 1353761 1353761 1353761
[00:16:49.269,653] <wrn> act_gnss: A EXP: 1353761 1353761 1353761 1353761
[00:16:49.269,653] <wrn> act_gnss: A EXP: 1353761 1353761 1353761 1353761

After a large number of runs, eventually the bits will be cleared to 0, but there is no reasoning that I can detect as to why this occurs.

I am looking to get a better understanding of these flags, in case there are further improvements I can make to my assistance data.

Parents
  • The high level code operation doing this work looks like this:

    static void agps_provide(void)
    {
    	struct nrf_modem_gnss_agps_data_frame agps_frame;
    	struct nrf_modem_gnss_agps_data_location location;
    	int rc;
    
    	/* Query any required GNSS assistance */
    	rc = nrf_modem_gnss_read(&agps_frame, sizeof(agps_frame), NRF_MODEM_GNSS_DATA_AGPS_REQ);
    	if (rc < 0) {
    		LOG_ERR("Failed to read AGPS request (%d)", rc);
    		return;
    	}
    
    	if (agps_frame.sv_mask_alm) {
    		/* Write data to NRF_MODEM_GNSS_AGPS_ALMANAC */
    		almanac_assistance(agps_frame.sv_mask_alm);
    	}
    	if (agps_frame.data_flags & NRF_MODEM_GNSS_AGPS_SYS_TIME_AND_SV_TOW_REQUEST) {
    		/* Write data to NRF_MODEM_GNSS_AGPS_GPS_SYSTEM_CLOCK_AND_TOWS */
    		time_assistance();
    	}
    	if (agps_frame.data_flags & NRF_MODEM_GNSS_AGPS_POSITION_REQUEST) {
    		if ((location_assistance_mcc(&location) == 0)) {
    			/* Write data to NRF_MODEM_GNSS_AGPS_LOCATION */
    			location_assistance_provide(&location);
    		}
    	}
    }
    
    static void run_fix(void)
    {
    	nrf_modem_gnss_start();
    	agps_provide();
    	while(running_fix) ;
    	nrf_modem_gnss_stop();
    }

Reply
  • The high level code operation doing this work looks like this:

    static void agps_provide(void)
    {
    	struct nrf_modem_gnss_agps_data_frame agps_frame;
    	struct nrf_modem_gnss_agps_data_location location;
    	int rc;
    
    	/* Query any required GNSS assistance */
    	rc = nrf_modem_gnss_read(&agps_frame, sizeof(agps_frame), NRF_MODEM_GNSS_DATA_AGPS_REQ);
    	if (rc < 0) {
    		LOG_ERR("Failed to read AGPS request (%d)", rc);
    		return;
    	}
    
    	if (agps_frame.sv_mask_alm) {
    		/* Write data to NRF_MODEM_GNSS_AGPS_ALMANAC */
    		almanac_assistance(agps_frame.sv_mask_alm);
    	}
    	if (agps_frame.data_flags & NRF_MODEM_GNSS_AGPS_SYS_TIME_AND_SV_TOW_REQUEST) {
    		/* Write data to NRF_MODEM_GNSS_AGPS_GPS_SYSTEM_CLOCK_AND_TOWS */
    		time_assistance();
    	}
    	if (agps_frame.data_flags & NRF_MODEM_GNSS_AGPS_POSITION_REQUEST) {
    		if ((location_assistance_mcc(&location) == 0)) {
    			/* Write data to NRF_MODEM_GNSS_AGPS_LOCATION */
    			location_assistance_provide(&location);
    		}
    	}
    }
    
    static void run_fix(void)
    {
    	nrf_modem_gnss_start();
    	agps_provide();
    	while(running_fix) ;
    	nrf_modem_gnss_stop();
    }

Children
No Data
Related