Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
/tests/benchmarks/multicore/ @carlescufi @nrfconnect/ncs-low-level-test
/tests/benchmarks/multicore/idle/ @adamkondraciuk @nrfconnect/ncs-low-level-test
/tests/benchmarks/multicore/idle_gpio/ @adamkondraciuk @nrfconnect/ncs-low-level-test
/tests/benchmarks/multicore/idle_with_pwm/ @nrfconnect/ncs-low-level-test
/tests/bluetooth/tester/ @carlescufi @nrfconnect/ncs-paladin
/tests/bluetooth/iso/ @nrfconnect/ncs-audio @Frodevan
/tests/crypto/ @stephen-nordic @magnev
Expand Down

This file was deleted.

5 changes: 2 additions & 3 deletions tests/benchmarks/multicore/idle/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ tests:
remote_CONFIG_PM=y remote_CONFIG_POWEROFF=y remote_CONFIG_CONSOLE=n
remote_CONFIG_UART_CONSOLE=n remote_CONFIG_SERIAL=n remote_CONFIG_GPIO=n
remote_CONFIG_BOOT_BANNER=n remote_CONFIG_NRFS_MRAM_SERVICE_ENABLED=n
DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay"
harness: pytest
harness_config:
fixture: ppk_power_measure
Expand All @@ -98,7 +97,7 @@ tests:
remote_CONFIG_PM=y remote_CONFIG_POWEROFF=y remote_CONFIG_CONSOLE=n
remote_CONFIG_UART_CONSOLE=n remote_CONFIG_SERIAL=n remote_CONFIG_GPIO=n
remote_CONFIG_BOOT_BANNER=n remote_CONFIG_NRFS_MRAM_SERVICE_ENABLED=n
DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay;boards/nrf54h20dk_nrf54h20_cpuapp_ram_high_usage.overlay"
DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_ram_high_usage.overlay"
harness: pytest
harness_config:
fixture: ppk_power_measure
Expand All @@ -120,7 +119,7 @@ tests:
remote_CONFIG_PM=y remote_CONFIG_POWEROFF=y remote_CONFIG_CONSOLE=n
remote_CONFIG_UART_CONSOLE=n remote_CONFIG_SERIAL=n remote_CONFIG_GPIO=n
remote_CONFIG_BOOT_BANNER=n remote_CONFIG_NRFS_MRAM_SERVICE_ENABLED=n
DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay;boards/nrf54h20dk_nrf54h20_cpuapp_ram_low_usage.overlay"
DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_ram_low_usage.overlay"
harness: pytest
harness_config:
fixture: ppk_power_measure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,13 @@
*/

/ {
power-states {
idle: idle {
compatible = "zephyr,power-state";
power-state-name = "suspend-to-idle";
min-residency-us = <100000>;
};

s2ram: s2ram {
compatible = "zephyr,power-state";
power-state-name = "suspend-to-ram";
min-residency-us = <800000>;
};
};
aliases {
/delete-property/ sw1;
};
};

/delete-node/ &button1;

&cpu {
cpu-power-states = <&idle &s2ram>;
};

