<?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>Watch dog and while statement</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50548/watch-dog-and-while-statement</link><description>Based on nRF5_SDK_15.3.0_59ac345 at NRF52810 development board, 1. Enable the watchdog with reload value = 2000, and feed it per 1000ms by app_timer 2. Initialize the FDS and wait its ready 
 static void _on_fds_event(fds_evt_t const* evt) { 
 switch</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 29 Mar 2020 21:02:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50548/watch-dog-and-while-statement" /><item><title>RE: Watch dog and while statement</title><link>https://devzone.nordicsemi.com/thread/242259?ContentTypeID=1</link><pubDate>Sun, 29 Mar 2020 21:02:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01759a30-3bda-4b5a-a521-2b6007b1e178</guid><dc:creator>peter_100P</dc:creator><description>&lt;p&gt;Every embedded developer worth their salt must read this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.ganssle.com/watchdogs.htm"&gt;http://www.ganssle.com/watchdogs.htm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watch dog and while statement</title><link>https://devzone.nordicsemi.com/thread/203419?ContentTypeID=1</link><pubDate>Sat, 10 Aug 2019 03:24:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61ba5307-b8ae-4fd0-9b15-842ef67fc7fd</guid><dc:creator>Hansome</dc:creator><description>&lt;p&gt;In other words, How to feed the watch-dog is better?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watch dog and while statement</title><link>https://devzone.nordicsemi.com/thread/203295?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 11:59:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f9d64aa-ab68-439a-9251-fbbc7dbe8aa0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/hansome"&gt;Hansome&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;I gave this some more thought after consulting with my colleague who handles &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50825/hardfault-debug" rel="noopener noreferrer" target="_blank"&gt;this ticket&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Maybe you shouldn&amp;#39;t set the app_timer&amp;#39;s priority so high. It may result in some unexpected behavior because other threads that possibly needs access faster can&amp;#39;t get it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suggest that you bump the priority on app_timer back to the default value (6?) and then rather skip the while(!fds_ready){}.&lt;/p&gt;
&lt;p&gt;I agree that sometimes you need to wait for _fds_ready, but I suggest that you do this update in your main context instead of in the FDS interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watch dog and while statement</title><link>https://devzone.nordicsemi.com/thread/202334?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2019 08:23:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7e78f18-1554-4668-991e-e122298ddea2</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I don&amp;#39;t know if you actually opened the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s112%2FSDS%2Fs1xx%2Fprocessor_avail_interrupt_latency%2Fexception_mgmt_sd.html" rel="noopener noreferrer" target="_blank"&gt;link from my previous reply&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;levels 0, 1 and 4 are reserved for the softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Edvin Holmseth"]I don&amp;#39;t know whether you are using the softdevice[/quote]
&lt;p&gt;&amp;nbsp;Do you use the softdevice?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Edvin Holmseth"]Try to set it to 3, and see if that helps.[/quote]
&lt;p&gt;&amp;nbsp;so you tried 0, 1 and 5. Did you try 3?&lt;/p&gt;
&lt;p&gt;Check out the link, and pick a value that is higher than the softdevice&amp;#39;s &amp;quot;none-time-critical processing&amp;quot; and &amp;quot;SoftDevice memory protection&amp;quot; So you can choose either 2 or 3. If 2 works, then it is fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watch dog and while statement</title><link>https://devzone.nordicsemi.com/thread/202282?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2019 00:14:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2add674c-3528-4480-983c-6825eefa61c6</guid><dc:creator>Hansome</dc:creator><description>&lt;p&gt;Only setting APP_TIMER_CONFIG_IRQ_PRIORITY to 2 can works, why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watch dog and while statement</title><link>https://devzone.nordicsemi.com/thread/202281?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2019 00:10:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:918573ce-d358-4f99-b5e7-87f7d5694139</guid><dc:creator>Hansome</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;o&amp;gt; APP_TIMER_CONFIG_IRQ_PRIORITY  - Interrupt priority
 

// &amp;lt;i&amp;gt; Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// &amp;lt;0=&amp;gt; 0 (highest) 
// &amp;lt;1=&amp;gt; 1 
// &amp;lt;2=&amp;gt; 2 
// &amp;lt;3=&amp;gt; 3 
// &amp;lt;4=&amp;gt; 4 
// &amp;lt;5=&amp;gt; 5 
// &amp;lt;6=&amp;gt; 6 
// &amp;lt;7=&amp;gt; 7 

#ifndef APP_TIMER_CONFIG_IRQ_PRIORITY
#define APP_TIMER_CONFIG_IRQ_PRIORITY 0
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There has been no improvement with the value=0 or value=1 or value=5.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watch dog and while statement</title><link>https://devzone.nordicsemi.com/thread/202138?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2019 12:17:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5153e52-9d67-4e47-9f5d-86ae972ee274</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/hansome"&gt;Hansome&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;It sounds like the app_timer interrupt is not allowed to access the CPU until you are done with your FDS events. They are probably running on the same interrupt priority.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know whether you are using the softdevice, but you can take a look at the interrupt priority levels for the nRF52810 &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s112%2FSDS%2Fs1xx%2Fprocessor_avail_interrupt_latency%2Fexception_mgmt_sd.html" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Try to increase the interrupt priority (lower number = higher priority) on the app_timer.&lt;/p&gt;
&lt;p&gt;Look for&amp;nbsp;APP_TIMER_CONFIG_IRQ_PRIORITY in sdk_config.h. Try to set it to 3, and see if that helps.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>