diff --git a/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf52_bsim.overlay b/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf52_bsim.overlay new file mode 100644 index 00000000000..ebfed9cf903 --- /dev/null +++ b/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf52_bsim.overlay @@ -0,0 +1,8 @@ +&rtc0 { + status = "okay"; + fixed-top; +}; +&rtc2 { + status = "okay"; + fixed-top; +}; diff --git a/tests/drivers/counter/counter_nrf_rtc/fixed_top/src/test_counter_fixed_top.c b/tests/drivers/counter/counter_nrf_rtc/fixed_top/src/test_counter_fixed_top.c index a86384d1305..66fabc91725 100644 --- a/tests/drivers/counter/counter_nrf_rtc/fixed_top/src/test_counter_fixed_top.c +++ b/tests/drivers/counter/counter_nrf_rtc/fixed_top/src/test_counter_fixed_top.c @@ -100,6 +100,12 @@ static void test_top_handler_on_instance(int idx) .callback = top_handler, .flags = 0 }; +#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX) + /* For simulated devices we need to convert the hardcoded DT address from the real + * peripheral into the correct one for simulation + */ + reg = nhw_convert_periph_base_addr(reg); +#endif top_cfg.ticks = counter_get_max_top_value(dev);