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, the response to any "CFUN" command is always ERROR.

We use nRF9160 on our own board.
The firmware "Serial lte modem" is installed on the chip with connection to an external MCU.

#\nUse\nUART_0\n(when\nworking\nwith\nPC\nterminal)
#CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
#\nUse\nUART_2\n(when\nworking\nwith\nexternal\nMCU)
CONFIG_SLM_CONNECT_UART_2=y
CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2

A port is connected to the board to communicate with the nRF9160 via the terminal. The nRF9160 responds to "AT" or "AT%XSYSTEMMODE=1,0,0,0" commands (response is always "OK"), but any attempts to execute commands like:
- AT+CFUN=0;
- AT+CFUN=1;
- AT+CFUN?;
- AT+CFUN=?
Always returns an "ERROR" response (with a delay of a few seconds). What could be the reason?

Parents
  • Hi Stas,

    Set CONFIG_SLM_LOG_LEVEL_DBG=y and observe log from Jlink RTT viewer should be able to see the UART RX content.

    Can you try this method to debug your issue?  nRF9160DK+ LInk monitor can be used as a comparation.

    Best regards,

    Charlie


  • I am attaching the log from J Link RTT Viewer:

    00> [00:00:00.156,127] <inf> slm: Serial LTE Modem
    00> [00:00:00.182,464] <dbg> slm_at_host: TX
    00>                                       52 65 61 64 79 0d 0a                             |Ready..          
    00> [00:00:00.182,495] <dbg> slm_fota.slm_fota_post_process: FOTA result 0,0,0
    00> [00:00:00.185,882] <inf> slm_at_host: at_host init done
    00> [00:00:43.211,883] <dbg> slm_at_host: RX
    00>                                       41 54                                            |AT               
    00> [00:00:43.219,299] <dbg> slm_at_host: TX
    00>                                       0d 0a                                            |..               
    00> [00:00:43.219,329] <dbg> slm_at_host: TX
    00>                                       4f 4b 0d 0a                                      |OK..             
    00> [00:00:46.803,833] <dbg> slm_at_host: RX
    00>                                       41 54 2b 43 46 55 4e 3d  30                      |AT+CFUN= 0       
    00> [00:00:46.804,351] <dbg> slm_at_host.uart_callback: RX_DISABLED
    00> [00:00:46.810,699] <err> slm_at_host: AT command error, type: 1
    00> [00:00:46.810,729] <dbg> slm_at_host: TX
    00>                                       0d 0a                                            |..               
    00> [00:00:46.810,760] <dbg> slm_at_host: TX
    00>                                       45 52 52 4f 52 0d 0a                             |ERROR..          
    00> [00:01:01.644,348] <dbg> slm_at_host: RX
    00>                                       41 54 2b 43 46 55 4e 3d  30                      |AT+CFUN= 0       
    00> [00:01:01.644,836] <dbg> slm_at_host.uart_callback: RX_DISABLED
    00> [00:01:01.651,214] <err> slm_at_host: AT command error, type: 1
    00> [00:01:01.651,245] <dbg> slm_at_host: TX
    00>                                       0d 0a                                            |..               
    00> [00:01:01.651,275] <dbg> slm_at_host: TX
    00>                                       45 52 52 4f 52 0d 0a                             |ERROR..          
    00> [00:01:08.068,695] <dbg> slm_at_host: RX
    00>                                       41 54 2b 43 46 55 4e 3f                          |AT+CFUN?         
    00> [00:01:08.069,183] <dbg> slm_at_host.uart_callback: RX_DISABLED
    00> [00:01:08.075,531] <err> slm_at_host: AT command error, type: 1
    00> [00:01:08.075,561] <dbg> slm_at_host: TX
    00>                                       0d 0a                                            |..               
    00> [00:01:08.075,592] <dbg> slm_at_host: TX
    00>                                       45 52 52 4f 52 0d 0a                             |ERROR..

    Just in case, here's the config:
    #
    #\nCopyright\n(c)\n2020\nNordic\nSemiconductor\nASA
    #
    #\nSPDX-License-Identifier:\nLicenseRef-Nordic-5-Clause
    #
    #\nGeneral\nconfig
    CONFIG_LOG=y
    CONFIG_LOG_DEFAULT_LEVEL=3
    CONFIG_STACK_SENTINEL=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_RING_BUFFER=y
    
    #\nSegger\nRTT
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    
    #\nNetwork
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_NATIVE=n
    
    #\nModem\nlibrary
    CONFIG_NRF_MODEM_LIB=y
    #\nAlign\nthe\nmax\nFD\nentry\nto\nNRF_MODEM_MAX_SOCKET_COUNT(8)
    CONFIG_POSIX_MAX_FDS=8
    #\nEnable\nbelow\nfor\nmodem\ntrace
    CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=y
    
    #\nUse\nGPIO
    CONFIG_GPIO=y
    CONFIG_GPIO_NRFX=y
    CONFIG_GPIO_NRF_P0=y
    
    #\nUART\ninterface
    CONFIG_SERIAL=y
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_TIMER2=y
    
    #\nStacks\nand\nheaps
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    
    #\nDevice\npower\nmanagement
    CONFIG_PM_DEVICE=y
    
    #\nFOTA
    CONFIG_HTTP_PARSER_URL=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
    CONFIG_DFU_TARGET=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    
    #\nFLASH
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    #\nSettings
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_FCB=y
    CONFIG_FCB=y
    
    #\nnRF\nCloud
    CONFIG_CLOUD_API=y
    CONFIG_NRF_CLOUD_MQTT=y
    CONFIG_NRF_CLOUD_FOTA=n
    CONFIG_NRF_CLOUD_AGPS=y
    CONFIG_NRF_CLOUD_PGPS=y
    CONFIG_NRF_CLOUD_CELL_POS=y
    CONFIG_NRF_CLOUD_LOG_LEVEL_INF=y
    CONFIG_DATE_TIME=y
    CONFIG_MODEM_INFO=y
    CONFIG_MODEM_INFO_ADD_DATE_TIME=n
    CONFIG_AT_MONITOR=y
    CONFIG_MODEM_JWT=y
    #\nUse\n"nrf-<IMEI>"\nas\nthe\ndefault\ndevice_id\nformat
    #\nUse\n"<device_uuid>"\nas\nthe\ndevice_id\nformat\nby\nbelow
    #CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID=y
    
    #
    #\nSLM-specific\nconfigurations
    #
    CONFIG_SLM_CUSTOMIZED=n
    CONFIG_SLM_LOG_LEVEL_INF=y
    CONFIG_SLM_EXTERNAL_XTAL=n
    CONFIG_SLM_START_SLEEP=n
    #\nUse\nUART_0\n(when\nworking\nwith\nPC\nterminal)
    #CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
    #\nUse\nUART_2\n(when\nworking\nwith\nexternal\nMCU)
    CONFIG_SLM_CONNECT_UART_2=y
    CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2
    #\nnRF\nCloud\nbased\nlocation\nservices
    CONFIG_SLM_AGPS=y
    CONFIG_SLM_PGPS=y
    CONFIG_SLM_CELL_POS=y
    CONFIG_SLM_LOG_LEVEL_DBG=y

    , settings from dts files, can help?

  • Hi Stas,

    There is one former case very close to your issue, can you try the solution mentioned on https://devzone.nordicsemi.com/f/nordic-q-a/82885/most-at-commands-return-error/344237#344237

    Best regards,

    Charlie

Reply Children
Related