lte_lc: Could not send AT command, error: 65536

After gradually increasing up to ncs 3.1.0, the following issue occured:

After:

    LOG_INF("Initializing modem library");
    err = nrf_modem_lib_init();
    if (err) {
        LOG_ERR("Failed to initialize the modem library, error: %d", err);
        return err;
    }


I observe:

[00:00:05.978,454] <inf> main: Initializing modem library
[00:00:06.132,019] <dbg> nrf_modem: nrf_modem_lib_init: Modem init callback: 0x62a3d
[00:00:06.132,049] <dbg> nrf_modem: nrf_modem_lib_init: Modem init callback: 0x6354d
[00:00:06.132,446] <err> lte_lc: Could not send AT command, error: 65536
[00:00:06.132,446] <err> lte_lc: Failed to set system mode and mode preference, err -14


Here is my prj.conf:

#
# prj.conf
#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

### wrk

# Keep the exact same LTE events you handled in v2.7
CONFIG_LTE_LC_PSM_MODULE=y
CONFIG_LTE_LC_EDRX_MODULE=y
CONFIG_LTE_LC_TAU_PRE_WARNING_MODULE=y
CONFIG_LTE_LC_NEIGHBOR_CELL_MEAS_MODULE=y
CONFIG_LTE_LC_MODEM_SLEEP_MODULE=y

### LTE
#CONFIG_LTE_NETWORK_MODE_LTE_M=y
#CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT=n
CONFIG_LTE_LINK_CONTROL=y
#CONFIG_LTE_MODE_PREFERENCE_AUTO=y
#CONFIG_LTE_PSM_REQ=n
#CONFIG_LTE_EDRX_REQ=n
#CONFIG_LTE_RAI_REQ=n
#CONFIG_LTE_NETWORK_TIMEOUT=60
#CONFIG_LTE_LC_TAU_PRE_WARNING_NOTIFICATIONS=n
CONFIG_AT_HOST_LIBRARY=n

### watchdog
CONFIG_WATCHDOG=y
CONFIG_WDT_LOG_LEVEL_INF=y # Or DBG for more verbose watchdog logs

### tune networking
CONFIG_NET_TCP_RETRY_COUNT=1
CONFIG_MQTT_KEEPALIVE=30


### modem
CONFIG_AT_MONITOR=y
CONFIG_NRF_MODEM_LIB=y
# CONFIG_NRF_MODEM_LIB_ON_FAULT_RESET_MODEM=y
CONFIG_NRF_MODEM_LIB_LOG_LEVEL_DBG=y

### (do not) reset on fatal error
CONFIG_RESET_ON_FATAL_ERROR=y

### debug optimizations (-Og)
CONFIG_DEBUG=y
CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_NVS_LOG_LEVEL_DBG=y
## debug network timing
# CONFIG_NET_LOG=y
## debug MQTT timing (add both below)
# CONFIG_MQTT_LOG_LEVEL_DBG=y

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=3000
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=2048

### coredump debug
# CONFIG_DEBUG_COREDUMP=y
# CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y

### higher LOG buffer not to drop LOG messages
CONFIG_LOG_BUFFER_SIZE=2300
#CONFIG_LOG_MODE_DEFERRED=y
#CONFIG_LOG_PROCESS_THREAD=y

### debugging threads
CONFIG_THREAD_ANALYZER=n
CONFIG_THREAD_ANALYZER_AUTO=n

### trying to manage priorities
# CONFIG_SYSTEM_WORKQUEUE_PRIORITY=10

### Admin uart helpers
#CONFIG_UART_2_NRF_HW_ASYNC=y
#CONFIG_UART_2_NRF_HW_ASYNC_TIMER=1

CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y

### uart
CONFIG_UART_ASYNC_API=y
# ! the following must be done not to loosing RX characters: assigning timer 2 to RX processing:
CONFIG_UART_NRFX=y
#CONFIG_UART_1_NRF_HW_ASYNC=y
#CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2
# dynamic uart configuration needed
CONFIG_UART_USE_RUNTIME_CONFIGURE=y


### Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_POSIX_API=y
# CONFIG_NET_SOCKETS_POSIX_API=y
CONFIG_NET_SOCKETS=y
# CONFIG_NET_TCP_ACK_TIMEOUT=100


CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=4096
CONFIG_NET_TCP=y
CONFIG_NET_IPV4=y


### Floating point support
CONFIG_CBPRINTF_FP_SUPPORT=y

#### logging
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_MODE_IMMEDIATE=n
CONFIG_LOG_RUNTIME_FILTERING=y
CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_PROCESS_THREAD=y


### CPU load
#CONFIG_CPU_LOAD=
#CONFIG_CPU_LOAD_LOG_PERIODIC=y
#CONFIG_CPU_LOAD_LOG_INTERVAL=1000


#
### SECURE TFM logging
### disabling logging of TF-M
# CONFIG_TFM_LOG_LEVEL_SILENCE=y
# try to increase MODEM library heap size:
# CONFIG_NRF_MODEM_LIB_HEAP_SIZE=4096
### forward TF-M secure logging to the same UART as application logging (comment the previous)
# CONFIG_TFM_SECURE_UART=y
# CONFIG_TFM_SECURE_UART_SHARE_INSTANCE=y
# CONFIG_TFM_SECURE_UART0=y
# CONFIG_TFM_PARTITION_LOG_LEVEL_DEBUG=y
# CONFIG_TFM_SPM_LOG_LEVEL_DEBUG=y
# Dump exception info. Must be combined with enabling log output.
# CONFIG_TFM_EXCEPTION_INFO_DUMP=y


# CONFIG_TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED=y

### NVS
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_FLASH_MAP=y

###
CONFIG_REBOOT=y

# Enable snprintf float
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

### Possible solution for Fatal error:
# Don't use the minimal TF-M configuration as that doesn't support logging
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y

### Memory
CONFIG_MAIN_STACK_SIZE=3000
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_ISR_STACK_SIZE=4096

### MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_CLEAN_SESSION=y

### ADC
CONFIG_ADC=y

### I2C, IMU
CONFIG_I2C=y 
CONFIG_I2C_CALLBACK=y
CONFIG_I2C_LOG_LEVEL_DBG=y

### others
CONFIG_CLOCK_CONTROL=y

What puzzles me is that even reflashing older versions does not seem to reset the appropriate modem behavior as had been observed before. (How) can it happen?

Parents
  • Hi Martin,
    Is it on NCS 3.1.0 you are seeing this? What MFW are you using?

    What puzzles me is that even reflashing older versions does not seem to reset the appropriate modem behavior as had been observed before. (How) can it happen?

    Am I understanding that you are reflashing an application you know worked before, as well as the MFW and you are still seeing the same issue?

    Regards,
    Benjamin

Reply
  • Hi Martin,
    Is it on NCS 3.1.0 you are seeing this? What MFW are you using?

    What puzzles me is that even reflashing older versions does not seem to reset the appropriate modem behavior as had been observed before. (How) can it happen?

    Am I understanding that you are reflashing an application you know worked before, as well as the MFW and you are still seeing the same issue?

    Regards,
    Benjamin

Children
Related