Skip to content

Commit 8e2855d

Browse files
nordic-seglbjarki-andreasen
authored andcommitted
tests: benchmarks: multicore: Fix core synchronization in idle_pwm_loopback
Execute k_msleep(100) no matter if core uses Clock Control (cpuapp) or not (cpurad). Otherwise, cores will enter low power state at different moments. Signed-off-by: Sebastian Głąb <[email protected]> (cherry picked from commit 2e0fec2)
1 parent 9e42f82 commit 8e2855d

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414

1515
/ {
16-
1716
aliases {
1817
led = &led0;
1918
/delete-property/ led1;

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,14 @@ int main(void)
102102
ret = gpio_is_ready_dt(&led);
103103
__ASSERT(ret, "Error: GPIO Device not ready");
104104

105-
#if defined(CONFIG_CLOCK_CONTROL)
106-
ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_INACTIVE);
107-
__ASSERT(ret == 0, "Could not configure led GPIO");
108-
k_msleep(1000);
109-
gpio_pin_set_dt(&led, 1);
110-
set_global_domain_frequency();
111-
#else
112105
ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
113106
__ASSERT(ret == 0, "Could not configure led GPIO");
107+
108+
/* Wait a bit to solve NRFS request timeout issue. */
109+
k_msleep(100);
110+
111+
#if defined(CONFIG_CLOCK_CONTROL)
112+
set_global_domain_frequency();
114113
#endif
115114

116115
/* Set PWM fill ratio to 50% */

tests/benchmarks/multicore/idle_pwm_loopback/testcase.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ tests:
9494
harness_config:
9595
fixture: spi_loopback
9696
pytest_root:
97-
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"
97+
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control"
9898

9999
benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_256MHz:
100100
tags: ppk_power_measure
@@ -108,7 +108,7 @@ tests:
108108
harness_config:
109109
fixture: spi_loopback
110110
pytest_root:
111-
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"
111+
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control"
112112

113113
benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_128MHz:
114114
tags: ppk_power_measure
@@ -122,7 +122,7 @@ tests:
122122
harness_config:
123123
fixture: spi_loopback
124124
pytest_root:
125-
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"
125+
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control"
126126

127127
benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_64MHz:
128128
tags: ppk_power_measure
@@ -136,4 +136,4 @@ tests:
136136
harness_config:
137137
fixture: spi_loopback
138138
pytest_root:
139-
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"
139+
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control"

0 commit comments

Comments
 (0)