From 8d5df130d9303f148b8ff6119152f9d0f0e4fb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 18 Sep 2024 15:43:45 +0200 Subject: [PATCH 1/4] tests: benchmark: multicore: Test PWM with low power modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add test that confirms correct operation of PWM when target enters and leaves low power mode. Signed-off-by: Sebastian Głąb --- CODEOWNERS | 1 + .../multicore/idle_with_pwm/CMakeLists.txt | 19 ++++ .../multicore/idle_with_pwm/Kconfig | 15 +++ .../multicore/idle_with_pwm/Kconfig.sysbuild | 10 ++ .../multicore/idle_with_pwm/README.rst | 76 +++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 25 +++++ .../multicore/idle_with_pwm/prj.conf | 3 + .../multicore/idle_with_pwm/prj_s2ram.conf | 15 +++ .../idle_with_pwm/remote/CMakeLists.txt | 12 +++ .../multicore/idle_with_pwm/remote/Kconfig | 15 +++ .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 41 ++++++++ .../multicore/idle_with_pwm/remote/prj.conf | 3 + .../idle_with_pwm/remote/prj_s2ram.conf | 10 ++ .../multicore/idle_with_pwm/src/main.c | 97 +++++++++++++++++++ .../multicore/idle_with_pwm/sysbuild.cmake | 22 +++++ .../sysbuild/nrf54h20dk_nrf54h20_cpurad.conf | 1 + .../multicore/idle_with_pwm/testcase.yaml | 46 +++++++++ 17 files changed, 411 insertions(+) create mode 100644 tests/benchmarks/multicore/idle_with_pwm/CMakeLists.txt create mode 100644 tests/benchmarks/multicore/idle_with_pwm/Kconfig create mode 100644 tests/benchmarks/multicore/idle_with_pwm/Kconfig.sysbuild create mode 100644 tests/benchmarks/multicore/idle_with_pwm/README.rst create mode 100644 tests/benchmarks/multicore/idle_with_pwm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay create mode 100644 tests/benchmarks/multicore/idle_with_pwm/prj.conf create mode 100644 tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf create mode 100644 tests/benchmarks/multicore/idle_with_pwm/remote/CMakeLists.txt create mode 100644 tests/benchmarks/multicore/idle_with_pwm/remote/Kconfig create mode 100644 tests/benchmarks/multicore/idle_with_pwm/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay create mode 100644 tests/benchmarks/multicore/idle_with_pwm/remote/prj.conf create mode 100644 tests/benchmarks/multicore/idle_with_pwm/remote/prj_s2ram.conf create mode 100644 tests/benchmarks/multicore/idle_with_pwm/src/main.c create mode 100644 tests/benchmarks/multicore/idle_with_pwm/sysbuild.cmake create mode 100644 tests/benchmarks/multicore/idle_with_pwm/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/benchmarks/multicore/idle_with_pwm/testcase.yaml diff --git a/CODEOWNERS b/CODEOWNERS index fe66f6422a01..fbbdd4df957b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -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 diff --git a/tests/benchmarks/multicore/idle_with_pwm/CMakeLists.txt b/tests/benchmarks/multicore/idle_with_pwm/CMakeLists.txt new file mode 100644 index 000000000000..cde55c996f81 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/CMakeLists.txt @@ -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) diff --git a/tests/benchmarks/multicore/idle_with_pwm/Kconfig b/tests/benchmarks/multicore/idle_with_pwm/Kconfig new file mode 100644 index 000000000000..a63b31a208e4 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/Kconfig @@ -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" diff --git a/tests/benchmarks/multicore/idle_with_pwm/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_with_pwm/Kconfig.sysbuild new file mode 100644 index 000000000000..0898eb292938 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/Kconfig.sysbuild @@ -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" diff --git a/tests/benchmarks/multicore/idle_with_pwm/README.rst b/tests/benchmarks/multicore/idle_with_pwm/README.rst new file mode 100644 index 000000000000..9fe1d12c9bdf --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/README.rst @@ -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. diff --git a/tests/benchmarks/multicore/idle_with_pwm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/multicore/idle_with_pwm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..a1e708928fc2 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + 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>; + }; + }; +}; + +&cpu { + cpu-power-states = <&idle &s2ram>; +}; diff --git a/tests/benchmarks/multicore/idle_with_pwm/prj.conf b/tests/benchmarks/multicore/idle_with_pwm/prj.conf new file mode 100644 index 000000000000..bbe2b1d251b5 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/prj.conf @@ -0,0 +1,3 @@ +CONFIG_PRINTK=y +CONFIG_LOG=y +CONFIG_PWM=y diff --git a/tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf b/tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf new file mode 100644 index 000000000000..a1e7eba93d69 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf @@ -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 diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/CMakeLists.txt b/tests/benchmarks/multicore/idle_with_pwm/remote/CMakeLists.txt new file mode 100644 index 000000000000..3f79e49afb26 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/CMakeLists.txt @@ -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) diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/Kconfig b/tests/benchmarks/multicore/idle_with_pwm/remote/Kconfig new file mode 100644 index 000000000000..a63b31a208e4 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/Kconfig @@ -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" diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/benchmarks/multicore/idle_with_pwm/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..5fcd71d3a39c --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + aliases { + pwm-led0 = &pwm_gpio; + }; + + pwmleds { + compatible = "pwm-leds"; + pwm_gpio: pwm_gpio { + pwms = <&pwm131 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; +}; + +&pinctrl { + /omit-if-no-ref/ pwm131_default: pwm131_default { + group1 { + psels = ; + }; + }; + + /omit-if-no-ref/ pwm131_sleep: pwm131_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&pwm131 { + status = "okay"; + pinctrl-0 = <&pwm131_default>; + pinctrl-1 = <&pwm131_sleep>; + pinctrl-names = "default", "sleep"; + memory-regions = <&cpurad_dma_region>; +}; diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/prj.conf b/tests/benchmarks/multicore/idle_with_pwm/remote/prj.conf new file mode 100644 index 000000000000..bbe2b1d251b5 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/prj.conf @@ -0,0 +1,3 @@ +CONFIG_PRINTK=y +CONFIG_LOG=y +CONFIG_PWM=y diff --git a/tests/benchmarks/multicore/idle_with_pwm/remote/prj_s2ram.conf b/tests/benchmarks/multicore/idle_with_pwm/remote/prj_s2ram.conf new file mode 100644 index 000000000000..0345ed9c78e1 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/remote/prj_s2ram.conf @@ -0,0 +1,10 @@ +CONFIG_PM=y +CONFIG_POWEROFF=y + +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_BOOT_BANNER=n +CONFIG_NRFS_MRAM_SERVICE_ENABLED=n + +CONFIG_PWM=y diff --git a/tests/benchmarks/multicore/idle_with_pwm/src/main.c b/tests/benchmarks/multicore/idle_with_pwm/src/main.c new file mode 100644 index 000000000000..b3cec7e323c9 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/src/main.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +LOG_MODULE_REGISTER(idle_with_pwm, LOG_LEVEL_INF); + +#include +#include +#include + +#if IS_ENABLED(CONFIG_SOC_NRF54H20_CPUAPP) +/* Alias pwm-led0 = &pwm_led2 */ +static const struct pwm_dt_spec pwm_led = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0)); +#elif IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD) +/* Alias pwm-led0 = &pwm_led3 */ +static const struct pwm_dt_spec pwm_led = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0)); +#else +#error "Invalid core selected." +#endif + +#define PWM_STEPS_PER_SEC (50) + +int main(void) +{ + int ret; + unsigned int cnt = 0; + uint32_t pwm_period; + uint32_t pulse_min; + uint32_t pulse_max; + int32_t pulse_step; + uint32_t current_pulse_width; + + if (!pwm_is_ready_dt(&pwm_led)) { + LOG_ERR("Device %s is not ready.", pwm_led.dev->name); + return -ENODEV; + } + + /* + * In case the default pwm_period value cannot be set for + * some PWM hardware, decrease its value until it can. + */ + pwm_period = PWM_USEC(200U); + LOG_INF("Testing PWM period of %d us for channel %d", + pwm_period, pwm_led.channel); + while (pwm_set_dt(&pwm_led, pwm_period, pwm_period) != 0) { + pwm_period /= 2U; + LOG_INF("Decreasing period to %u", pwm_period); + } + + /* + * There is no distinct change in LED brightness for high PWM duty cycles. + * Thus limit duty cycle to [0; max/2]. + */ + pulse_min = 0; + pulse_max = pwm_period / 2; + pulse_step = (pulse_max - pulse_min) / PWM_STEPS_PER_SEC; + LOG_DBG("Period is %u nsec", pwm_period); + LOG_DBG("PWM pulse width varies from %u to %u with %u step", + pulse_min, pulse_max, pulse_step); + + LOG_INF("Multicore idle_with_pwm test on %s", CONFIG_BOARD_TARGET); + LOG_INF("Core will sleep for %d ms", CONFIG_TEST_SLEEP_DURATION_MS); + + while (1) { + LOG_INF("Multicore idle_with_pwm test iteration %u", cnt++); + + /* Light up LED */ + current_pulse_width = pulse_min; + for (int i = 0; i < PWM_STEPS_PER_SEC; i++) { + /* set pulse width */ + ret = pwm_set_dt(&pwm_led, pwm_period, current_pulse_width); + if (ret) { + LOG_ERR("pwm_set_dt(%u, %u) returned %d", + pwm_period, current_pulse_width, ret); + return ret; + } + current_pulse_width += pulse_step; + k_msleep(1000 / PWM_STEPS_PER_SEC); + } + + /* Disable PWM / LED OFF */ + ret = pwm_set_dt(&pwm_led, 0, 0); + if (ret) { + LOG_ERR("pwm_set_dt(%u, %u) returned %d", + 0, 0, ret); + return ret; + } + + /* Sleep 1 second */ + k_msleep(CONFIG_TEST_SLEEP_DURATION_MS); + } + + return 0; +} diff --git a/tests/benchmarks/multicore/idle_with_pwm/sysbuild.cmake b/tests/benchmarks/multicore/idle_with_pwm/sysbuild.cmake new file mode 100644 index 000000000000..7af563e1ccc6 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/sysbuild.cmake @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "") + message(FATAL_ERROR "REMOTE_BOARD must be set to a valid board name") +endif() + +# Add remote project +ExternalZephyrProject_Add( + APPLICATION remote + SOURCE_DIR ${APP_DIR}/remote + BOARD ${SB_CONFIG_REMOTE_BOARD} + BOARD_REVISION ${BOARD_REVISION} + ) + +# Add a dependency so that the remote image will be built and flashed first +add_dependencies(idle_with_pwm remote) +# Add dependency so that the remote image is flashed first. +sysbuild_add_dependencies(FLASH idle_with_pwm remote) diff --git a/tests/benchmarks/multicore/idle_with_pwm/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/tests/benchmarks/multicore/idle_with_pwm/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..dd863e78d993 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/tests/benchmarks/multicore/idle_with_pwm/testcase.yaml b/tests/benchmarks/multicore/idle_with_pwm/testcase.yaml new file mode 100644 index 000000000000..62af8ca65501 --- /dev/null +++ b/tests/benchmarks/multicore/idle_with_pwm/testcase.yaml @@ -0,0 +1,46 @@ +common: + sysbuild: true + tags: ci_build ci_tests_benchmarks_multicore + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + +tests: + benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.no_sleep: + extra_args: + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "Multicore idle_with_pwm test on" + - "Multicore idle_with_pwm test iteration 0" + - "Multicore idle_with_pwm test iteration 1" + + benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.idle: + tags: ppk_power_measure + extra_args: + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + idle_with_pwm_CONF_FILE=prj_s2ram.conf + remote_CONF_FILE=prj_s2ram.conf + idle_with_pwm_CONFIG_TEST_SLEEP_DURATION_MS=500 + remote_CONFIG_TEST_SLEEP_DURATION_MS=500 + harness: pytest + harness_config: + fixture: ppk_power_measure + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" + + benchmarks.multicore.idle_with_pwm.nrf54h20dk_cpuapp_cpurad.s2ram: + tags: ppk_power_measure + extra_args: + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + idle_with_pwm_CONF_FILE=prj_s2ram.conf + remote_CONF_FILE=prj_s2ram.conf + harness: pytest + harness_config: + fixture: ppk_power_measure + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" From f44f5cd33e4fff5fdbb00acb2ab2e60af7b1c8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 27 Sep 2024 12:07:18 +0200 Subject: [PATCH 2/4] tests: multicore: Use power states definition from SOC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of defining power states per test, add power states to the nrf54h20/cpuapp target definition. Remove power states from tests overlays to prevent build failures due to duplicated node definitions. Signed-off-by: Sebastian Głąb --- .../nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay | 25 ----------------- tests/benchmarks/multicore/idle/testcase.yaml | 5 ++-- .../nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay | 17 ------------ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 25 ----------------- .../nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay | 25 ----------------- .../multicore/idle_spim/testcase.yaml | 1 - .../nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay | 25 ----------------- .../multicore/idle_twim/testcase.yaml | 1 - ...tsi => nrf54h20dk_nrf54h20_cpuapp.overlay} | 0 .../nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay | 27 ------------------- .../multicore/idle_uarte/testcase.yaml | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 25 ----------------- west.yml | 2 +- 13 files changed, 3 insertions(+), 176 deletions(-) delete mode 100644 tests/benchmarks/multicore/idle/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay delete mode 100644 tests/benchmarks/multicore/idle_outside_of_main/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 tests/benchmarks/multicore/idle_spim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay delete mode 100644 tests/benchmarks/multicore/idle_twim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay rename tests/benchmarks/multicore/idle_uarte/boards/{nrf54h20dk_nrf54h20_common.dtsi => nrf54h20dk_nrf54h20_cpuapp.overlay} (100%) delete mode 100644 tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay delete mode 100644 tests/benchmarks/multicore/idle_with_pwm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/benchmarks/multicore/idle/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay deleted file mode 100644 index c9b5aee2aa93..000000000000 --- a/tests/benchmarks/multicore/idle/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - 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>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle/testcase.yaml b/tests/benchmarks/multicore/idle/testcase.yaml index 6568c6c69b3b..d7396e436c41 100644 --- a/tests/benchmarks/multicore/idle/testcase.yaml +++ b/tests/benchmarks/multicore/idle/testcase.yaml @@ -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 @@ -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 @@ -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 diff --git a/tests/benchmarks/multicore/idle_gpio/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle_gpio/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay index 05e508acb880..1255cbde1eff 100644 --- a/tests/benchmarks/multicore/idle_gpio/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ b/tests/benchmarks/multicore/idle_gpio/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay @@ -5,19 +5,6 @@ */ / { - 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; }; @@ -25,10 +12,6 @@ /delete-node/ &button1; -&cpu { - cpu-power-states = <&idle &s2ram>; -}; - &gpiote130 { status = "okay"; owned-channels = <0>; diff --git a/tests/benchmarks/multicore/idle_outside_of_main/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/multicore/idle_outside_of_main/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 8251081a067b..000000000000 --- a/tests/benchmarks/multicore/idle_outside_of_main/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - / { - 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>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle_spim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle_spim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay deleted file mode 100644 index 8251081a067b..000000000000 --- a/tests/benchmarks/multicore/idle_spim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - / { - 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>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle_spim/testcase.yaml b/tests/benchmarks/multicore/idle_spim/testcase.yaml index 067f1196fb9c..e632e73d95d8 100644 --- a/tests/benchmarks/multicore/idle_spim/testcase.yaml +++ b/tests/benchmarks/multicore/idle_spim/testcase.yaml @@ -12,7 +12,6 @@ tests: - 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: diff --git a/tests/benchmarks/multicore/idle_twim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle_twim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay deleted file mode 100644 index a1e708928fc2..000000000000 --- a/tests/benchmarks/multicore/idle_twim/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - 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>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle_twim/testcase.yaml b/tests/benchmarks/multicore/idle_twim/testcase.yaml index 1620423e0e34..b57dbf0dbbff 100644 --- a/tests/benchmarks/multicore/idle_twim/testcase.yaml +++ b/tests/benchmarks/multicore/idle_twim/testcase.yaml @@ -12,7 +12,6 @@ tests: - 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: diff --git a/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp.overlay similarity index 100% rename from tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_common.dtsi rename to tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay b/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay deleted file mode 100644 index e2220569808e..000000000000 --- a/tests/benchmarks/multicore/idle_uarte/boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" - - / { - 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>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/tests/benchmarks/multicore/idle_uarte/testcase.yaml b/tests/benchmarks/multicore/idle_uarte/testcase.yaml index 9597ae08a210..5cb2cda74540 100644 --- a/tests/benchmarks/multicore/idle_uarte/testcase.yaml +++ b/tests/benchmarks/multicore/idle_uarte/testcase.yaml @@ -11,7 +11,6 @@ tests: 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: diff --git a/tests/benchmarks/multicore/idle_with_pwm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/multicore/idle_with_pwm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index a1e708928fc2..000000000000 --- a/tests/benchmarks/multicore/idle_with_pwm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - 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>; - }; - }; -}; - -&cpu { - cpu-power-states = <&idle &s2ram>; -}; diff --git a/west.yml b/west.yml index b8d40941e860..992878931f1b 100644 --- a/west.yml +++ b/west.yml @@ -72,7 +72,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: ea7e265dadf63ab2def0813378f20f2da793877e + revision: b83478a230e79d24d69592274f2a93c9c83958a9 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above From c5226b682ba9dd4cca72973acb37d81a8a0b6ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 2 Oct 2024 12:32:59 +0200 Subject: [PATCH 3/4] tests: benchmarks: multicore: Add missing integration platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing entry integration_platforms in testcase.yaml in: /tests/benchamrks/multicore/idle_spim, /tests/benchamrks/multicore/idle_twim, /tests/benchamrks/multicore/idle_uarte. Set value to nrf54h20dk/nrf54h20/cpuapp in all three tests. Signed-off-by: Sebastian Głąb --- tests/benchmarks/multicore/idle_spim/testcase.yaml | 2 ++ tests/benchmarks/multicore/idle_twim/testcase.yaml | 2 ++ tests/benchmarks/multicore/idle_uarte/testcase.yaml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tests/benchmarks/multicore/idle_spim/testcase.yaml b/tests/benchmarks/multicore/idle_spim/testcase.yaml index e632e73d95d8..6ec83b414450 100644 --- a/tests/benchmarks/multicore/idle_spim/testcase.yaml +++ b/tests/benchmarks/multicore/idle_spim/testcase.yaml @@ -8,6 +8,8 @@ tests: harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SHIELD=pca63566 - FILE_SUFFIX=s2ram diff --git a/tests/benchmarks/multicore/idle_twim/testcase.yaml b/tests/benchmarks/multicore/idle_twim/testcase.yaml index b57dbf0dbbff..aca1bc12dba6 100644 --- a/tests/benchmarks/multicore/idle_twim/testcase.yaml +++ b/tests/benchmarks/multicore/idle_twim/testcase.yaml @@ -8,6 +8,8 @@ tests: harness: pytest platform_allow: - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SHIELD=pca63566 - FILE_SUFFIX=s2ram diff --git a/tests/benchmarks/multicore/idle_uarte/testcase.yaml b/tests/benchmarks/multicore/idle_uarte/testcase.yaml index 5cb2cda74540..ca4cc7a0e71b 100644 --- a/tests/benchmarks/multicore/idle_uarte/testcase.yaml +++ b/tests/benchmarks/multicore/idle_uarte/testcase.yaml @@ -8,6 +8,8 @@ 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 From bf1942906eef14f2a69d7244a9ece4dbd1c79892 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 8 Oct 2024 16:24:13 +0200 Subject: [PATCH 4/4] tests: benchmarks: power_consumption: Use power states def from SOC Remove power states from tests overlays to prevent build failures due to duplicated node definitions. Signed-off-by: Robert Lubos --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index ddd53862fae2..c3217b9969f9 100644 --- a/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/benchmarks/power_consumption/gpio/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,18 +1,4 @@ / { - 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 { out0 = &output0; in0 = &input0; @@ -36,7 +22,3 @@ }; }; }; - -&cpu { - cpu-power-states = <&idle &s2ram>; -};