Which nRFX peripherals are used by Zephyr?

I have an NCS v2.6.1 project on the nRF52832 where I'm using both the zephyr timer APIs

k_timer_init(&pairing_timer, pairing_end_thandler, pairing_end_thandler);
k_timer_init(&optime_timer, optime_timer_handler, NULL);
k_timer_init(&(periodic_led_info.timer), led_timer_handler, NULL);
k_timer_init(&batt_mon_timer, batt_mon_timer_handler, NULL);
k_timer_init(&device_temp_timer, device_temp_timer_handler, NULL);

and the nRFX TIMER drivers

#define STIM_TIMER 0
nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(STIM_TIMER);

...

uint32_t desired_ticks = base_frequency / active_stim_profile.freq;

nrfx_timer_extended_compare(&timer_instance, NRF_TIMER_CC_CHANNEL0, desired_ticks,
                            NRF_TIMER_SHORT_COMPARE0_STOP_MASK, true);
nrfx_timer_extended_compare(&timer_instance, NRF_TIMER_CC_CHANNEL1, desired_ticks,
                            NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK, true);

This causes some perplexing issue where my Zephyr timers end up being non-functional and get some weird hard faults as well. Changing the STIM_TIMER to 1 or 4 fixes this entirely.

I'm assuming these issues arise from Zephyr using TIMER0. I've also got parts of the code using PPI and PWM via the nRFX drivers and Zephyr. Is there some way to check at compile time/runtime which peripherals are reserved for use by Zephyr?

Related