Dear Nordic Support Team,
After I updated the nRF Connect SDK (1.5.1 to 1.6.1) and the Modem firmware (1.2.3 to 1.3.0) on my nrf9160 DK device (v1.0.0, SiP revision 2), the date time isn't synchronized anymore. The date time library only issues the DATE_TIME_NOT_OPTAINED event. This issue might be related to this ticket.
I followed these instructions to update the modem firmware.
Here are the crucial code snippets I use:
// Modem initialization int lmModem_initialize(const LmModemConfiguration config) { int error; error = lte_lc_init(); if (error) goto onError; error = lte_lc_psm_req(config.requestPsm); if (error) goto onError; error = lte_lc_connect(); if (error) goto onError; k_sleep(K_SECONDS(5)); return LMMODULSUCCESS; onError: return LMMODULERROR; } int lmModem_initializeDefault(void) { LmModemConfiguration config; lmModem_getDefaultConfig(&config); return lmModem_initialize(config); } void lmModem_getDefaultConfig(LmModemConfiguration* config) { config->requestPsm = true; } // Date time initialization // Please note that the semaphore is "given" by the eventHandler if date time is obtained int lmDateTime_initialize(void) { int error = LMMODULESUCCESS; // Synchronize time independed of usual update interval error = date_time_update_async(eventHandler); if (error) { printk("Data time update async request failed\n"); goto onError; } // Wait for date time update to finish error = k_sem_take(&dateTimeInitialized, K_SECONDS(DATETIMEUPDATETIMEOUTS)); if (error) { printk("Data time update time out\n"); goto onError; } // Validate date time if (!date_time_is_valid()) { printk("Data time is not valid\n"); goto onError; } return LMMODULESUCCESS; onError: return LMMODULEERROR; } // Try to initialize the modem and then the date time void lmControlProtoApp_initialize(void) { int error; printk("Initialize modem\n"); error = lmModem_initializeDefault(); printk("Init of modem error: %d\n", error); printk("Initialize date time\n"); error = lmDateTime_initialize(); printk("Init of date time error: %d\n", error); }
This is my prj.conf:
# Physical interface #============================================================================== CONFIG_GPIO=y CONFIG_SERIAL=y # UART (depends on SERIAL) #============================================================================== CONFIG_UART_ASYNC_API=y # Include reboot functionality #============================================================================== CONFIG_REBOOT=y # Logging #============================================================================== CONFIG_LOG=y CONFIG_LOG_MODE_IMMEDIATE=n CONFIG_LOG_MODE_OVERFLOW=y CONFIG_LOG_PROCESS_THREAD=n CONFIG_LOG_DEFAULT_LEVEL=2 CONFIG_LOG_BUFFER_SIZE=1024 CONFIG_LOG_STRDUP_BUF_COUNT=16 # nrf modem library #============================================================================== CONFIG_NRF_MODEM_LIB=y # Nordics date time library (depends on NRF_MODEM_LIB) #============================================================================== CONFIG_DATE_TIME=y CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=3600 # Nordics BSD socket api and dependencies #============================================================================== CONFIG_BSD_LIBRARY=y CONFIG_BSD_LIBRARY_SYS_INIT=y CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_POSIX_NAMES=y # Modem and lte configuration (depends on BSD_LIBRARY) #============================================================================== CONFIG_LTE_LINK_CONTROL=y CONFIG_LTE_NETWORK_MODE_LTE_M=y CONFIG_LTE_AUTO_INIT_AND_CONNECT=n # PSM timer parameters requested from the network provider # CONFIG_LTE_PSM_REQ_RPTAU="00000110" # CONFIG_LTE_PSM_REQ_RAT="00000010" # Memory size #============================================================================== CONFIG_MAIN_STACK_SIZE=16384 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192 CONFIG_HEAP_MEM_POOL_SIZE=16384 # Newlib support (provides some std c library functions) #============================================================================== CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y CONFIG_NEWLIB_LIBC_FLOAT_SCANF=y # Use external cJson library (depends on NEWLIB_LIBC, NEWLIB_LIBC_FLOAT_PRINTF) #============================================================================== CONFIG_CJSON_LIB=y
Please note that I have a second, older device (v0.9.0, SiP revision 1) which still holds the old modem firmware version 1.2.3. The very same code (compiled with the 1.6.1 SDK as well) runs flawless on this device.
Can you please tell me what causes the issue? Since this is the second time my v1.0.0 device shows issue with the date time synchronization after a modem firmware update and no one else seems to have reported similar issues, do you think my hardware might be broken?
Thank you for you help!
Sebastian