nRF9160 low power with CONFIG_PM=y

Hello Devzone,

While developing an nRF9160 based, battery powered device (working on the firmware piece of the puzzle) I have run into a couple of issues in my effort to reach a deep sleep mode and floor current of four micro-amps (4uA) or less.  I am within about a current use factor of six, but only so when I disable Zephyr RTOS' power management option in my project's prj.conf file.

I am building against ncs v1.6.1, which includes Zephyr 2.6.0.

The firmware app by which I can reach floor current of about 22uA turns off UARTs of the 9160 (turns off high speed clocks used by UART RX pins), and does not explicitly set Zephyr `PM` symbol.  The result is that power management for run-time hardware config changes is disabled.

When I enable Zephyr's `PM` symbol, floor current rises from ~22uA to about 45uA.

Question (1)  what elements of Zephyr's Power Management feature draw about 25uA of current?

The demo code which for us achieves the lowest floor currents, on both nRF9160DK board and our custom board, is very limited in its functionality.  It is a low power Zephyr demo with nearly every peripheral and Zephyr RTOS feature turned off.  In real life we need to exercise UARTs and other peripherals some fraction of the time.  We would like to turn things on via firmware, run for a while, then return to deep sleep mode.  But so far only Zephyr's Power Management of `PM` feature allows us to turn UART clocks on and off at will.  Yet to enable power management, e.g. set CONFIG_PM=y we find our floor current increase in the deep sleep configuration we're able to achieve.  This is a problem.

For battery life requirements we need and want to have dynamic power management (Zephyr 'PM') and yet reach the single microamp floor currents of and in the nRF9160.

Searching Zephyr tree sources for its release tag 2.6.0, I see that CONFIG_PM symbol pulls in a couple of source files to Zephyr's build process:  ./subsys/pm/power.c and ./subsys/pm/pm_ctrl.c, and possibly ./soc/arm/nordic_nrf/nrf91/power.c.  It looks like one of these files enables a timer in the application processor.  I'm wondering whether such a time draws the extra current we observe.  And if yes, I wonder whether there is a config or programmatic way to dynamically disable that timer.

Question (2)  Is there some finer Zephyr PM configuration we can apply, so that the power management feature can itself be put to sleep temporarily and awake on next entry of hardware plus firmware into full active mode?

To rewrite parts of Zephyr source tree does not seem like a reasonable way to achieve and enjoy practical, battery supporting low power operation of the nRF9160.  Hoping there is some experience and perhaps even a vetted solution or example in the public / community domain on this topic.  Thanks!

- Ted

