Skip to content

Commit 89a27cf

Browse files
committed
tests: benchmarks: multicore: idle_flpr: Update the test
Recently, there were improvements in the idle_ppr test. Apply similar changes to the idle_flpr test. Since, FLPR doesn't support GPIO, skip code that indicates cpu activity. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent fccbda1 commit 89a27cf

File tree

9 files changed

+66
-33
lines changed

9 files changed

+66
-33
lines changed

tests/benchmarks/multicore/idle_flpr/prj.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ CONFIG_NCS_BOOT_BANNER=n
44
CONFIG_LOG=y
55
CONFIG_ASSERT=y
66
CONFIG_GPIO=y
7-
8-
CONFIG_NRF_REGTOOL_VERBOSITY=1

tests/benchmarks/multicore/idle_flpr/remote/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ cmake_minimum_required(VERSION 3.20.0)
99
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
1010
project(remote)
1111

12-
target_sources(app PRIVATE src/main.c)
12+
target_sources(app PRIVATE ../src/main.c)
1313

14-
if(DEFINED CONFIG_SOC_NRF54H20_CPUFLPR)
15-
message(STATUS "Power Mode handler for RISC V is included.")
16-
target_sources(app PRIVATE ../../common/power_off.c)
14+
if(CONFIG_SOC_NRF54H20_CPUFLPR)
15+
message(STATUS "Power Mode handler for RISC V is included.")
16+
target_sources(app PRIVATE ../../common/power_off.c)
1717
endif()
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
led0 = &led1;
10+
};
11+
12+
leds {
13+
compatible = "gpio-leds";
14+
led1: led_1 {
15+
gpios = < &gpio9 0x1 0x0 >;
16+
label = "Green LED 1";
17+
};
18+
};
19+
};
20+
21+
&gpio9 {
22+
status = "okay";
23+
};
24+
25+
&gpiote130 {
26+
status = "okay";
27+
owned-channels = <1>;
28+
};

tests/benchmarks/multicore/idle_flpr/remote/prj.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ CONFIG_NCS_BOOT_BANNER=n
77
CONFIG_PRINTK=n
88

99
CONFIG_ASSERT=y
10-
11-
CONFIG_NRF_REGTOOL_VERBOSITY=1
10+
CONFIG_GPIO=y

tests/benchmarks/multicore/idle_flpr/remote/prj_s2ram.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CONFIG_LOG=n
2+
13
CONFIG_PM=y
24
CONFIG_POWEROFF=y
35

@@ -11,3 +13,4 @@ CONFIG_BOOT_BANNER=n
1113
CONFIG_NCS_BOOT_BANNER=n
1214

1315
CONFIG_ASSERT=y
16+
CONFIG_GPIO=y

tests/benchmarks/multicore/idle_flpr/remote/src/main.c

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/benchmarks/multicore/idle_flpr/src/main.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66
#include <zephyr/kernel.h>
7-
#include <zephyr/drivers/gpio.h>
87

98
#include <zephyr/logging/log.h>
109
LOG_MODULE_REGISTER(idle_flpr, LOG_LEVEL_INF);
1110

11+
#if !defined(CONFIG_SOC_NRF54H20_CPUFLPR)
12+
/* Unable to use GPIO Zephyr driver on FLPR core due to lack of GPIOTE interrupt. */
13+
#include <zephyr/drivers/gpio.h>
14+
1215
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
16+
#endif
1317

