Good morning,
I have been asked to merge the code developed by two independent teams. Of course, each one of them took their decision on the management of time, and of course they took different ways :) . I am currently working on SDK 15.0.0
So, I have one program which is based on APP_TIMER (which uses RTC1) and the other one which uses RTC0 (as done in the example of SDK, under peripheral --> RTC). I know that RTC0 is used by the softdevice, but it does not matter, since we are using a proprietary protcol without softdevice.
The "master" program which uses some functionality of the other one is based on the RTC0; nonetheless the "slave" program uses several timers, so the APP_TIMER is a must.
So, I was so far able to merge the softwares, to compile them and to program the NRF52832. The problem I am facing is that if I use only the RTC0 timer, the "master" program runs smoothly.
As soon as I call the app_timer_init() function, the program stops working. I was able to track down the problem to the single instruction
NVIC_EnableIRQ(SWI_IRQn);
in app_timer_init.c Without this instruction the "master" program run smoothly. But of course the app_timer does not work properly.
I tried to change the APP_TIMER_CONFIG_SWI_NUMBER defined in sdk_config.h to 1 or to 0, but in both cases I have the same issue.
So, my question is the following: is it possible that the definition of interrupts for RTC0 and RTC1 (app_timer) creates conflicts?
Do you have any suggestion on how to avoid these issues?
If possible, I would like to avoid using the APP_TIMER for managing all the timers, since this would require quite some work....so essentially I would like to know if RTC0 and APP_TIMER could live and work together happily.....
Thank you!