Parents
  • Hi

    Can you show me your kconfig file? You will need to disable things like logging, serial, and GPIOs to get to the lowest possible current consumption.

    1. I assume you refer to the known issue (NCSDK-10106) in the nRF Connect SDK? When running application that don't use the modem library, the current consumption will stay at 3mA in sleep mode. The workaround here is to enable the modem library.

    2. Enabling CONFIG_GPIO lets Zephyr control the GPIOTE peripheral and includes the GPIO drivers in your system configuration. If you need to change this at runtime CONFIG_GPIO must be enabled and you will have to disable the GPIO drivers whenever going to sleep for example.

    Best regards,

    Simon

  • Hello Simonr,

    Here is the Kconfig file from the "low power hello_world" adaptation I have written for a custom board that's similar to Nordic's Thingy91 . . . it's a bit long.  There may be one or more symbols here I need to comment out or set to 'n':

    ## -- Original Nordic prj.conf comment block BEGIN --
    
    #
    # Copyright (c) 2020 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    ## -- Original Nordic prj.conf comment block END --
    
    #
    ##----------------------------------------------------------------------
    ##  Project:  custom app firmware
    ##
    ##  Filename:  prj.conf
    ##
    ##  Description:  Kconfig (kernel configuration) language based file
    ##    to configure features of Zephyr RTOS and third party libraries
    ##    on which Pusle firmware depends.
    ##----------------------------------------------------------------------
    #
    
    
    
    
    # - DEV 0411 COMMENT BEGIN - 
    #
    # Reviewing all `grep -n ^CONFIG_ ./prj.conf` symbols (69 as of 2022-04-11 MON) and
    # commenting out those not found in nRF9160DK low power hello_world sample
    # app.  For this task commented symbol lines begin with '###' - TMH
    #
    # - DEV 0411 COMMENT END - 
    
    
    
    
    # General config
    ### CONFIG_NCS_SAMPLES_DEFAULTS=n      # (1) current draw ~630uA and ~46uA
    ### CONFIG_REBOOT=n                    # (1) current draw ~630uA and ~46uA
    
    # NEWLIB C
    ### CONFIG_NEWLIB_LIBC=y               # (1) current draw ~630uA and ~46uA
    ### CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y  # (1) current draw ~630uA and ~46uA
    
    
    
    # 2022-03-01 -
    # custom app branch `low-power-work-002` low power related efforts:
    # Ref https://devzone.nordicsemi.com/f/nordic-q-a/81744/nrf9160-deep-sleep-power-consumption-help/341928#341928
    ### CONFIG_DEVICE_POWER_MANAGEMENT=y   # (2) current draw ~630uA and ~46uA
    
    # 2022-03-02 - based on search for uart_rx_disable() definition:
    ## NOTE one or both of these options increase app flash usage from 73% to 85% of ~450kB - TMH
    #CONFIG_UART_ASYNC_API=y
    #CONFIG_USERSPACE=y
    
    # 2022-02-21 - Zephyr power management work:
    # Per Jared Wolff https://community.jaredwolff.com/d/222-nrf9160-sleep-and-low-power-control-areas
    ### CONFIG_PM_DEVICE=y                     ### NOTE WE NEED THIS SYMBOL, to turn off UART clocks at run time - TMH
    # Per Zephyr Project https://wiki.neelanurseries.com/index.php/Zephyr_ncs_sleep_modes#.5E_nRF9160_Power_Saving_Mode.28s.29_Examples
    ### CONFIG_PM_DEVICE_RUNTIME=y
    
    
    # - DEV 0308 BEGIN -
    # REF https://docs.zephyrproject.org/2.6.0/reference/logging/index.html?highlight=log%20levels
    #
    ##CONFIG_LOG_IMMEDIATE=n    <-- not user configurable
    
    ## REF https://devzone.nordicsemi.com/f/nordic-q-a/46083/how-to-setup-zephyr-for-rtt-logging-with-nrf9160
    #docs.zephyrproject.org/.../nordic_segger.html
    #CONFIG_UART_CONSOLE=n
    #CONFIG_RTT_CONSOLE=y
    #CONFIG_HAS_SEGGER_RTT=y
    #CONFIG_USE_SEGGER_RTT=y
    
    # REF https://devzone.nordicsemi.com/f/nordic-q-a/85435/possible-to-fully-turn-off-uart-from-zephyr-based-application
    # Enable RTT
    CONFIG_USE_SEGGER_RTT=y            # [B] 0411 present and equally assigned in custom and low power projects - TMH
    CONFIG_LOG=y                       # 0411 added to match hello_world config
    
    # Send log over RTT
    CONFIG_LOG_BACKEND_RTT=y           # [B] 0411 present and equally assigned in custom and low power projects
    #(Optionally also CONFIG_LOG_BACKEND_UART=n, you'll probably get some Kconfig warnings without)
    CONFIG_LOG_BACKEND_UART=n          # [B] 0411 present and equally assigned in custom and low power projects
    
    # Send printk/printf over RTT
    CONFIG_RTT_CONSOLE=y               # [B] 0411 present and equally assigned in custom and low power projects
    #(Optionally also CONFIG_UART_CONSOLE=n)
    CONFIG_UART_CONSOLE=n              # [B] 0411 present and equally assigned in custom and low power projects
    # - DEV 0308 END -
    CONFIG_SERIAL=n                    # 0411 added to match hello_world config
    
    
    # REF https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/hardware-design/posts/measuring-psm-idle-current-on-the-nrf91-dk
    CONFIG_GPIO=n
    CONFIG_LOG=n
    CONFIG_AT_HOST_LIBRARY=n
    CONFIG_NEWLIB_LIBC=n
    
    
    # Network
    CONFIG_NETWORKING=y                # [B] 0411 present and equally assigned in custom and low power projects - TMH
    ### CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS=y
    
    # LTE link control
    ### CONFIG_LTE_LINK_CONTROL=y          # - DEV 0401 - was 'y', but setting this 'n' causes at_notif_init() to be not found by cmake.
                                      # also LTE_LINK_CONTROL depends on Kconfig NEWLIB_LIBC
    ### CONFIG_LTE_NETWORK_MODE_LTE_M=n    # - DEV 0401 - was 'y'
    ### CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    
    # Modem library
    CONFIG_NRF_MODEM_LIB=y             # [B] 0411 present and equally assigned in custom and low power projects
    CONFIG_NRF_MODEM_LIB_SYS_INIT=y    # [B] 0411 present and equally assigned in custom and low power projects
    
    # AT Host
    ### CONFIG_UART_INTERRUPT_DRIVEN=y
    ## 2022-03-24 REF https://devzone.nordicsemi.com/f/nordic-q-a/85747/to-identify-adjust-sleep-period-of-sample-app-threads
    #CONFIG_AT_HOST_LIBRARY=y
    ### CONFIG_AT_HOST_LIBRARY=n
    
    
    
    # AWS IoT library
    ### CONFIG_AWS_IOT=y                   # - DEV 0401 - was 'y'
    ### CONFIG_AWS_IOT_CLIENT_ID_STATIC="CustomIotThing"
    ### CONFIG_AWS_IOT_BROKER_HOST_NAME="remote.host.com"
    ### CONFIG_AWS_IOT_SEC_TAG=0123456
    
    ## 2022-02-28 - effort to decouple from AWS IoT library threads, use our own - TMH
    ##  Note symbol AWS_IOT_CONNECTION_POLL_THREAD defined in ncs/nrf/subsys/net/lib/aws_iot/Kconfig,
    ##  and defaults to 'y'.  Override that default value here, and enable
    ##  custom app replacement symbol:
    ### CONFIG_AWS_IOT_CONNECTION_POLL_THREAD=n
    ### CONFIG_CUSTOM_APP_CONNECTION_POLL_THREAD=n   # - DEV 0401 - was 'y'
    
    # 2021-12-14 TUE - adjusting up from 2 to 3, normally set to 2 in Nordic aws_iot sample app:
    #  ( custom app team may adjust subscription list count again if needed. )
    #
    ## NOTE this value must match the number of MQTT topics to which custom app
    ##  firmware application subscribes, otherwise segmentation fault occurs
    ##  upon call to AWS IoT client diconnect function - TMH
    #
    ### CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=5
    
    # 2022-02-04 Ted changing following 1, 3 and 4 from 'y' to 'n':
    ### CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=n
    ### CONFIG_AWS_IOT_LAST_WILL=y
    ### CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=n
    ### CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=n
    
    # 2022-02-04 MQTT client pull in work, refactoring related:
    ### CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=n
    
    
    
    # MQTT - Maximum MQTT keepalive timeout specified by AWS IoT Core
    ### CONFIG_MQTT_KEEPALIVE=1200
    
    ## 2021-12-15
    ## REF https://devzone.nordicsemi.com/f/nordic-q-a/69077/nrf9160-aws_iot-sample-mqtt-topic-add-does-not-work/288602#288602
    ### CONFIG_MQTT_CLEAN_SESSION=y
    
    # Date Time library
    ### CONFIG_DATE_TIME=n                 # - DEV 0401 - was 'y'
    
    # Modem information
    ### CONFIG_MODEM_INFO=y                # - DEV 0401 - was 'y', MODEM_INFO depends on Kconfig NEWLIB_LIBC
    
    # Heap and stacks
    CONFIG_KERNEL_MEM_POOL=y               # 0411 added to match hello_world config
    CONFIG_HEAP_MEM_POOL_SIZE=8192
    ### CONFIG_MAIN_STACK_SIZE=4096
    ### CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # MCUBOOT
    ### CONFIG_BOOTLOADER_MCUBOOT=y
    ### CONFIG_MCUBOOT_IMG_MANAGER=y
    
    # Image manager
    ### CONFIG_IMG_MANAGER=n               # - DEV 0401 - was 'y'
    ### CONFIG_FLASH=n                     # - DEV 0401 - was 'y'
    ### CONFIG_IMG_ERASE_PROGRESSIVELY=n   # - DEV 0401 - was 'y'
    
    # AWS FOTA
    ### CONFIG_AWS_FOTA=n                  # - DEV 0401 - was 'y'
    ### CONFIG_FOTA_DOWNLOAD=n             # - DEV 0401 - was 'y'
    ### CONFIG_DFU_TARGET=n                # - DEV 0401 - was 'y'
    
    # CJSON
    ### CONFIG_CJSON_LIB=y
    
    # Download client (needed by AWS FOTA)
    ### CONFIG_DOWNLOAD_CLIENT=n           # - DEV 0401 - was 'y'
    ### CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    
    
    
    ## 2021-09-30 - driver-addition-work-001, git branch name - TMH
    ## Following Sensors section copied from Kionix out-of-tree driver project:
    # Sensors
    ### CONFIG_I2C=n                       # - DEV 0401 - was 'y'
    ### CONFIG_SENSOR=y                    # - DEV 0401 - setting to 'n' breaks #include "iis2dh_reg.h" - TMH
    ## CONFIG_KX132_1211=y  # 2021-10-28 Ted removing Kionix dependencies in branch 'stage1-v1-segger-base'.
    
    # STMicro accelerometers iis2dh and lis2dh:
    ### CONFIG_IIS2DH=y                    # - DEV 0401 - setting to 'n' breaks #include "iis2dh_reg.h" - TMH
    ### CONFIG_IIS2DH_RANGE=0
    # Select Output Data Rate of 100Hz for demo, values 0..9 defined in ST file iis2dh_reg.h
    ### CONFIG_IIS2DH_ODR=5
    
    # Note STMicro HAL/middle-level drivers (pair of files) for iis2dh located in:
    # [west_workspace]/modules/hal/st/sensor/stmemsc/iis2dh_STdC/driver
    
    ### CONFIG_LIS2DH=n                    # - DEV 0401 - was 'y'
    
    ## 2021-10-08 FRI - implementing timing tests for accelerometer measurements
    ### CONFIG_TIMING_FUNCTIONS=n          # - DEV 0401 - was 'y'
    
    ## 2021-10-30 - enable floating point output from printf() family functions
    ### CONFIG_CBPRINTF_FP_SUPPORT=y       # - DEV 0401 - was 'y'
    
    ## 2021-11-04 - work to enable CMSIS Digital Signal Processing math libraries:
    ## REF https://devzone.nordicsemi.com/f/nordic-q-a/51656/how-to-include-math-cmsis-dsp-library-in-nrf9160
    ### CONFIG_FPU=n                       # - DEV 0401 - was 'y'
    ### CONFIG_CMSIS_DSP=y
    ## Search of Kconfig symbols for this project, via `west build -t menuconfig` gives:
    #CONFIG_CMSIS_DSP_COMPLEXMATH=y      # <-- not sufficient for 'arm_rfft_fast_init_f32' and 'arm_rfft_fast_f32'
    #CONFIG_CMSIS_DSP_FASTMATH=y         # <-- not sufficient for 'arm_rfft_fast_init_f32' and 'arm_rfft_fast_f32'
    #CONFIG_CMSIS_DSP_TABLES_ALL_FAST=y  # <-- not sufficient for 'arm_rfft_fast_init_f32' and 'arm_rfft_fast_f32'
    ## REF https://github.com/zephyrproject-rtos/zephyr/issues/32206
    ### CONFIG_CMSIS_DSP_TRANSFORM=y
    
    # 2021-11-11 - Zephyr thread analyzer work:
    ### CONFIG_THREAD_ANALYZER=y
    ### CONFIG_THREAD_ANALYZER_USE_PRINTK=y
    ### CONFIG_THREAD_ANALYZER_AUTO=n
    ### CONFIG_THREAD_NAME=y
    #CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=10
    
    
    # 2022-03-21 -
    ### CONFIG_LOG_MODE_IMMEDIATE=n       # 0408 was 'y'
    ### CONFIG_DEBUG_THREAD_INFO=y
    ### CONFIG_THREAD_STACK_INFO=y
    
    
    # --- End of project dot conf file ---

    The leak current I mentioned reading about is different from the "known issues" page to which you share a link.  The Nordic Devzone engineer Heidi-Irene refers to this matter in Devzone ticket 59812, about seventeen replies (both developer's and Irene's) from the beginning of this ticket.  In that reply she writes:

    "Perhaps shutting down BSD lib was preventing one of the threads from going to sleep? I will have a closer look today.

    Side note: when you're measuring on the DK, VDD IO should be set to 3V to get 4uA as the floor current in PSM. It's a workaround for a current leak that occurs if VDD IO is in 1.8 V."

    There is another Devzone post I saw which refers to this leak current issue, in certain silicon releases of the nRF9160, and occurring when VDD_GPIO is less than VDD.  I don't have the post number or link to it handy.  I'll look further.

    You mention that logging needs to be disabled.  Does this include to disable CONFIG_RTT_CONSOLE?

    In a Devzone ticket I created about a month ago, another engineer on your team confirmed that when I measure 20uA or even 40uA I have successfully disabled UARTs and their associated high speed clocks.  In Power Profiler Kit II current waveforms I see a signal that's noisy but without any obvious periodic pattern.  The signal looks noisy, but when zooming way in all points fall between about 8uA and 50uA, averaging to 20uA.

    The mostly featureless, non-periodic current waveform I observe makes me suspect that the Power Profiler Kit is showing some type of leakage current in the SiP.  I suspect this as opposed to a thread starting up periodically, which I have seen how that appears in other tests I have run.  Current spikes appear when threads run.

    I suspect there is one or more parts of SiP hardware configuration which I have missed, or have configured incorrectly.  I hope the active Kconfig lines in my prj.conf file can offer an answer to what is drawing about 16uA above and beyond the 4uA that's possible with the nRF9160.

    - Ted