1418
/* Variables used to make CPU active for ~1 second */
1519
static struct k_timer my_timer;
@@ -23,11 +27,13 @@ void my_timer_handler(struct k_timer *dummy)
2327
int main(void)
2428
{
2529
int counter = 0;
26-
int ret;
2730

2831
LOG_INF("Multicore idle_flpr test on %s", CONFIG_BOARD_TARGET);
2932
LOG_INF("Main sleeps for %d ms", CONFIG_TEST_SLEEP_DURATION_MS);
3033

34+
#if !defined(CONFIG_SOC_NRF54H20_CPUFLPR)
35+
int ret;
36+
3137
ret = gpio_is_ready_dt(&led);
3238
if (!ret) {
3339
LOG_ERR("LED is not ready");
@@ -39,38 +45,46 @@ int main(void)
3945
LOG_ERR("Unable to configure GPIO as output");
4046
}
4147
__ASSERT(ret == 0, "Unable to configure GPIO as output\n");
48+
#endif
4249

4350
k_timer_init(&my_timer, my_timer_handler, NULL);
4451

4552
/* Run test forever */
4653
while (1) {
4754
timer_expired = false;
4855

56+
#if !defined(CONFIG_SOC_NRF54H20_CPUFLPR)
57+
/* Turn ON LED */
58+
ret = gpio_pin_set_dt(&led, 1);
59+
#endif
60+
4961
/* start a one-shot timer that expires after 1 second */
5062
k_timer_start(&my_timer, K_MSEC(1000), K_NO_WAIT);
5163

52-
/* Turn ON LED */
53-
ret = gpio_pin_set_dt(&led, 1);
64+
#if !defined(CONFIG_SOC_NRF54H20_CPUFLPR)
5465
if (ret < 0) {
5566
LOG_ERR("Unable to turn on LED");
5667
}
5768
__ASSERT(ret == 0, "Unable to turn on LED\n");
69+
#endif
5870

5971
/* Keep CPU active for ~ 1 second */
6072
while (!timer_expired) {
6173
k_busy_wait(10000);
6274
k_yield();
6375
}
6476

77+
LOG_INF("Run %d", counter);
78+
counter++;
79+
80+
#if !defined(CONFIG_SOC_NRF54H20_CPUFLPR)
6581
/* Turn OFF LED */
6682
ret = gpio_pin_set_dt(&led, 0);
6783
if (ret < 0) {
6884
LOG_ERR("Unable to turn off LED");
6985
}
7086
__ASSERT(ret == 0, "Unable to turn off LED\n");
71-
72-
LOG_INF("Run %d", counter);
73-
counter++;
87+
#endif
7488

7589
/* Sleep / enter low power state */
7690
k_msleep(CONFIG_TEST_SLEEP_DURATION_MS);

tests/benchmarks/multicore/idle_flpr/sysbuild.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Add remote project
88
ExternalZephyrProject_Add(
99
APPLICATION remote_rad
10-
SOURCE_DIR ${SYSBUILD_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever
10+
SOURCE_DIR ${APP_DIR}/remote
1111
BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpurad
1212
BOARD_REVISION ${BOARD_REVISION}
1313
)

tests/benchmarks/multicore/idle_flpr/testcase.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ tests:
2626
benchmarks.multicore.idle_flpr.idle_retained:
2727
tags: ppk_power_measure
2828
extra_args:
29+
- CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y
2930
- idle_flpr_CONF_FILE=prj_s2ram.conf
3031
- remote_flpr_CONF_FILE=prj_s2ram.conf
32+
- remote_rad_CONF_FILE=prj_s2ram.conf
3133
- idle_flpr_CONFIG_TEST_SLEEP_DURATION_MS=500
3234
- remote_flpr_CONFIG_TEST_SLEEP_DURATION_MS=500
35+
- remote_rad_CONFIG_TEST_SLEEP_DURATION_MS=500
3336
- idle_flpr_EXTRA_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/multicore/common/workaround_idle_retained.overlay"
3437
harness: pytest
3538
harness_config:
@@ -40,10 +43,13 @@ tests:
4043
benchmarks.multicore.idle_flpr.idle:
4144
tags: ppk_power_measure
4245
extra_args:
46+
- CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y
4347
- idle_flpr_CONF_FILE=prj_s2ram.conf
4448
- remote_flpr_CONF_FILE=prj_s2ram.conf
49+
- remote_rad_CONF_FILE=prj_s2ram.conf
4550
- idle_flpr_CONFIG_TEST_SLEEP_DURATION_MS=500
4651
- remote_flpr_CONFIG_TEST_SLEEP_DURATION_MS=500
52+
- remote_rad_CONFIG_TEST_SLEEP_DURATION_MS=500
4753
- idle_flpr_EXTRA_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/multicore/common/workaround_idle.overlay"
4854
harness: pytest
4955
harness_config:
@@ -54,8 +60,10 @@ tests:
5460
benchmarks.multicore.idle_flpr.s2ram:
5561
tags: ppk_power_measure
5662
extra_args:
63+
- CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y
5764
- idle_flpr_CONF_FILE=prj_s2ram.conf
5865
- remote_flpr_CONF_FILE=prj_s2ram.conf
66+
- remote_rad_CONF_FILE=prj_s2ram.conf
5967
harness: pytest
6068
harness_config:
6169
fixture: ppk_power_measure

0 commit comments

Comments
 (0)