Failed to configure GNSS

Hello,

I have a custom board with an nRF9160 and is running mfw_nrf9160_1.3.5.  The design is ready for production so I thought I will build 10 boards first as a pilot run.  Out of the 10 boards, one is giving me the following error.

W: nrf_modem_gnss_agps_expiry_get() failed, err -13
E: Failed to configure GNSS
I: Location retrieval failed using 'GNSS', trying with 'Cellular' next
%NCELLMEAS: 0,"08452E01","302610","D6DD",80,2325,135,40,15,606912,2325,481,34,2,0,900,310,44,16,24,5255,482,51,18,32

All 9 others work fine.  I tried re-flashing the board a few times, but no luck.  This same error keeps happening.  Does anyone have an idea what is wrong?

Thank you.

Parents
  • Hi Floyd

    I will start looking into your case. Our teams nRF91x is out of office due to training so it might be a bit slower response

    Regards

    RUnar

  • Thank you, Runar.  We built a number of prototype before these 10 units.  None of them have this problem either.  This is the first time we see error like this.  We definitely can't test every single unit during production to see if this happens.

  • Here is the prj.conf.

    # General config

    CONFIG_NCS_SAMPLES_DEFAULTS=y
    CONFIG_REBOOT=y
    CONFIG_FPU=y
    CONFIG_ASSERT=y
    CONFIG_STDOUT_CONSOLE=y
    CONFIG_I2C=y
    CONFIG_GPIO=y
    CONFIG_PWM=y
    CONFIG_MAIN_THREAD_PRIORITY=7
    #CONFIG_PWM_LOG_LEVEL_DBG=y
    CONFIG_ENTROPY_GENERATOR=y

    # Enable custom AT commands
    CONFIG_AT_CUSTOM_CMD=y

    # LSM6DSL
    CONFIG_SPI=y
    CONFIG_SENSOR=y

    # NEWLIB C
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048

    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_OFFLOAD=y

    # LTE link control
    CONFIG_MODEM_KEY_MGMT=y
    CONFIG_LTE_LINK_CONTROL=y
    #CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y

    CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS=y
    CONFIG_LTE_NETWORK_DEFAULT=y

    CONFIG_LTE_MODE_PREFERENCE_AUTO=y

    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    CONFIG_LTE_EDRX_REQ=y

    CONFIG_LTE_PSM_REQ_RAT="11100000"

    # Modem library
    CONFIG_NRF_MODEM_LIB=y

    # CONFIG for China Telecom
    CONFIG_ZZHC=y
    CONFIG_TRUSTED_EXECUTION_NONSECURE=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_NVS=y
    CONFIG_SETTINGS_NVS_SECTOR_COUNT=6
    CONFIG_ZZHC_STACK_SIZE=2048
    CONFIG_ZZHC_THREAD_PRIO=10

    # AT Host
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_AT_HOST_LIBRARY=y

    # AWS IoT library
    CONFIG_AWS_IOT=y
    CONFIG_AWS_IOT_CLIENT_ID_APP=y
    CONFIG_AWS_IOT_BROKER_HOST_NAME_APP=y

    CONFIG_AWS_IOT_SEC_TAG=13579
    CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=5
    CONFIG_AWS_IOT_CLIENT_ID_MAX_LEN=40
    CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
    CONFIG_AWS_IOT_LAST_WILL=y
    CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=y
    CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
    CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=n
    CONFIG_AWS_IOT_PROVISION_CERTIFICATES=y

    CONFIG_MQTT_KEEPALIVE=1200
    CONFIG_MQTT_CLEAN_SESSION=y

    # Date Time library
    CONFIG_DATE_TIME=y

    # Heap and stacks
    CONFIG_MAIN_STACK_SIZE=8192
    # Extended memory heap size needed for encoding REST messages to JSON
    CONFIG_HEAP_MEM_POOL_SIZE=49152
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
    # Increase AT monitor heap because %NCELLMEAS notifications can be large
    CONFIG_AT_MONITOR_HEAP_SIZE=2048

    # MCUBOOT
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_IMG_MANAGER=y

    # DFU Target
    CONFIG_DFU_TARGET=y

    # Image manager
    CONFIG_FLASH=y
    CONFIG_IMG_MANAGER=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y

    # AWS FOTA
    CONFIG_AWS_FOTA=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
    CONFIG_DFU_TARGET=y

    # CJSON
    CONFIG_CJSON_LIB=y

    # Download client (needed by AWS FOTA)
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL_INF=y
    CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300

    # Location library
    CONFIG_LOCATION=y

    # Logging
    #CONFIG_LOG=y
    #CONFIG_LOG_PRINTK=y
    CONFIG_LOG_MODE_IMMEDIATE=n

    # nRF Cloud (for A-GPS and cell location)
    CONFIG_NRF_CLOUD_REST=y
    CONFIG_NRF_CLOUD_AGPS=y
    CONFIG_MODEM_INFO=y
    CONFIG_MODEM_INFO_ADD_NETWORK=y

    # Modem JWT
    CONFIG_MODEM_JWT=y

    # Multicell location service selection
    CONFIG_MULTICELL_LOCATION_SERVICE_NRF_CLOUD=y

    CONFIG_MODEM_ANTENNA_GNSS_ONBOARD=y
    CONFIG_MODEM_ANTENNA_GNSS_EXTERNAL=n
    #CONFIG_MODEM_ANTENNA_AT_MAGPIO="AT%XMAGPIO=1,0,0,3,1,1565,1586,0,1710,2200,0,698,746"
    CONFIG_MODEM_ANTENNA_AT_COEX0="AT%XCOEX0=1,1,1565,1586"
    CONFIG_TFM_KEY_FILE_S="C:/ncs/v2.3.0/modules/tee/tf-m/trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072.pem"
    CONFIG_TFM_KEY_FILE_NS="C:/ncs/v2.3.0/modules/tee/tf-m/trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072_1.pem"
    CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="abc-"

  • Now confirmed 2 out of the 10 pre-production boards are showing the same nrf_modem_gnss_agps_expiry_get() failure issue.  The second one was running fine for days before.  Can you tell me exactly what causes the function to fail?  Where can I find this function?  

  • Hi,

    Return value -13 from nrf_modem_gnss_agps_expiry_get() is -NRF_EACCES which according to nrf_modem_gnss.h means "GNSS is not enabled in system or functional mode".

    It looks like you might be having problems due to misconfiguration. In your project configuration, you have selected both CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS=y and
    CONFIG_LTE_NETWORK_DEFAULT=y but these options are mutually exclusive. Only one of them should be selected. Based on the device's behavior the latter one (CONFIG_LTE_NETWORK_DEFAULT=y) gets applied and the system mode stored in modem's NVM is used. You could try to remove CONFIG_LTE_NETWORK_DEFAULT=y from your project configuration so that you only have CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS=y which is probably the option which you want to use.

    Best regards,
    Dejan

  • What I found out last night was that the 2 failed boards have %xsystemmode=1,0,0,0, whereas all good working boards have %xsystemmode=1,1,1,0.  I then manually entered at%xsystemmode=1,1,1,0 on the 2 failed boards and then they both worked now.  My question is why is this happening when all boards are running the same code and same modem firmware?  Do I have to set xsystemmode=1,1,1,0 manually at the beginning of the code? 

  • Hi,

    flau said:
    What I found out last night was that the 2 failed boards have %xsystemmode=1,0,0,0, whereas all good working boards have %xsystemmode=1,1,1,0.
    flau said:
    My question is why is this happening when all boards are running the same code and same modem firmware?  Do I have to set xsystemmode=1,1,1,0 manually at the beginning of the code? 

    Looking at %XSYSTEMMODE set command, it might be that the operator has overridden values which are configured. %xsystemmode command is allowed only before activating the modem using the +CFUN=1 command. If the mode needs to be changed, ensure that modem has entered minimum functionality mode +CFUN=0 or flight mode CFUN=4 before doing the change.

    Best regards,
    Dejan

Reply
  • Hi,

    flau said:
    What I found out last night was that the 2 failed boards have %xsystemmode=1,0,0,0, whereas all good working boards have %xsystemmode=1,1,1,0.
    flau said:
    My question is why is this happening when all boards are running the same code and same modem firmware?  Do I have to set xsystemmode=1,1,1,0 manually at the beginning of the code? 

    Looking at %XSYSTEMMODE set command, it might be that the operator has overridden values which are configured. %xsystemmode command is allowed only before activating the modem using the +CFUN=1 command. If the mode needs to be changed, ensure that modem has entered minimum functionality mode +CFUN=0 or flight mode CFUN=4 before doing the change.

    Best regards,
    Dejan

Children
Related