Reply
  • Hello Simonr,

    Here is the Kconfig file from the "low power hello_world" adaptation I have written for a custom board that's similar to Nordic's Thingy91 . . . it's a bit long.  There may be one or more symbols here I need to comment out or set to 'n':

    ## -- Original Nordic prj.conf comment block BEGIN --
    
    #
    # Copyright (c) 2020 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    ## -- Original Nordic prj.conf comment block END --
    
    #
    ##----------------------------------------------------------------------
    ##  Project:  custom app firmware
    ##
    ##  Filename:  prj.conf
    ##
    ##  Description:  Kconfig (kernel configuration) language based file
    ##    to configure features of Zephyr RTOS and third party libraries
    ##    on which Pusle firmware depends.
    ##----------------------------------------------------------------------
    #
    
    
    
    
    # - DEV 0411 COMMENT BEGIN - 
    #
    # Reviewing all `grep -n ^CONFIG_ ./prj.conf` symbols (69 as of 2022-04-11 MON) and
    # commenting out those not found in nRF9160DK low power hello_world sample
    # app.  For this task commented symbol lines begin with '###' - TMH
    #
    # - DEV 0411 COMMENT END - 
    
    
    
    
    # General config
    ### CONFIG_NCS_SAMPLES_DEFAULTS=n      # (1) current draw ~630uA and ~46uA
    ### CONFIG_REBOOT=n                    # (1) current draw ~630uA and ~46uA
    
    # NEWLIB C
    ### CONFIG_NEWLIB_LIBC=y               # (1) current draw ~630uA and ~46uA
    ### CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y  # (1) current draw ~630uA and ~46uA
    
    
    
    # 2022-03-01 -
    # custom app branch `low-power-work-002` low power related efforts:
    # Ref https://devzone.nordicsemi.com/f/nordic-q-a/81744/nrf9160-deep-sleep-power-consumption-help/341928#341928
    ### CONFIG_DEVICE_POWER_MANAGEMENT=y   # (2) current draw ~630uA and ~46uA
    
    # 2022-03-02 - based on search for uart_rx_disable() definition:
    ## NOTE one or both of these options increase app flash usage from 73% to 85% of ~450kB - TMH
    #CONFIG_UART_ASYNC_API=y
    #CONFIG_USERSPACE=y
    
    # 2022-02-21 - Zephyr power management work:
    # Per Jared Wolff https://community.jaredwolff.com/d/222-nrf9160-sleep-and-low-power-control-areas
    ### CONFIG_PM_DEVICE=y                     ### NOTE WE NEED THIS SYMBOL, to turn off UART clocks at run time - TMH
    # Per Zephyr Project https://wiki.neelanurseries.com/index.php/Zephyr_ncs_sleep_modes#.5E_nRF9160_Power_Saving_Mode.28s.29_Examples
    ### CONFIG_PM_DEVICE_RUNTIME=y
    
    
    # - DEV 0308 BEGIN -
    # REF https://docs.zephyrproject.org/2.6.0/reference/logging/index.html?highlight=log%20levels
    #
    ##CONFIG_LOG_IMMEDIATE=n    <-- not user configurable
    
    ## REF https://devzone.nordicsemi.com/f/nordic-q-a/46083/how-to-setup-zephyr-for-rtt-logging-with-nrf9160
    #docs.zephyrproject.org/.../nordic_segger.html
    #CONFIG_UART_CONSOLE=n
    #CONFIG_RTT_CONSOLE=y
    #CONFIG_HAS_SEGGER_RTT=y
    #CONFIG_USE_SEGGER_RTT=y
    
    # REF https://devzone.nordicsemi.com/f/nordic-q-a/85435/possible-to-fully-turn-off-uart-from-zephyr-based-application
    # Enable RTT
    CONFIG_USE_SEGGER_RTT=y            # [B] 0411 present and equally assigned in custom and low power projects - TMH
    CONFIG_LOG=y                       # 0411 added to match hello_world config
    
    # Send log over RTT
    CONFIG_LOG_BACKEND_RTT=y           # [B] 0411 present and equally assigned in custom and low power projects
    #(Optionally also CONFIG_LOG_BACKEND_UART=n, you'll probably get some Kconfig warnings without)
    CONFIG_LOG_BACKEND_UART=n          # [B] 0411 present and equally assigned in custom and low power projects
    
    # Send printk/printf over RTT
    CONFIG_RTT_CONSOLE=y               # [B] 0411 present and equally assigned in custom and low power projects
    #(Optionally also CONFIG_UART_CONSOLE=n)
    CONFIG_UART_CONSOLE=n              # [B] 0411 present and equally assigned in custom and low power projects
    # - DEV 0308 END -
    CONFIG_SERIAL=n                    # 0411 added to match hello_world config
    
    
    # REF https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/hardware-design/posts/measuring-psm-idle-current-on-the-nrf91-dk
    CONFIG_GPIO=n
    CONFIG_LOG=n
    CONFIG_AT_HOST_LIBRARY=n
    CONFIG_NEWLIB_LIBC=n
    
    
    # Network
    CONFIG_NETWORKING=y                # [B] 0411 present and equally assigned in custom and low power projects - TMH
    ### CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS=y
    
    # LTE link control
    ### CONFIG_LTE_LINK_CONTROL=y          # - DEV 0401 - was 'y', but setting this 'n' causes at_notif_init() to be not found by cmake.
                                      # also LTE_LINK_CONTROL depends on Kconfig NEWLIB_LIBC
    ### CONFIG_LTE_NETWORK_MODE_LTE_M=n    # - DEV 0401 - was 'y'
    ### CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    
    # Modem library
    CONFIG_NRF_MODEM_LIB=y             # [B] 0411 present and equally assigned in custom and low power projects
    CONFIG_NRF_MODEM_LIB_SYS_INIT=y    # [B] 0411 present and equally assigned in custom and low power projects
    
    # AT Host
    ### CONFIG_UART_INTERRUPT_DRIVEN=y
    ## 2022-03-24 REF https://devzone.nordicsemi.com/f/nordic-q-a/85747/to-identify-adjust-sleep-period-of-sample-app-threads
    #CONFIG_AT_HOST_LIBRARY=y
    ### CONFIG_AT_HOST_LIBRARY=n
    
    
    
    # AWS IoT library
    ### CONFIG_AWS_IOT=y                   # - DEV 0401 - was 'y'
    ### CONFIG_AWS_IOT_CLIENT_ID_STATIC="CustomIotThing"
    ### CONFIG_AWS_IOT_BROKER_HOST_NAME="remote.host.com"
    ### CONFIG_AWS_IOT_SEC_TAG=0123456
    
    ## 2022-02-28 - effort to decouple from AWS IoT library threads, use our own - TMH
    ##  Note symbol AWS_IOT_CONNECTION_POLL_THREAD defined in ncs/nrf/subsys/net/lib/aws_iot/Kconfig,
    ##  and defaults to 'y'.  Override that default value here, and enable
    ##  custom app replacement symbol:
    ### CONFIG_AWS_IOT_CONNECTION_POLL_THREAD=n
    ### CONFIG_CUSTOM_APP_CONNECTION_POLL_THREAD=n   # - DEV 0401 - was 'y'
    
    # 2021-12-14 TUE - adjusting up from 2 to 3, normally set to 2 in Nordic aws_iot sample app:
    #  ( custom app team may adjust subscription list count again if needed. )
    #
    ## NOTE this value must match the number of MQTT topics to which custom app
    ##  firmware application subscribes, otherwise segmentation fault occurs
    ##  upon call to AWS IoT client diconnect function - TMH
    #
    ### CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=5
    
    # 2022-02-04 Ted changing following 1, 3 and 4 from 'y' to 'n':
    ### CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=n
    ### CONFIG_AWS_IOT_LAST_WILL=y
    ### CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=n
    ### CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=n
    
    # 2022-02-04 MQTT client pull in work, refactoring related:
    ### CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=n
    
    
    
    # MQTT - Maximum MQTT keepalive timeout specified by AWS IoT Core
    ### CONFIG_MQTT_KEEPALIVE=1200
    
    ## 2021-12-15
    ## REF https://devzone.nordicsemi.com/f/nordic-q-a/69077/nrf9160-aws_iot-sample-mqtt-topic-add-does-not-work/288602#288602
    ### CONFIG_MQTT_CLEAN_SESSION=y
    
    # Date Time library
    ### CONFIG_DATE_TIME=n                 # - DEV 0401 - was 'y'
    
    # Modem information
    ### CONFIG_MODEM_INFO=y                # - DEV 0401 - was 'y', MODEM_INFO depends on Kconfig NEWLIB_LIBC
    
    # Heap and stacks
    CONFIG_KERNEL_MEM_POOL=y               # 0411 added to match hello_world config
    CONFIG_HEAP_MEM_POOL_SIZE=8192
    ### CONFIG_MAIN_STACK_SIZE=4096
    ### CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # MCUBOOT
    ### CONFIG_BOOTLOADER_MCUBOOT=y
    ### CONFIG_MCUBOOT_IMG_MANAGER=y
    
    # Image manager
    ### CONFIG_IMG_MANAGER=n               # - DEV 0401 - was 'y'
    ### CONFIG_FLASH=n                     # - DEV 0401 - was 'y'
    ### CONFIG_IMG_ERASE_PROGRESSIVELY=n   # - DEV 0401 - was 'y'
    
    # AWS FOTA
    ### CONFIG_AWS_FOTA=n                  # - DEV 0401 - was 'y'
    ### CONFIG_FOTA_DOWNLOAD=n             # - DEV 0401 - was 'y'
    ### CONFIG_DFU_TARGET=n                # - DEV 0401 - was 'y'
    
    # CJSON
    ### CONFIG_CJSON_LIB=y
    
    # Download client (needed by AWS FOTA)
    ### CONFIG_DOWNLOAD_CLIENT=n           # - DEV 0401 - was 'y'
    ### CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    
    
    
    ## 2021-09-30 - driver-addition-work-001, git branch name - TMH
    ## Following Sensors section copied from Kionix out-of-tree driver project:
    # Sensors
    ### CONFIG_I2C=n                       # - DEV 0401 - was 'y'
    ### CONFIG_SENSOR=y                    # - DEV 0401 - setting to 'n' breaks #include "iis2dh_reg.h" - TMH
    ## CONFIG_KX132_1211=y  # 2021-10-28 Ted removing Kionix dependencies in branch 'stage1-v1-segger-base'.
    
    # STMicro accelerometers iis2dh and lis2dh:
    ### CONFIG_IIS2DH=y                    # - DEV 0401 - setting to 'n' breaks #include "iis2dh_reg.h" - TMH
    ### CONFIG_IIS2DH_RANGE=0
    # Select Output Data Rate of 100Hz for demo, values 0..9 defined in ST file iis2dh_reg.h
    ### CONFIG_IIS2DH_ODR=5
    
    # Note STMicro HAL/middle-level drivers (pair of files) for iis2dh located in:
    # [west_workspace]/modules/hal/st/sensor/stmemsc/iis2dh_STdC/driver
    
    ### CONFIG_LIS2DH=n                    # - DEV 0401 - was 'y'
    
    ## 2021-10-08 FRI - implementing timing tests for accelerometer measurements
    ### CONFIG_TIMING_FUNCTIONS=n          # - DEV 0401 - was 'y'
    
    ## 2021-10-30 - enable floating point output from printf() family functions
    ### CONFIG_CBPRINTF_FP_SUPPORT=y       # - DEV 0401 - was 'y'
    
    ## 2021-11-04 - work to enable CMSIS Digital Signal Processing math libraries:
    ## REF https://devzone.nordicsemi.com/f/nordic-q-a/51656/how-to-include-math-cmsis-dsp-library-in-nrf9160
    ### CONFIG_FPU=n                       # - DEV 0401 - was 'y'
    ### CONFIG_CMSIS_DSP=y
    ## Search of Kconfig symbols for this project, via `west build -t menuconfig` gives:
    #CONFIG_CMSIS_DSP_COMPLEXMATH=y      # <-- not sufficient for 'arm_rfft_fast_init_f32' and 'arm_rfft_fast_f32'
    #CONFIG_CMSIS_DSP_FASTMATH=y         # <-- not sufficient for 'arm_rfft_fast_init_f32' and 'arm_rfft_fast_f32'
    #CONFIG_CMSIS_DSP_TABLES_ALL_FAST=y  # <-- not sufficient for 'arm_rfft_fast_init_f32' and 'arm_rfft_fast_f32'
    ## REF https://github.com/zephyrproject-rtos/zephyr/issues/32206
    ### CONFIG_CMSIS_DSP_TRANSFORM=y
    
    # 2021-11-11 - Zephyr thread analyzer work:
    ### CONFIG_THREAD_ANALYZER=y
    ### CONFIG_THREAD_ANALYZER_USE_PRINTK=y
    ### CONFIG_THREAD_ANALYZER_AUTO=n
    ### CONFIG_THREAD_NAME=y
    #CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=10
    
    
    # 2022-03-21 -
    ### CONFIG_LOG_MODE_IMMEDIATE=n       # 0408 was 'y'
    ### CONFIG_DEBUG_THREAD_INFO=y
    ### CONFIG_THREAD_STACK_INFO=y
    
    
    # --- End of project dot conf file ---

    The leak current I mentioned reading about is different from the "known issues" page to which you share a link.  The Nordic Devzone engineer Heidi-Irene refers to this matter in Devzone ticket 59812, about seventeen replies (both developer's and Irene's) from the beginning of this ticket.  In that reply she writes:

    "Perhaps shutting down BSD lib was preventing one of the threads from going to sleep? I will have a closer look today.

    Side note: when you're measuring on the DK, VDD IO should be set to 3V to get 4uA as the floor current in PSM. It's a workaround for a current leak that occurs if VDD IO is in 1.8 V."

    There is another Devzone post I saw which refers to this leak current issue, in certain silicon releases of the nRF9160, and occurring when VDD_GPIO is less than VDD.  I don't have the post number or link to it handy.  I'll look further.

    You mention that logging needs to be disabled.  Does this include to disable CONFIG_RTT_CONSOLE?

    In a Devzone ticket I created about a month ago, another engineer on your team confirmed that when I measure 20uA or even 40uA I have successfully disabled UARTs and their associated high speed clocks.  In Power Profiler Kit II current waveforms I see a signal that's noisy but without any obvious periodic pattern.  The signal looks noisy, but when zooming way in all points fall between about 8uA and 50uA, averaging to 20uA.

    The mostly featureless, non-periodic current waveform I observe makes me suspect that the Power Profiler Kit is showing some type of leakage current in the SiP.  I suspect this as opposed to a thread starting up periodically, which I have seen how that appears in other tests I have run.  Current spikes appear when threads run.

    I suspect there is one or more parts of SiP hardware configuration which I have missed, or have configured incorrectly.  I hope the active Kconfig lines in my prj.conf file can offer an answer to what is drawing about 16uA above and beyond the 4uA that's possible with the nRF9160.

    - Ted

Children
Related