I did the Nordic Academy networking/GNSS online course and had no problems getting GNSS to work on the 9160DK. I'm now trying to get GNSS working on our custom board. The lte_lc_func_mode_set(LTE_LC_FUNC_MODE_ACTIVATE_GNSS) fails with return code -14, but of course lte_lc_func_mode_set() hides the actual error as returned by nrf_modem_at_printf(), but using the VSCode and GDB, I could see the error was 65536.
At this point we don't need any cellular functionality so I haven't enabled any of that in my defconfig or prj.conf. I've attached these files. I don't know if there's a CONFIG option required for GNSS I'm missing perhaps? I also admit I don't fully understand the subtleties of secure/non-secure stuff so I don't know whether the sample projects (and or devkit device tree files) have some setup/init stuff that allows GNSS to work.
My call to nrf_modem_lib_init() succeeds. lte_lc_connect() fails, followed by lte_lc_func_mode_set(LTE_LC_FUNC_MODE_ACTIVATE_GNSS) failing. I then tried lte_lc_system_mode_set(LTE_LC_SYSTEM_MODE_GPS, LTE_LC_SYSTEM_MODE_PREFER_AUTO), and while the call didn't fail, it didn't succeed because upon calling lte_lc_system_mode_get(&mode, &preference), mode was set to LTE_LC_SYSTEM_MODE_LTEM.
Here's prj.conf
CONFIG_EVENTS=y CONFIG_GPIO=y CONFIG_SERIAL=y CONFIG_UART_ASYNC_API=y CONFIG_CBPRINTF_FP_SUPPORT=y CONFIG_TMP116=y CONFIG_I2C_NRFX=y CONFIG_LIS2DH=y CONFIG_LIS2DH_MEASURE_TEMPERATURE=y CONFIG_SPI=y CONFIG_ADC=y #CONFIG_ST25DV=y CONFIG_PM_DEVICE=y #CONFIG_UART_0_ASYNC=y #CONFIG_UART_1_ASYNC=y #CONFIG_UART_3_ASYNC=n #CONFIG_FLASH=y #CONFIG_MPU_ALLOW_FLASH_WRITE=y CONFIG_TEST_RANDOM_GENERATOR=y #CONFIG_LOG=y #Modem lib not needed, but apparently not having it causes higher current?? CONFIG_NRF_MODEM_LIB=y CONFIG_LTE_LINK_CONTROL=y #CONFIG_LTE_NETWORK_MODE_NBIOT=y
Here's defconfig
# Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 CONFIG_SOC_SERIES_NRF91X=y CONFIG_SOC_NRF9160_SICA=y CONFIG_BOARD_AETHERISREMOTE=y # Enable MPU CONFIG_ARM_MPU=y # Enable hardware stack protection CONFIG_HW_STACK_PROTECTION=y # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y # Enable uart driver CONFIG_SERIAL=y # enable console CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_BUILD_WITH_TFM=y CONFIG_TRUSTED_EXECUTION_NONSECURE=y CONFIG_TFM_LOG_LEVEL_SILENCE=y #CONFIG_W1=y CONFIG_I2C=y CONFIG_I2C_NRFX=y CONFIG_SENSOR=y CONFIG_PINCTRL=y CONFIG_GPIO=y
Thank you in advance for any suggestions to get GNSS going.