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

To identify, adjust sleep period of sample app threads?

Hello Devzone Community,

My name is Ted, and I am continuing my effort to configure a Zephyr based, Nordic aws_iot sample app based firmware to run and support nRF9160 lowest specified power consumption. I am in the process of putting all application threads to sleep, so that Zephyr's idle thread can put the application processor into a low power sleep mode. Nordic Power Profiler waveforms of measured current draw, however, indicate that I've failed in this. Some part of the overall firmware binary appears to be yet running. Lowest average current I achieve is ~190 microamps.

My Devzone account doesn't permit me to upload photos, but here is a link to two captures from Nordic's power profile which I took earlier today.  My apology that I must include an external link here and not the images directly:

wiki.neelanurseries.com/.../20220311

The first one shows a general pattern of current regularly spiking from a few microamps to around three milliamps.  The zoomed capture shows the ten millisecond spikes, a more distinct fast spike and a more blunted longer duration one.

These are taken during a 45 second period when all my application threads are sleeping -- for 45 seconds -- and LTE modem is turned off, and GPIOs to hardware enable points of our board are also turned off, effectively powering down the hardware outside the nRF9160.

From these waveforms I observe that some ARM processor activity appears to be consuming current every ten milliseconds. But though I have put my app threads into a nearly minute long sleep period, and have searched for the sleep periods set on aws_iot sample app threads, I cannot see any firmware configured device or service that is configured to run every ten milliseconds.

This work is based on Nordic's aws_iot sample app, as it appears in ncs v1.6.1. The sample app creates three or four Zephyr threads. Zephyr itself creates a  thread for `int main()` and an idle thread. Work of my own adds a few more threads at run time. These latest threads I can readily put to sleep for minutes or even hours, with a call to k_sleep() in a given thread's effective main function.

I have enabled Zephyr's thread_analyzer feature, and can observe simple reporting at run time of the threads of this firmware. Here is a typical Zephyr output I can see via a serial connection, and using a simple CLI to invoke a handful of commands:

Excerpt 1: Zephyr thread summary report

```1) 'thread_accelerometer' stack size 2048 bytes, stack used 960 bytes, 46%
2) 'thread_dev_work' stack size 3072 bytes, stack used 1504 bytes, 48%
3) 'thread_simple_cli' stack size 4096 bytes, stack used 1768 bytes, 43%
4) 'thread_led' stack size 512 bytes, stack used 136 bytes, 26%
5) 'download_client' stack size 4096 bytes, stack used 104 bytes, 2%
6) 'at_cmd_socket_thread' stack size 1472 bytes, stack used 688 bytes, 46%
7) 'time_thread' stack size 1024 bytes, stack used 728 bytes, 71%
8) 'connection_poll_thread' stack size 3072 bytes, stack used 296 bytes, 9%
9) '0x20015ab0' stack size 1024 bytes, stack used 168 bytes, 16%
10) 'sysworkq' stack size 2048 bytes, stack used 168 bytes, 8%
11) 'idle 00' stack size 320 bytes, stack used 56 bytes, 17%```


Here I modify the report to annotate each thread's origin, which affects how easily or not I can adjust a thread's sleep time:

Excerpt 2:

```1) 'thread_accelerometer' . . . home authored application
2) 'thread_dev_work' . . . home authored application
3) 'thread_simple_cli' . . . home authored application
4) 'thread_led' . . . home authored application
5) 'download_client' . . . aws_iot sample app
6) 'at_cmd_socket_thread' . . . aws_iot sample app
7) 'time_thread' . . . aws_iot sample app
8) 'connection_poll_thread' . . . aws_iot sample app
9) '0x20015ab0' . . . ?, not known
10) 'sysworkq' . . . Zephyr 2.6.0
11) 'idle 00' . . . Zephyr 2.6.0```


So far I have been able to track down in Zephyr's dwt.h library header file that the time thread has a default sleep period of 3600 seconds. Tracing thread 'at_cmd_socket_thread' which is implemented in ncs/nrf/subsys/net/lib/aws_iot/src/aws_iot.c I cannot tell what this thread's effective sleep period is.

Question (1): Can a Devzone team member or community member help me identify where this thread's sleep time is realized?

I have yet to find the implementation details for thread 'download_client', 'connection_poll_thread' and '0x20015ab0'. The last of these threads I have concern for. It is not named, and so I cannot be sure whether it is a Zephyr construct or a Nordic sample app construct. This unnamed thread has shown in the thread analyzer report since I enabled Zephyr's analyzer.


