Skip to content

Commit

Permalink
tests: benchmarks: multicore: Fix core synchronization in idle_pwm_lo…
Browse files Browse the repository at this point in the history
…opback

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)
  • Loading branch information
nordic-segl authored and bjarki-andreasen committed Jan 16, 2025
1 parent 9e42f82 commit 8e2855d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/

/ {

aliases {
led = &led0;
/delete-property/ led1;
Expand Down
13 changes: 6 additions & 7 deletions tests/benchmarks/multicore/idle_pwm_loopback/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,14 @@ int main(void)
ret = gpio_is_ready_dt(&led);
__ASSERT(ret, "Error: GPIO Device not ready");

#if defined(CONFIG_CLOCK_CONTROL)
ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_INACTIVE);
__ASSERT(ret == 0, "Could not configure led GPIO");
k_msleep(1000);
gpio_pin_set_dt(&led, 1);
set_global_domain_frequency();
#else
ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
__ASSERT(ret == 0, "Could not configure led GPIO");

/* Wait a bit to solve NRFS request timeout issue. */
k_msleep(100);

#if defined(CONFIG_CLOCK_CONTROL)
set_global_domain_frequency();
#endif

/* Set PWM fill ratio to 50% */
Expand Down
8 changes: 4 additions & 4 deletions tests/benchmarks/multicore/idle_pwm_loopback/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ tests:
harness_config:
fixture: spi_loopback
pytest_root:
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control"

benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_256MHz:
tags: ppk_power_measure
Expand All @@ -108,7 +108,7 @@ tests:
harness_config:
fixture: spi_loopback
pytest_root:
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control"

benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_128MHz:
tags: ppk_power_measure
Expand All @@ -122,7 +122,7 @@ tests:
harness_config:
fixture: spi_loopback
pytest_root:
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control"

benchmarks.multicore.idle_pwm_loopback.nrf54h20dk_cpuapp_cpurad.s2ram_fast.gd_freq_64MHz:
tags: ppk_power_measure
Expand All @@ -136,4 +136,4 @@ tests:
harness_config:
fixture: spi_loopback
pytest_root:
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram_with_clock_control"

0 comments on commit 8e2855d

Please sign in to comment.