Experienced high power consumption with both CONFIG_PM_DEVICE and CONFIG_NRF_SW_LPUART enabled

Hello everyone,

I am experiencing excessive power consumption in a project based on the nRF9151 processor, developed using nRF Connect SDK 2.9.0.

My project uses two UART interfaces:

uart0 – used for the console. It is suspended and resumed using the pm_device_action_run() function (with CONFIG_PM_DEVICE=y enabled):

pm_device_action_run(console, PM_DEVICE_ACTION_SUSPEND);  // suspend
pm_device_action_run(console, PM_DEVICE_ACTION_RESUME);   // resume

uart2 – configured as LPUART (with CONFIG_NRF_SW_LPUART=y enabled), communicating with a Bluetooth module.

With both configurations enabled, I measure a current consumption of approximately 30 µA, while I would expect something closer to 8 µA.

My test

To further investigate the issue, I built and ran the LPUART sample on the nRF9151DK development board.
I created the files nrf9151dk_nrf9151_ns.overlay and nrf9151dk_nrf9151_ns.conf, adapting them from the nRF9160 versions.

I shorted RX and TX (pins 10 and 11), and REQ and RDY (pins 12 and 13 in my configuration), as suggested in the sample documentation.

Everything works correctly. The current consumption is extremely low (around 1 µA avarage current) between communication intervals. See image attached

At this point, I simply added CONFIG_PM_DEVICE=y to prj.conf, and the current consumption immediately increased to more than 22 µA.

My conclusion is that there may be some incompatibility between CONFIG_NRF_SW_LPUART and CONFIG_PM_DEVICE. Can you confirm it?

Here is my lpuart sample test project:

lpuart.zip

I would like to keep the LPUART communication active while also being able to suspend the console when the device needs to enter low-power mode.

How can I achieve this?

Thank you 

Luca