Question (2): is static code analysis the only way to learn "who" in the Zephyr and other source codes is creating the unnamed thread?

Until I can identify the unnamed thread, I won't know whether I can cleanly properly adjust its sleep period. If it is a kernel thread, my app space firmware won't automatically have privileges to make any changes to a kernel thread. I believe there are some extra steps to be able to do so, if that is even possible.

I recognize also that I cannot simply change sleep times of the aws_iot sample app threads, and expect celular level and MQTT client-broker connections to continue to function. I'll need to study and find a way to cleanly close connections before putting such threads to sleep.

Thanks ahead of time to all who can shed some light and help on these deep sleep and nRF9160 power saving questions!

- Ted

Parents
  • Hi Didrik,

    Thank you for the modified "hello_world" project.  For some reason I not able to compile this Nordic + Zephyr based application.  I am still using ncs SDK 1.6.1.  My various compiler tools are recent enough to pass the early tool version checks.  But I have never before seen the cyclic behavior I'm now getting as the build process parses all Kconfig dependencies. About every sixty six lines of build output the compiling appears to repeat itself.  I have never seen this kind of erroneous behavior in a `west` based build:

     

    ted@vibratsiya:~/projects/ncs/hello-world-1462$ west build -b nrf9160dk_nrf9160
    -- west build: generating a build system
    Including boilerplate (Zephyr base): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
    CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
      The OLD behavior for policy CMP0079 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Application: /home/ted/projects/ncs/hello-world-1462
    -- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
    -- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.10") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: /home/ted/.cache/zephyr
    -- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
    -- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Generated zephyr.dts: /home/ted/projects/ncs/hello-world-1462/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/device_extern.h
    Parsing /home/ted/projects/ncs/zephyr/Kconfig
    Loaded configuration '/home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
    Merged configuration '/home/ted/projects/ncs/hello-world-1462/prj.conf'
    Configuration saved to '/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config'
    Kconfig header saved to '/home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/autoconf.h'
    
    warning: UART_CONSOLE (defined at drivers/console/Kconfig:47) was assigned the value 'y' but got the
    value 'n'. Check these unsatisfied dependencies: SERIAL (=n), SERIAL_HAS_DRIVER (=n). See
    http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_UART_CONSOLE.html and/or look up
    UART_CONSOLE in the menuconfig/guiconfig interface. The Application Development Primer, Setting
    Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
    too.
    
    -- The C compiler identification is GNU 10.3.1
    -- The CXX compiler identification is GNU 10.3.1
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc
    CMake Deprecation Warning at /home/ted/projects/ncs/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- Configuring done
    CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/CMakeLists.txt:1198 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/CMakeLists.txt:1253 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Generating done
    -- Build files have been written to: /home/ted/projects/ncs/hello-world-1462/build
    -- west build: building application
    [0/1] Re-running CMake...
    Including boilerplate (Zephyr base (cached)): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
    CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
      The OLD behavior for policy CMP0079 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Application: /home/ted/projects/ncs/hello-world-1462
    -- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: /home/ted/.cache/zephyr
    -- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
    -- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Generated zephyr.dts: /home/ted/projects/ncs/hello-world-1462/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/device_extern.h
    Parsing /home/ted/projects/ncs/zephyr/Kconfig
    Loaded configuration '/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config'
    No change to configuration in '/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config'
    No change to Kconfig header in '/home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/autoconf.h'
    CMake Deprecation Warning at /home/ted/projects/zephyr-based-2/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- Configuring done
    CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/CMakeLists.txt:1198 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/CMakeLists.txt:1253 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Generating done
    -- Build files have been written to: /home/ted/projects/ncs/hello-world-1462/build
    [0/1] Re-running CMake...
    Including boilerplate (Zephyr base (cached)): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
    CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
      The OLD behavior for policy CMP0079 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Application: /home/ted/projects/ncs/hello-world-1462
    -- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: /home/ted/.cache/zephyr
    -- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
    -- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Generated zephyr.dts: /home/ted/projects/ncs/hello-world-1462/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/device_extern.h
    Parsing /home/ted/projects/ncs/zephyr/Kconfig
    Loaded configuration '/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config'
    No change to configuration in '/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config'
    No change to Kconfig header in '/home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/autoconf.h'
    CMake Deprecation Warning at /home/ted/projects/zephyr-based-2/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- Configuring done
    CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/CMakeLists.txt:1198 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/CMakeLists.txt:1253 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Generating done
    -- Build files have been written to: /home/ted/projects/ncs/hello-world-1462/build
    [0/1] Re-running CMake...
    Including boilerplate (Zephyr base (cached)): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
    CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
      The OLD behavior for policy CMP0079 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Application: /home/ted/projects/ncs/hello-world-1462
    -- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: /home/ted/.cache/zephyr
    -- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
    -- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Generated zephyr.dts: /home/ted/projects/ncs/hello-world-1462/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/device_extern.h
    Parsing /home/ted/projects/ncs/zephyr/Kconfig
    Loaded configuration '/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config'
    No change to configuration in '/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config'
    No change to Kconfig header in '/home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/autoconf.h'
    CMake Deprecation Warning at /home/ted/projects/zephyr-based-2/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- Configuring done
    CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/CMakeLists.txt:1198 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/CMakeLists.txt:1253 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Generating done
    -- Build files have been written to: /home/ted/projects/ncs/hello-world-1462/build
    [0/1] Re-running CMake...
    Including boilerplate (Zephyr base (cached)): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
    CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
      The OLD behavior for policy CMP0079 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.
    Call Stack (most recent call first):
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Application: /home/ted/projects/ncs/hello-world-1462
    -- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: /home/ted/.cache/zephyr
    -- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
    -- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    ^Cninja: error: rebuilding 'build.ninja': interrupted by user
    

    One thing I notice is that `cmake` never seems to progress beyond the zero'th of one steps:

    Dropping partition 'nrf_modem_lib_trace' since its size is 0.
    -- Configuring done
    CMake Warning (dev) at /home/ted/projects/zephyr-based/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/zephyr-based/zephyr/CMakeLists.txt:1198 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at /home/ted/projects/zephyr-based/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
      Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
      add_custom_command().  Run "cmake --help-policy CMP0116" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.
    Call Stack (most recent call first):
      /home/ted/projects/zephyr-based/zephyr/CMakeLists.txt:1253 (configure_linker_script)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Generating done
    -- Build files have been written to: /home/ted/projects/zephyr-based/hello-world-1462-de-didrik/build
    -- west build: building application
    [0/1] Re-running CMake...
    

    There are these triplet statements:

    - Configuring done

     . . .

    - Generating done

    [0/1] Re-running cmake...

    I am very interested to run your modified hello_world app on our nRF9160DK development board.  More than curious to see whether we measure a similar 3uA with this application.  But can you see any clue in above build process output which explains why `cmake` keeps repeating the first build steps?

    The first hello_world sample app you sent on 2022-03-11 builds and runs.  I will review prj.conf and related diffs between the two hello_world versions you prepared and shared with me.  Perhaps I can adapt the first one with the SPM child image and other diffs.  There should be only one or a few differences between the two code samples.

    Again thank you for all your help on this extended, multi-part question and issue!

    - Ted

  • tedhavelka said:
    I am very interested to run your modified hello_world app on our nRF9160DK development board.  More than curious to see whether we measure a similar 3uA with this application.  But can you see any clue in above build process output which explains why `cmake` keeps repeating the first build steps?

    That is very weird. However, looking at the project again, I see that I made it for NCS v1.9.1, not 1.6.1 which was my intention.

    Here is another version which hopefully works better: hello_world_low_power.zip

    Note that you must build it for nrf9160dk_nrf9160ns, as it enables the modem_lib.

    But in general, the changes are only disabling SERIAL, in both the SPM and the application, and enabling the modem_lib to stop the modem from consuming power unnecessary.

    tedhavelka said:
    Again thank you for all your help on this extended, multi-part question and issue!

    No problem. I am happy to be of help.

Reply
  • tedhavelka said:
    I am very interested to run your modified hello_world app on our nRF9160DK development board.  More than curious to see whether we measure a similar 3uA with this application.  But can you see any clue in above build process output which explains why `cmake` keeps repeating the first build steps?

    That is very weird. However, looking at the project again, I see that I made it for NCS v1.9.1, not 1.6.1 which was my intention.

    Here is another version which hopefully works better: hello_world_low_power.zip

    Note that you must build it for nrf9160dk_nrf9160ns, as it enables the modem_lib.

    But in general, the changes are only disabling SERIAL, in both the SPM and the application, and enabling the modem_lib to stop the modem from consuming power unnecessary.

    tedhavelka said:
    Again thank you for all your help on this extended, multi-part question and issue!

    No problem. I am happy to be of help.

Children
No Data
Related