Multiple "dwm_interrupt_register" use question

Hello,
I want to add a second timer (TIMER3) to my user program running on PANS.
I started with examples dwm_timer.c and I added the second timer, but after the 2nd call to function “dwm_interrupt_register” to register the interrupt of TIMER3 the first timer (TIMER2) will stop to go in the interrupt handler.

It seem that is permitted to register only an interrupt.

Below part of the code:

dwm_irq_t irq,irq2;
int rv;
uint32_t err_code = NRF_SUCCESS;
uint32_t time_ticks;
const nrf_drv_timer_t timer2 = NRF_DRV_TIMER_INSTANCE(2);
const nrf_drv_timer_t timer3 = NRF_DRV_TIMER_INSTANCE(3);
nrf_drv_timer_config_t t_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;

irq.vector_nr = 10;
irq.p_hndlr = dwm_irq_hndlr;

rv = dwm_interrupt_register(&irq);
if (rv != DWM_OK)
printf("interrupt can't be registered, error %d\n", rv);

err_code = nrf_drv_timer_init(&timer2, &t_cfg, timer2_event_handler);
if (err_code != NRF_SUCCESS)
printf("timer can't be initialized, error %lu\n", err_code);

time_ticks = nrf_drv_timer_ms_to_ticks(&timer2, 200); //200ms
nrf_drv_timer_extended_compare(
     &timer2, NRF_TIMER_CC_CHANNEL0, time_ticks,
	 NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
nrf_drv_timer_enable(&timer2);

uint8_t tim_run;
tim_run = nrf_drv_timer_isrunning(&timer2) ;

irq2.vector_nr = 26;
irq2.p_hndlr = dwm_irq2_hndlr;

rv = dwm_interrupt_register(&irq2);
if (rv != DWM_OK)
printf("interrupt can't be registered, error %d\n", rv);

err_code = nrf_drv_timer_init(&timer3, &t_cfg, timer3_event_handler);
if (err_code != NRF_SUCCESS)
printf("timer can't be initialized, error %lu\n", err_code);

time_ticks = nrf_drv_timer_ms_to_ticks(&timer3, 333); //333ms
nrf_drv_timer_extended_compare(
     &timer3, NRF_TIMER_CC_CHANNEL0, time_ticks,
	 NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
nrf_drv_timer_enable(&timer3);

Any suggestion to solve this issue?

Many thanks in advance.

Valerio

Hi!

I am currently observing the same issue using 2 timers an I would appreciate any help, too!

Thanks in advance!
Markus

Hi,

no solutions yet, I gave up with multiple interrupt and I used two other tasks that I use like timers.

BR,
Valerio

ok, thanks for the hint!

Markus

Hello,

I am having exactly the same issue. Any news on that? Would it be a PANS bug?

Does anyone have any document that describe the proper way to use dwm_interrupt_register,
dwm_interrupt_mask and dwm_interrupt_unmask functions?

Thank you.