Skip to content

Commit 318bc03

Browse files
nordic-baminordic-piks
authored andcommitted
tests: benchmarks: Switch PM benchmarks to I/O gated meas (part 2)
Switch remaining benchmarks to use GPIO gated current measurements Signed-off-by: Bartosz Miller <[email protected]>
1 parent 9edeaa4 commit 318bc03

File tree

13 files changed

+48
-50
lines changed

13 files changed

+48
-50
lines changed

tests/benchmarks/multicore/idle_clock_control/coverage.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CONFIG_PM_DEVICE=n
55
CONFIG_PM_DEVICE_RUNTIME=n
66
CONFIG_POWEROFF=n
77

8-
CONFIG_GPIO=n
8+
CONFIG_GPIO=y
99

1010
CONFIG_NRFS=y
1111
CONFIG_CLOCK_CONTROL=y

tests/benchmarks/multicore/idle_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
/ {
88
aliases {
99
test-comp = &comp;
10+
led = &led0;
11+
/delete-property/ led1;
1012
};
1113

1214
zephyr,user {
1315
test-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
1416
};
1517
};
1618

19+
/delete-node/ &led1;
20+
1721
&gpio1 {
1822
status = "okay";
1923
};

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

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

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

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

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

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

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
static const struct device *test_dev = DEVICE_DT_GET(DT_ALIAS(test_comp));
1313
static const struct gpio_dt_spec test_pin = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), test_gpios);
14+
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
1415

1516
volatile int counter;
1617
static void test_callback(const struct device *dev, void *user_data)
@@ -26,6 +27,12 @@ int main(void)
2627

2728
gpio_pin_configure_dt(&test_pin, GPIO_OUTPUT_INACTIVE);
2829

30+
rc = gpio_is_ready_dt(&led);
31+
__ASSERT(rc, "Error: GPIO Device not ready");
32+
33+
rc = gpio_pin_configure_dt(&led, GPIO_OUTPUT_INACTIVE);
34+
__ASSERT(rc == 0, "Could not configure led GPIO");
35+
2936
pm_device_runtime_enable(test_dev);
3037
pm_device_runtime_get(test_dev);
3138

@@ -43,16 +50,17 @@ int main(void)
4350
#endif
4451
{
4552
counter = 0;
46-
k_msleep(200);
53+
k_busy_wait(200000);
4754
gpio_pin_set_dt(&test_pin, 1);
48-
k_msleep(400);
55+
k_busy_wait(400000);
4956
__ASSERT_NO_MSG(counter == 1);
5057
gpio_pin_set_dt(&test_pin, 0);
51-
k_msleep(400);
58+
k_busy_wait(400000);
5259
__ASSERT_NO_MSG(counter == 2);
5360
pm_device_runtime_put(test_dev);
61+
gpio_pin_set_dt(&led, 0);
5462
k_msleep(1000);
55-
63+
gpio_pin_set_dt(&led, 1);
5664
pm_device_runtime_get(test_dev);
5765
k_msleep(1);
5866
}

tests/benchmarks/multicore/idle_comp/sysbuild.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endif()
1111
# Add remote project
1212
ExternalZephyrProject_Add(
1313
APPLICATION remote
14-
SOURCE_DIR ${APP_DIR}/remote
14+
SOURCE_DIR ${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever
1515
BOARD ${SB_CONFIG_REMOTE_BOARD}
1616
BOARD_REVISION ${BOARD_REVISION}
1717
)

tests/benchmarks/multicore/idle_comp/testcase.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ tests:
3838
harness_config:
3939
fixture: gpio_loopback
4040
pytest_root:
41-
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_lpcomp"
41+
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_comp"
4242

4343
benchmarks.multicore.idle_lpcomp.nrf54h20dk_cpuapp_cpurad.coverage:
4444
tags:

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ int main(void)
4646
while (1) {
4747
timer_expired = false;
4848

49+
/* Turn ON LED */
50+
ret = gpio_pin_set_dt(&led, 1);
51+
4952
/* start a one-shot timer that expires after 1 second */
5053
k_timer_start(&my_timer, K_MSEC(1000), K_NO_WAIT);
5154

52-
/* Turn ON LED */
53-
ret = gpio_pin_set_dt(&led, 1);
5455
if (ret < 0) {
5556
LOG_ERR("Unable to turn on LED");
5657
}
@@ -62,16 +63,16 @@ int main(void)
6263
k_yield();
6364
}
6465

66+
LOG_INF("Run %d", counter);
67+
counter++;
68+
6569
/* Turn OFF LED */
6670
ret = gpio_pin_set_dt(&led, 0);
6771
if (ret < 0) {
6872
LOG_ERR("Unable to turn off LED");
6973
}
7074
__ASSERT(ret == 0, "Unable to turn off LED\n");
7175

72-
LOG_INF("Run %d", counter);
73-
counter++;
74-
7576
/* Sleep / enter low power state */
7677
k_msleep(CONFIG_TEST_SLEEP_DURATION_MS);
7778
}

tests/benchmarks/multicore/idle_twim/coverage.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CONFIG_I2C=y
2-
CONFIG_GPIO=n
2+
CONFIG_GPIO=y
33

44
CONFIG_PM=y
55
CONFIG_PM_S2RAM=n

0 commit comments

Comments
 (0)