diff --git a/tests/benchmarks/power_consumption/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/power_consumption/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 43a16d5f1c9c..84431e9784b0 100644 --- a/tests/benchmarks/power_consumption/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/benchmarks/power_consumption/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -2,6 +2,10 @@ status = "okay"; }; +&exmif { + zephyr,pm-device-runtime-auto; +}; + / { aliases { led = &led0; diff --git a/tests/benchmarks/power_consumption/flash/src/driver_test.c b/tests/benchmarks/power_consumption/flash/src/driver_test.c index 8f449ea1b281..5679425e4d4c 100644 --- a/tests/benchmarks/power_consumption/flash/src/driver_test.c +++ b/tests/benchmarks/power_consumption/flash/src/driver_test.c @@ -25,12 +25,25 @@ uint8_t buf[EXPECTED_SIZE]; static const struct device *flash_dev = DEVICE_DT_GET(FLASH_NODE); +static bool suspend_req; + +bool self_suspend_req(void) +{ + suspend_req = true; + return true; +} + void thread_definition(void) { int rc; uint8_t fill_value = 0x00; while (1) { + if (suspend_req) { + suspend_req = false; + k_thread_suspend(k_current_get()); + } + rc = flash_erase(flash_dev, TEST_AREA_OFFSET, FLASH_PAGE_SIZE); __ASSERT(rc == 0, "flash_erase %d\n", rc); rc = flash_fill(flash_dev, fill_value, TEST_AREA_OFFSET, EXPECTED_SIZE);