This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thingy:91 Serial LTE modem PSM

I want to evaluate power consumption of nRF9160 used as AT command modem using Thingy:91 Serial LTE modem.

How to achieve lowest power consumption for Thingy:91 LTE Modem in PSM please ?

- Thingy:91 v1.0.0

- LTE modem app from ncs v1.4.0

- Modem firmware AT+CGMR mfw_nrf9160_1.2.2

https://www.joulescope.com/

- NB IoT Vodafone CZ, +CEREG: 5,"AE38","000AC51F",9,,,"00000000","00000111"

After AT#XSLEEP=0 or AT#XSLEEP=0 I am getting ~90uA average power consumption measured on P1 (SB3 cutted).

I am not able to wake up nRF9160 by UART communication or button.

Tested with following prj.conf build options for Serial LTE modem app:

- default

CONFIG_SLM_GPIO_WAKEUP = y

CONFIG_SLM_GPIO_WAKEUP = y & CONFIG_SLM_INTERFACE_PIN = 26

There is not CONFIG_SLM_CONNECT_UART_0 in prj.conf as stated in documentation https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.0/nrf/applications/serial_lte_modem/doc/slm_description.html

but there is CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - is it OK please ?

 

Whole default prj.conf from ncs v1.4.0:

# General config
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

# Segger RTT
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n

# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_NATIVE=n

# BSD library
CONFIG_BSD_LIBRARY=y
# Align the max FD entry to BSD_MAX_SOCKET_COUNT(8)
CONFIG_POSIX_MAX_FDS=8
# Enable below for modem trace
#CONFIG_BSD_LIBRARY_TRACE_ENABLED=y

# Use GPIO
CONFIG_GPIO=y
CONFIG_GPIO_NRFX=y
CONFIG_GPIO_NRF_P0=y

# UART interface
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_TIMER2=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# Stacks and heaps
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192

# AT_CMD
# Enable AT_CMD debug for details
#CONFIG_AT_CMD_LOG_LEVEL_DBG=y

# Device power management
CONFIG_DEVICE_POWER_MANAGEMENT=y

# Enable SUPL client support
#CONFIG_SUPL_CLIENT_LIB=y

# FOTA
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
CONFIG_FLASH=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Application-specific
CONFIG_SLM_LOG_LEVEL_INF=y
# Enable GPIO wakeup if sleep is expected
#CONFIG_SLM_GPIO_WAKEUP=y
# Use UART_0 (when working with PC terminal)
CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
# Use UART_2 (when working with external MCU)
#CONFIG_SLM_CONNECT_UART_2=y
#CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2
# Use optional TCP/TLS Proxy
#CONFIG_SLM_TCP_PROXY=y
# Use optional UDP/DTLS Proxy
#CONFIG_SLM_UDP_PROXY=y
  • Hi Michael,

    I am seeing the same as you are. The device stops responding after AT#XSLEEP=0. I have not yet measured the current.

    I will be investigate a few things tomorrow.

    Best regards,

    Håkon

  • I have similar issue, (posted here)

    After sending either AT#XSLEEP=0 or AT#XSLEEP=1, cannot wake up nRF9160 by sending any AT command.

    The currents in both sleep or idle mode is lower than 10uA. I cannot measure the exact current, I am getting the Nordic Power Profiler soon which would help me measure currents for series of AT commands. 

    Really interested in wake up over serial comm, since I plan to use the nRF9160 just as SLM with external MCU.

    requesting your help 

  • Hi, I tried this on a thingy91 and it works almost out of the box, with a couple of changes. I tried with the Serial LTE Modem application from NCS 1.4.0.

    You have to add CONFIG_SLM_GPIO_WAKEUP=y and CONFIG_SLM_INTERFACE_PIN=26 to the prj.conf as you did. No other changes are necessary to wake up using the button.

    Here is my full prj.conf:

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    #
    # General config
    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
    
    # Segger RTT
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_NATIVE=n
    
    # BSD library
    CONFIG_BSD_LIBRARY=y
    # Align the max FD entry to BSD_MAX_SOCKET_COUNT(8)
    CONFIG_POSIX_MAX_FDS=8
    # Enable below for modem trace
    #CONFIG_BSD_LIBRARY_TRACE_ENABLED=y
    
    # Use GPIO
    CONFIG_GPIO=y
    CONFIG_GPIO_NRFX=y
    CONFIG_GPIO_NRF_P0=y
    
    # UART interface
    CONFIG_SERIAL=y
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_TIMER2=y
    
    # LTE link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    
    # Stacks and heaps
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
    
    # AT_CMD
    # Enable AT_CMD debug for details
    #CONFIG_AT_CMD_LOG_LEVEL_DBG=y
    
    # Device power management
    CONFIG_DEVICE_POWER_MANAGEMENT=y
    
    # Enable SUPL client support
    #CONFIG_SUPL_CLIENT_LIB=y
    
    # FOTA
    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
    CONFIG_FLASH=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    # Application-specific
    CONFIG_SLM_LOG_LEVEL_INF=y
    # Enable GPIO wakeup if sleep is expected
    CONFIG_SLM_GPIO_WAKEUP=y
    CONFIG_SLM_INTERFACE_PIN=26
    # Use UART_0 (when working with PC terminal)
    CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
    # Use UART_2 (when working with external MCU)
    #CONFIG_SLM_CONNECT_UART_2=y
    #CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2
    # Use optional TCP/TLS Proxy
    #CONFIG_SLM_TCP_PROXY=y
    # Use optional UDP/DTLS Proxy
    #CONFIG_SLM_UDP_PROXY=y
    

    In order to reduce the idle current UART1 has to be disabled, since this is turned on by default in Zephyr. The easiest way to do this is to add an overlay file:

    Add the following to a file called thingy91_nrf9160ns.overlay (or thingy91_nrf9160.overlay if you are not building for non-secure) and save the file in the project root folder:

    &uart1 {
        status = "disabled";
    };

    You might have to delete the build folder for the new file to be found.

    Then, build for board thingy91_nrf9160ns (or thingy91_nrf9160), and flash the FW.

    Remember that the connectivity FW has to be flashed on the nRF52 in order to see the UART output over the USB connection.

    Push the button and you should see the terminal print "ready".

  • Hi, thanks for your reply :)

    For my current version of custom board, I do not have a GPIO pin designed to get wakeup trigger from external MCU. 

    Is there a way to config nRF9160 to just wake up from the UART1 after putting nRF9160 to sleep with the SLEEP command? 

    In my next version of the pcb design, I will make sure to update and include this GPIO wakeup from external MCU. 

    Thank you!

  • I believe you can try to set the UART RX pin as the wakeup pin. Then send a dummy byte from the UART host to wake up the nRF9160. The level changes on the UART RX pin should be equivalent to pushing a button. I've not been able to test this my self, but I don't see why it shouldn't work. It's worth a try.

Related