Skip to content

Commit

Permalink
tests: benchmarks: multicore: Add test for S2RAM and PPR
Browse files Browse the repository at this point in the history
Add non-functional check (current consumption) for sample
application that:
- runs on cpuapp, cpurad and cpuppr;
- enters low power state.

Confirm that when PPR core is used:
- SOC may enter low power states like IDLE or S2RAM.

Signed-off-by: Sebastian Głąb <[email protected]>
  • Loading branch information
nordic-segl committed Nov 12, 2024
1 parent db0b80c commit b2985bd
Show file tree
Hide file tree
Showing 14 changed files with 471 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/benchmarks/multicore/idle_ppr/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_ppr)

target_sources(app PRIVATE src/main.c)
15 changes: 15 additions & 0 deletions tests/benchmarks/multicore/idle_ppr/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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

&cpuppr_vpr {
status = "okay";
};

&cpuppr_ram3x_region {
status = "okay";
};


/ {
aliases {
/delete-property/ led1;
};
};

/delete-node/ &led1;

&gpiote130 {
status = "okay";
owned-channels = <0>;
};
8 changes: 8 additions & 0 deletions tests/benchmarks/multicore/idle_ppr/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_BOOT_BANNER=n
CONFIG_NCS_BOOT_BANNER=n

CONFIG_LOG=y
CONFIG_ASSERT=y
CONFIG_GPIO=y

CONFIG_NRF_REGTOOL_VERBOSITY=1
19 changes: 19 additions & 0 deletions tests/benchmarks/multicore/idle_ppr/prj_s2ram.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CONFIG_PM=y
CONFIG_PM_S2RAM=y
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
CONFIG_POWEROFF=y
CONFIG_SOC_NRF54H20_NO_MRAM_LATENCY=n

CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

CONFIG_BOOT_BANNER=n
CONFIG_NCS_BOOT_BANNER=n
CONFIG_PRINTK=n
CONFIG_LOG=n
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_SERIAL=n

CONFIG_ASSERT=y
CONFIG_GPIO=y
12 changes: 12 additions & 0 deletions tests/benchmarks/multicore/idle_ppr/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)
21 changes: 21 additions & 0 deletions tests/benchmarks/multicore/idle_ppr/remote/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# 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.

config APP_PROVIDE_PM_HOOKS
bool "Application provides PM hooks"
default y
select HAS_PM
select HAS_POWEROFF

source "Kconfig.zephyr"
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
aliases {
led0 = &led3;
};

leds {
compatible = "gpio-leds";
led3: led_3 {
gpios = < &gpio9 0x3 0x0 >;
label = "Green LED 3";
};
};

cpus {
power-states {
wait: wait {
compatible = "zephyr,power-state";
power-state-name = "standby";
substate-id = <0>;
min-residency-us = <20000>;
};

hibernate: hibernate {
compatible = "zephyr,power-state";
power-state-name = "suspend-to-ram";
substate-id = <0>;
min-residency-us = <400000>;
};
};
};
};

&cpu {
cpu-power-states = <&wait &hibernate>;
};

&gpio9 {
status = "okay";
};

&gpiote130 {
status = "okay";
owned-channels = <2>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
aliases {
led0 = &led1;
};

leds {
compatible = "gpio-leds";
led1: led_1 {
gpios = < &gpio9 0x1 0x0 >;
label = "Green LED 1";
};
};
};

&gpio9 {
status = "okay";
};

&gpiote130 {
status = "okay";
owned-channels = <1>;
};
12 changes: 12 additions & 0 deletions tests/benchmarks/multicore/idle_ppr/remote/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CONFIG_LOG=n
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_BOOT_BANNER=n
CONFIG_NCS_BOOT_BANNER=n
CONFIG_PRINTK=n

CONFIG_ASSERT=y
CONFIG_GPIO=y

CONFIG_NRF_REGTOOL_VERBOSITY=1
15 changes: 15 additions & 0 deletions tests/benchmarks/multicore/idle_ppr/remote/prj_s2ram.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CONFIG_PM=y
CONFIG_POWEROFF=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_NCS_BOOT_BANNER=n
CONFIG_SOC_NRF54H20_NO_MRAM_LATENCY=n

CONFIG_ASSERT=y
CONFIG_GPIO=y
Loading

0 comments on commit b2985bd

Please sign in to comment.