Is it acceptable if I stop an app timer for dozens of times when the app timer is actually stopped. Will the memory leak if I operates in these scenario.Does it affect whether use scheduler when I init the app timer?
Is it acceptable if I stop an app timer for dozens of times when the app timer is actually stopped. Will the memory leak if I operates in these scenario.Does it affect whether use scheduler when I init the app timer?
Hi
I think the safer approach would be to maintain a state variable in your code, that you check before starting or stopping the timer. I quickly do not see the state checked internally.
Hi
I think the safer approach would be to maintain a state variable in your code, that you check before starting or stopping the timer. I quickly do not see the state checked internally.
Were you able to confirm this Stefan? As a rule in my application code I always stop a timer before starting it. I want to make sure this isnt creating a leak or long term issues? I have been seeing odd behaviour from my app_timers, randomly expiring too fast or causing system crashes. My app_timers use the scheduler.
@Dave
I have not confirmed it but I think it would be the safest way to maintain a state variable that registers if a certain app-timer is started or stopped.
Try it to see if the behavior improves.
It appears to occur when app_timers.c calls rtc1_stop() followed by rtc1_start(). I'm not able to get that code to execute from my application without hardcoding them to, but that is the sequence which causes the issue mentioned above. It must be some combination of events and timers which cause that code to execute.
The app_timer uses RTC1 timer in the background, so make sure you do not use RTC1 timer for anything else.
All the information that I have is that it should work normally. Perhaps something in your code interferes with the app_timer operation and triggers some corner case. I would recommend to you to do an isolated test for the app_timer, and gradually add the extra functionality of your code in order to isolate the problem.
If the problem remains, you could share your project with the Nordic's technical support team. To do that, go to www.nordicsemi.com, create a profile and register a new support case, attach your code and provide a link to this devzone thread for reference.