&gpiote130 {
status = "okay";
owned-channels = <0>;
Expand Down

This file was deleted.

This file was deleted.

3 changes: 2 additions & 1 deletion tests/benchmarks/multicore/idle_spim/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ tests:
harness: pytest
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
extra_args:
- SHIELD=pca63566
- FILE_SUFFIX=s2ram
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf
- DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay"
harness_config:
fixture: ppk_power_measure
pytest_root:
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion tests/benchmarks/multicore/idle_twim/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ tests:
harness: pytest
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
extra_args:
- SHIELD=pca63566
- FILE_SUFFIX=s2ram
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf
- DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay"
harness_config:
fixture: ppk_power_measure
pytest_root:
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion tests/benchmarks/multicore/idle_uarte/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ tests:
harness: pytest
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
extra_args:
- FILE_SUFFIX=s2ram
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf
- DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay"
harness_config:
fixture: ppk_power_measure
pytest_root:
Expand Down
19 changes: 19 additions & 0 deletions tests/benchmarks/multicore/idle_with_pwm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

if(NOT SYSBUILD)
message(FATAL_ERROR
" This is a multi-image application that should be built using sysbuild.\n"
" Add --sysbuild argument to west build command to prepare all the images.")
endif()

project(idle_with_pwm)

target_sources(app PRIVATE src/main.c)
15 changes: 15 additions & 0 deletions tests/benchmarks/multicore/idle_with_pwm/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config TEST_SLEEP_DURATION_MS
int "Amount of time (in miliseconds) the core is sleeping"
default 1000
help
Set sleep duration to TEST_SLEEP_DURATION_MS miliseconds.
Based on the value of 'min-residency-us' specified for each power state defined in the DTS,
core enters the lowest possible power state.

source "Kconfig.zephyr"
10 changes: 10 additions & 0 deletions tests/benchmarks/multicore/idle_with_pwm/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"

config REMOTE_BOARD
string "The board used for remote target"
76 changes: 76 additions & 0 deletions tests/benchmarks/multicore/idle_with_pwm/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.. _multicore_idle_with_pwm_test:

PWM in low power states test
############################

.. contents::
:local:
:depth: 2

This test benchmarks the idle behavior of an application that runs on multiple cores and uses the PWM driver to light up a LED.

The test scenario repeats forever the following:

* Gradually increase PWM duty cycle from 0% to 50% for one second (the LED lights up), power state active.
* Set PWM duty cycle to 0% for one second (PWM disabled, the LED is OFF), power state low.

Requirements
************

The test supports the following development kit:

.. table-from-rows:: /includes/sample_board_rows.txt
:header: heading
:rows: nrf54h20dk_nrf54h20_cpuapp

Overview
********

The test demonstrates the use of PWM with low power modes.

The code stored in the :file:`main.c` file is compiled for both application and radio cores.
The application core uses pwm130 to generate PWM signal on **LED2**.
The radio core uses pwm131 to generate PWM signal on GPIO port 0, pin 7.

There are three test configurations in the :file:`testcase.yaml`.

* ``benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.s2ram``

This configuration uses Kconfigs that enable entering low power modes.
Logging is disabled.
Core sleeps for time sufficient to enter the ``suspend-to-ram`` power state.

* ``benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.sleep``

This configuration uses Kconfigs that enable entering low power modes.
Logging is disabled.
Core sleeps for time sufficient to enter the ``suspend-to-idle`` power state.

* ``benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.no_sleep``

You can use this configuration for debug purposes.
Logging is enabled while power mode is disabled.

Building and running
********************

.. |test path| replace:: :file:`tests/benchmarks/multicore/idle_with_pwm`

.. include:: /includes/build_and_run_test.txt

To build the test, use configuration setups from the :file:`testcase.yaml` file using the ``-T`` option.
See the example:

.. code-block:: console

west build -p -b nrf54h20dk/nrf54h20/cpuapp -T benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.s2ram .

Testing
=======

After programming the test to your development kit, complete the following steps to test it:

1. Connect the PPK2 Power Profiler Kit or other current measurement device.
#. Reset the kit.
#. Observe the **LED2** brightness (or use oscilloscope to collect the PWM signal on port 0, pin 7).
#. When the **LED2** is off, the power profiler indicates low current consumption resulting from both cores being in low power mode.
3 changes: 3 additions & 0 deletions tests/benchmarks/multicore/idle_with_pwm/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_PRINTK=y
CONFIG_LOG=y
CONFIG_PWM=y
15 changes: 15 additions & 0 deletions tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CONFIG_PM=y
CONFIG_PM_S2RAM=y
CONFIG_POWEROFF=y
CONFIG_PM_S2RAM_CUSTOM_MARKING=y

CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_BOOT_BANNER=n
CONFIG_NRFS_MRAM_SERVICE_ENABLED=n

CONFIG_PWM=y
12 changes: 12 additions & 0 deletions tests/benchmarks/multicore/idle_with_pwm/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(remote)

target_sources(app PRIVATE ../src/main.c)
Loading
Loading