<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>App Timer problem...</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51914/app-timer-problem</link><description>Hi, 
 I have a problem with the app timer firing incorrectly. 
 I am using development board nrf52840-DK, Segger Studio 4.22, SDK 15.3.0_59. 
 When there has gone more than 256 seconds without any running app timers, the app timer fails and triggers right</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Sep 2019 07:31:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51914/app-timer-problem" /><item><title>RE: App Timer problem...</title><link>https://devzone.nordicsemi.com/thread/210001?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 07:31:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4787a07b-a792-4d32-ac7d-2aa0850ce89c</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Very glad to hear! Have a nice day!&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer problem...</title><link>https://devzone.nordicsemi.com/thread/209747?ContentTypeID=1</link><pubDate>Mon, 16 Sep 2019 06:39:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8962ac46-8a3e-479f-a6b0-2e6d94f26d22</guid><dc:creator>Erik_pxq</dc:creator><description>&lt;p&gt;Yes, my application is working nicely together with the app timer v2.&lt;/p&gt;
&lt;p&gt;Thanks very much for the help.&lt;/p&gt;
&lt;p&gt;Best regards, Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer problem...</title><link>https://devzone.nordicsemi.com/thread/209659?ContentTypeID=1</link><pubDate>Fri, 13 Sep 2019 13:46:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2fc8d5e-e11b-4992-807d-7aafacfdd036</guid><dc:creator>&amp;#216;yvind</dc:creator><description>[quote user="Erik_pxq"]I have not yet found anything wrong with the experimental app timer!![/quote]
&lt;p&gt;I&amp;#39;m glad to hear! Does this mean that your application is working as intended?&lt;br /&gt;&lt;br /&gt;-Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer problem...</title><link>https://devzone.nordicsemi.com/thread/209612?ContentTypeID=1</link><pubDate>Fri, 13 Sep 2019 12:16:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b5438f3-98d2-41de-a62e-a0fc3aa89b10</guid><dc:creator>Erik_pxq</dc:creator><description>&lt;p&gt;Sorry, I made a mistake in my test code!&lt;/p&gt;
&lt;p&gt;I have not yet found anything wrong with the experimental app timer!!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer problem...</title><link>https://devzone.nordicsemi.com/thread/209573?ContentTypeID=1</link><pubDate>Fri, 13 Sep 2019 09:34:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13b00401-0ded-445d-9e7c-8c47024dac88</guid><dc:creator>Erik_pxq</dc:creator><description>&lt;p&gt;I have now tried the the experimental app timer and made some testing with it.&lt;/p&gt;
&lt;p&gt;It works correctly at the&amp;nbsp;256 second mark. Unfortunately, I find it fails occasionally when more than 3 timers is running at the time.&lt;/p&gt;
&lt;p&gt;Do you know off any thirdparty libraries which implement some of the same functionality as the app timer library?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer problem...</title><link>https://devzone.nordicsemi.com/thread/208984?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 13:58:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa0b7253-9508-497d-a10a-38ec72c044fc</guid><dc:creator>&amp;#216;yvind</dc:creator><description>[quote user="Erik_pxq"]Is the app timer designed to handle wrap arounds?[/quote]
&lt;p&gt;Yes, it should handle wrap arounds, however, there are some issues that we are aware of, and working with. This is why we have added app_timer_v2 in &lt;em&gt;components\libraries\timer\experimental.&lt;/em&gt; However, this is currently in experimental status, and we do not have any good examples at the moment.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer problem...</title><link>https://devzone.nordicsemi.com/thread/208970?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 13:29:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d39a5527-3147-442d-8927-56a79fbd35d5</guid><dc:creator>Erik_pxq</dc:creator><description>&lt;p&gt;Hi &amp;Oslash;yvind,&lt;/p&gt;
&lt;p&gt;Thanks for your answer.&lt;/p&gt;
&lt;p&gt;I have just verified, that setting the app timer clock to 32768/2=16384 solves the problem for delays under 256 seconds.&lt;/p&gt;
&lt;p&gt;But I have also verified that the problem is just moved, so it instead occurs after 512 seconds. I guees the same probably happens with other prescalers.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Are you sure that APP_TIMER_KEEPS_RTC_ACTIVE=0 actually solves the problem, and not just moves it around?&lt;br /&gt;Setting APP_TIMER_KEEPS_RTC_ACTIVE=0, ensures that the app timer doesn&amp;#39;t overflow while no app timers is running, but eventually the app timer will overflow and the problem could occur.&lt;/p&gt;
&lt;p&gt;Is the app timer designed to handle wrap arounds?&lt;/p&gt;
&lt;p&gt;Best regards, Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App Timer problem...</title><link>https://devzone.nordicsemi.com/thread/208951?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 12:45:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55ed4b5a-49c0-40a0-a92b-d02be6992c19</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello Erik,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I have been able to reproduce your error. There are two possible solutions to this in sdk_config.h:&lt;/p&gt;
&lt;p&gt;Disable RTC Always on&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;q&amp;gt; APP_TIMER_KEEPS_RTC_ACTIVE  - Enable RTC always on
 
// &amp;lt;i&amp;gt; If option is enabled RTC is kept running even if there is no active timers.
// &amp;lt;i&amp;gt; This option can be used when app_timer is used for timestamping.

#ifndef APP_TIMER_KEEPS_RTC_ACTIVE
#define APP_TIMER_KEEPS_RTC_ACTIVE 0
#endif
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or lower the RTC prescaler, as a high prescaler causes it to&amp;nbsp;wrap around.&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;o&amp;gt; APP_TIMER_CONFIG_RTC_FREQUENCY  - Configure RTC prescaler.
 
// &amp;lt;0=&amp;gt; 32768 Hz 
// &amp;lt;1=&amp;gt; 16384 Hz 
// &amp;lt;3=&amp;gt; 8192 Hz 
// &amp;lt;7=&amp;gt; 4096 Hz 
// &amp;lt;15=&amp;gt; 2048 Hz 
// &amp;lt;31=&amp;gt; 1024 Hz 

#ifndef APP_TIMER_CONFIG_RTC_FREQUENCY
#define APP_TIMER_CONFIG_RTC_FREQUENCY 0
#endif&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve tested with RTC Always ON and prescaler = 16384 Hz, and got:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;App timer fired OK : Elapsed time(ms)=10090, expected(ms)=10000&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Let me know how that works for you.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>