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

nRF9160 : A-GPS SUPL error: 3

Hello,

We are using A-GPS in our application to get faster TTFF and will be reading location coordinates after every 5 mins of duration. The application flow looks like:- Connect to LTE network through LwM2M carrier lib ------ Enable PSM mode, Activate GPS, get Long & Lat coordinates, Stop GPS, Disable PSM mode ------ Disconnect LTE modem. (Repeat same steps after 5 mins.). 

Randomly, after 1 or 2 hours of long run nRF9160 will stuck at below mentioned logs: 

GPS_EVT_AGPS_DATA_NEEDED 
[03:14:49.960,083] <dbg> nrf9160_gps.gps_priority_set: GPS priority disabled
[03:14:49.960,296] <dbg> nrf9160_gps.start: GPS operational
[03:14:49.960,388] <dbg> nrf9160_gps.gps_thread: A-GPS data update needed

But this time we could see our test is end up with SUPL error: 3

GPS_EVT_AGPS_DATA_NEEDED 
[03:14:49.960,083] <dbg> nrf9160_gps.gps_priority_set: GPS priority disabled
[03:14:49.960,296] <dbg> nrf9160_gps.start: GPS operational
[03:14:49.960,388] <dbg> nrf9160_gps.gps_thread: A-GPS data update needed
[03:14:50.222,503] <dbg> agps.open_supl_socket: ip 172.217.215.192 (c0d7d9ac) port 7276
[03:14:50.359,649] <inf> agps: Starting SUPL session
[03:14:50.361,694] <dbg> agps.supl_logger: ULP encoding length: 39
[03:14:50.362,243] <dbg> agps.supl_logger: Bytes sent: 39
[03:14:50.534,912] <dbg> agps.supl_logger: Bytes received: 34, total 34
[03:14:50.535,491] <dbg> agps.supl_logger: <log_strdup alloc failed>
[03:14:50.535,583] <dbg> agps.supl_logger: <log_strdup alloc failed>
[03:14:50.535,644] <dbg> agps.supl_logger: <log_strdup alloc failed>
[03:14:50.535,827] <dbg> agps.supl_logger: <log_strdup alloc failed>
[03:14:50.536,499] <dbg> agps.supl_logger: <log_strdup alloc failed>
[03:14:50.827,117] <dbg> agps.supl_logger: Bytes received: 708, total 708
[03:14:50.827,697] <dbg> agps.supl_logger: ULP ossDecode more input 4
[03:14:51.827,758] <dbg> agps.supl_logger: read again
[03:14:52.827,911] <dbg> agps.supl_logger: read again
[03:14:53.828,094] <dbg> agps.supl_logger: read again
[03:14:54.828,247] <dbg> agps.supl_logger: read again
[03:14:55.828,430] <dbg> agps.supl_logger: read again
[03:14:56.828,582] <dbg> agps.supl_logger: read again
[03:14:57.828,765] <dbg> agps.supl_logger: read again
[03:14:58.828,918] <dbg> agps.supl_logger: read again
[03:14:59.829,101] <dbg> agps.supl_logger: read again
[03:15:00.829,254] <dbg> agps.supl_logger: read again
[03:15:01.829,437] <dbg> agps.supl_logger: Timeout expired
[03:15:01.829,498] <dbg> agps.supl_logger: SUPL error: 3
[03:15:01.829,650] <dbg> agps.supl_logger: ULP encoding length: 34

GPS Config in application: 

static void hubo_gps_start_work_fn(struct k_work *work) {
    int err;
    /* GPS search configuration. */
    struct gps_config gps_cfg = {
        .nav_mode   = GPS_NAV_MODE_SINGLE_FIX,
        .power_mode = GPS_POWER_MODE_DISABLED,
        .timeout    = GPS_READ_TIMEOUT_MS,
        .priority   = false,
    };

    ARG_UNUSED(work);
    /* Start the GPS operation. */
    err = gps_start(gps_dev, &gps_cfg);
    if (err) {
        GPS_DEBUG_PRINTK("Failed to start GPS, error: %d \n", err);
        return;
    }
}

prj.conf file:

CONFIG_FPU=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_AT_CMD=y

# DK
CONFIG_DK_LIBRARY=y

CONFIG_LWM2M_CARRIER=y
CONFIG_NRF_MODEM_LIB_SYS_INIT=n
CONFIG_AT_CMD_THREAD_STACK_SIZE=1536

# PDN library
CONFIG_PDN=y
CONFIG_PDN_CONTEXTS_MAX=3

# Disable NB-IoT fallback
CONFIG_LTE_NETWORK_USE_FALLBACK=n

# SMS library
CONFIG_SMS=y

# LwM2M carrier is only compiled for hard-float
CONFIG_FPU=y
CONFIG_FP_HARDABI=y

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_PSM_REQ_RPTAU="00011111"
CONFIG_LTE_PSM_REQ_RAT="00000010"

# Modem library
CONFIG_NRF_MODEM_LIB=y

# FOTA library
CONFIG_FOTA_DOWNLOAD=y
CONFIG_REBOOT=y

# Download client
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096

# DFU Target
CONFIG_DFU_TARGET=y

# Application Upgrade support
CONFIG_BOOTLOADER_MCUBOOT=y

# Image manager
CONFIG_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Day-Time library
CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=3600

# AT Host
CONFIG_AT_CMD_PARSER=y
CONFIG_AT_HOST_LIBRARY=y

# Serial port
CONFIG_SERIAL=y
CONFIG_UART_NRFX=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Have kernel output
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_0"

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=y
CONFIG_MQTT_CLEAN_SESSION=y
CONFIG_MODEM_KEY_MGMT=y

# Memory
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096


#GPIO required for GPS Amplifier enable/disable
CONFIG_GPIO=y

#Threads
CONFIG_MULTITHREADING=y
CONFIG_MAIN_THREAD_PRIORITY=7

#Disable UART
CONFIG_BOOT_BANNER=y
CONFIG_PRINTK=y
CONFIG_LOG=y

# Storage
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_NVS=y
CONFIG_NVS_LOG_LEVEL_DBG=y
CONFIG_REBOOT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# GPS
CONFIG_NRF9160_GPS=y
CONFIG_NRF9160_GPS_LOG_LEVEL_DBG=y

# AGPS
CONFIG_AGPS=y
# CONFIG_AGPS_SRC_SUPL=y
CONFIG_AGPS_LOG_LEVEL_DBG=y
CONFIG_NRF9160_GPS_THREAD_STACK_SIZE=4608

# Compiler
CONFIG_NEWLIB_LIBC=y

Can you please support me to solve this issues asap and explain us why and what exactly is happening when we are performing long running test ? 

NCS version : 1.6.0

SUPL Lib Version: nrf9160_libsupl-v0.7.1

Modem Firmware version: 1.3.0

Device Revision : NRF9160_xxAA_REV2

Board Version : PCA10090

Thank You !

Regards,

Chetan

  • Hi,

     

    It is unfortunately common to get this read error if the gps is running while fetching AGPS data. Could you try to call "gps_stop" before fetching the AGPS data, and start the GPS when its done?

     

    If this does not help the scenario, could you take a modem trace showing the issue?

     

    Kind regards,

    Håkon

Related