Parents
  • Hello Luca,

    I have run your sample on NCS v3.2.2 and I got almost same current by setting and unsetting the CONFIG_PM_DEVICE

    config_pm_device=y

    config_pm_device=n

  • Hi Kazi,

    It's so strange. I'm repeating the same test again and again, but my result is the same. With CONFIG_PM_DEVICE=y, I see a current consumption of about 23 uA. Are you sure you did a pristine buld after changing CONFIG_PM_DEVICE to y?

    Maybe there is something is different at compile time. I attach my log with west command line:

     *  Executing task: nRF Connect: Generate config nrf9151dk/nrf9151/ns for c:\work\nordic\nRF9151\lpuart.3.2.2 
    
    Building lpuart.3.2.2
    west build --build-dir c:/work/nordic/nRF9151/lpuart.3.2.2/build c:/work/nordic/nRF9151/lpuart.3.2.2 --pristine --board nrf9151dk/nrf9151/ns --sysbuild -- -DCONFIG_SIZE_OPTIMIZATIONS=y -DEXTRA_CONF_FILE=boards/nrf9151dk_nrf9151_ns.conf -DEXTRA_DTC_OVERLAY_FILE=boards/nrf9151dk_nrf9151_ns.overlay
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/c717907b94/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.2.2/zephyr/.cache
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf9151dk, qualifiers: nrf9151/ns
    Parsing C:/ncs/v3.2.2/zephyr/share/sysbuild/Kconfig
    Loaded configuration 'C:/work/nordic/nRF9151/lpuart.3.2.2/build/_sysbuild/empty.conf'
    Merged configuration 'C:/work/nordic/nRF9151/lpuart.3.2.2/build/_sysbuild/empty.conf'
    Configuration saved to 'C:/work/nordic/nRF9151/lpuart.3.2.2/build/zephyr/.config'
    Kconfig header saved to 'C:/work/nordic/nRF9151/lpuart.3.2.2/build/_sysbuild/autoconf.h'
    -- 
       **********************************
       * Running CMake for lpuart.3.2.2 *
       **********************************
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/work/nordic/nRF9151/lpuart.3.2.2
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/c717907b94/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.2.2/zephyr/.cache
    -- Zephyr version: 4.2.99 (C:/ncs/v3.2.2/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf9151dk, qualifiers: nrf9151/ns
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/c717907b94/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/c717907b94/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/c717907b94/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v3.2.2/zephyr/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns.dts
    -- Found devicetree overlay: C:/work/nordic/nRF9151/lpuart.3.2.2/boards/nrf9151dk_nrf9151_ns.overlay
    -- Found devicetree overlay: boards/nrf9151dk_nrf9151_ns.overlay
    -- Generated zephyr.dts: C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/zephyr/zephyr.dts
    -- Generated pickled edt: C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/zephyr/edt.pickle
    -- Generated devicetree_generated.h: C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing C:/ncs/v3.2.2/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v3.2.2/zephyr/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns_defconfig'
    Merged configuration 'C:/work/nordic/nRF9151/lpuart.3.2.2/prj.conf'
    Merged configuration 'C:/work/nordic/nRF9151/lpuart.3.2.2/boards/nrf9151dk_nrf9151_ns.conf'
    Merged configuration 'C:/work/nordic/nRF9151/lpuart.3.2.2/boards/nrf9151dk_nrf9151_ns.conf'
    Merged configuration 'C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration 'C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/zephyr/.config.sysbuild'
    Configuration saved to 'C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/zephyr/.config'
    Kconfig header saved to 'C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/c717907b94/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/c717907b94/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Found gen_kobject_list: C:/ncs/v3.2.2/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2
    Dropping partition 'nrf_modem_lib_trace' since its size is 0.
    Dropping partition 'nonsecure_storage' since it is empty.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/work/nordic/nRF9151/lpuart.3.2.2/build
    -- west build: building application
    [4/269] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.2.99 (C:/ncs/v3.2.2/zephyr), build: ncs-v3.2.2
    [10/269] Generating ../../tfm/CMakeCache.txt
    -- Found Git: C:/ncs/toolchains/c717907b94/mingw64/bin/git.exe (found version "2.52.0.windows.1") 
    CMake Warning at CMakeLists.txt:43 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.
    
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/c717907b94/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Found Python3: C:/ncs/toolchains/c717907b94/opt/bin/python.exe (found version "3.12.4") found components: Interpreter 
    -- Found Python3: C:/ncs/toolchains/c717907b94/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.2.2/zephyr/.cache
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/tfm
    [147/151] Linking C executable bin\tfm_s.axf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       32216 B        32 KB     98.32%
                 RAM:       10432 B        32 KB     31.84%
    [17/269] Performing install step for 'tfm'
    -- Install configuration: "MinSizeRel"
    ----- Installing platform NS -----
    [269/269] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       48404 B       992 KB      4.77%
                 RAM:       14288 B     211608 B      6.75%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from C:/work/nordic/nRF9151/lpuart.3.2.2/build/lpuart.3.2.2/zephyr/zephyr.elf for board: nrf9151dk
    [10/10] Generating ../merged.hex

    I also atach the prj.conf file I use. The only difference from the previous attached file lpuart.3.2.2.zip is the CONFIG_PM_DEVICE=y

    # Copyright (c) 2020 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NRF_SW_LPUART=y
    CONFIG_SERIAL=y
    CONFIG_LOG=n
    
    # Sample is showing low power capabilities of low power uart module thus
    # console/logging uart is disabled.
    
    CONFIG_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    
    CONFIG_LOG=n
    CONFIG_GPIO=y
    CONFIG_NRF_MODEM_LIB=y
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_POWEROFF=y
    
    CONFIG_PM_DEVICE=y

    Thank you Kazi,

    I hope it will help replicate the problem.

    Luca

  • Just a guess:

    The lpuart uses a GPIO in interrupt edge mode.

    That causes some more current, if not masked to emulate the edge mode with

    &gpio0 {
        sense-edge-mask = <0xffff>;
    };

    maybe that helps.

    (But also maybe, the lpuart doesn't work with that ;-) ). 

  • Hi Achim,

    yes, I had already considered that it could be a sense-edge-mask issue. I also tried adding the directive to the device tree, but it didn’t change the result.
    I also found a post in an old thread saying that the sense-edge-mask is automatically applied to the pins used by the lpuart.

     RE: Power consumption about LPUART 

    Luca

Reply Children
No Data
Related