<?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>nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4388/nrf_delay_ms-with-a-delay-above-100msec-causes-reset-with-app-timers-running</link><description>Hi, 
 I have a reset issue when trying to set a delay greater or equal to 100 milliseconds using nrf_delay_ms(...). This only happens if I start my app timers (app_timer_start(...)) before calling the delay function. If the app timers are not running</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Dec 2015 21:40:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4388/nrf_delay_ms-with-a-delay-above-100msec-causes-reset-with-app-timers-running" /><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15572?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 21:40:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e6b54e6-de38-44bd-ba06-264c0cb245bb</guid><dc:creator>Vandita</dc:creator><description>&lt;p&gt;Hey John,&lt;/p&gt;
&lt;p&gt;I am facing a similar issue. I have the following code:
void timer_handler(void *p_context)
{
uint32_t err_code = app_timer_stop(timer_id);
APP_ERROR_CHECK(err_code);
func_2();
}&lt;/p&gt;
&lt;p&gt;void func_1()
{
/&lt;em&gt;code&lt;/em&gt;/&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//create timer
uint32_t err_code = app_timer_create(&amp;amp;timer_id, APP_TIMER_MODE_SINGLE_SHOT, timer_handler);
APP_ERROR_CHECK(err_code); 
err_code = app_timer_start(timer_id, TIMER_INTERVAL(TIMER_INTERVAL_S), NULL);
APP_ERROR_CHECK(err_code); 
return;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void func_2()
{
/* code*/
nrf_delay_ms(125); //system gets stuck here!!
/&lt;em&gt;code&lt;/em&gt;/
return;
}&lt;/p&gt;
&lt;p&gt;for the assert I have this:
void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name){
//DEBUG_PRINTF(&amp;quot;app_error_handler\r\nerror_code=%u\r\nline_num=%u\r\nfile_name=%s&amp;quot;,error_code,line_num,p_file_name);
SEGGER_RTT_printf(0, &amp;quot;app_error_handler\r\n: 0x%#04x\nline_num=%u\r\nfile_name=%s&amp;quot;,error_code, line_num,p_file_name);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)
{
app_error_handler(1, line_num, p_file_name);
}&lt;/p&gt;
&lt;p&gt;I&amp;#39;m getting the following response on RTTviewer:
0&amp;gt;  app_error_handler
0&amp;gt;  : 0x0005
0&amp;gt;  line_num=1371
0&amp;gt;  file_name=src\rem.c&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using a custom board with nrf51822. The system gets stuck after this error and doesn&amp;#39;t reset. If I enable wdt then I do see a reset. Why is this error occurring even after stopping the timer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15579?ContentTypeID=1</link><pubDate>Sun, 12 Jul 2015 01:04:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33dada0b-f6ce-4ff9-9010-0a1fb1524696</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;If your are using sdk8 with timer and scheduler at the same time you need to init the timer with APP_TIMER_APPSH_INIT.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15578?ContentTypeID=1</link><pubDate>Sat, 11 Jul 2015 07:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:398ad1b1-9143-4f12-b01d-9d117e2e1061</guid><dc:creator>cgha</dc:creator><description>&lt;p&gt;Is there any progress on this problem? I got this same NRFERROR_NO_MEM error in timeout_handler_exec when I use app_timer and schedule, But I think there is no long delay in my code. Which operation to app_timer will be pushed into queue beside start_timer and stop_timer? Will the timeout event be added into this queue? APP_TIMER_OP_QUEUE_SIZE is 20 and APP_TIMER_MAX_TIMERS is 11.
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/StackView.png" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15574?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 13:42:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84acb2c0-d8b0-4158-9f12-159d77594d2e</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;No problem, I have a way around the issue. But it would be good to find out!
Thanks so far.&lt;/p&gt;
&lt;p&gt;Phil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15575?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 13:30:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba78cdc2-d8b8-4c57-a550-97a6dde39cc9</guid><dc:creator>John</dc:creator><description>&lt;p&gt;That&amp;#39;s a bummer. I don&amp;#39;t think you are missing something. I was more hopeful about the queue size than the max timers. But apparently neither worked. I&amp;#39;ll post again if I think of something else.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15577?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 10:33:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bfdbcd3-0381-4f3b-a444-1df29ee84481</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;This unfortunately did not help, I pushed the queue size even up to 30 and it did not change anything. I also tried increasing the max amount of timers too without any result, but this should not help in any way since it is the amount of simultaneous timers you are setting up , or am I misunderstanding something? Well I am still getting the same error. I suppose I will have to start my 10 msec app timer after this delay.&lt;/p&gt;
&lt;p&gt;Phil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15576?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2014 16:48:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0571a8ac-c54a-4ff1-a84f-8734cc044aed</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Hi  Phil,&lt;/p&gt;
&lt;p&gt;That error is a NRF_ERROR_NO_MEM. So, you ran out of memory allocated for timer operations. Try bumping up the number of APP_TIMER_OP_QUEUE_SIZE and APP_TIMER_MAX_TIMERS you are allocating.&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15573?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2014 15:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbf3bc33-523f-4641-96b6-3cf693dc941f</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;Thanks, that seem&amp;#39;s to be the problem, timeout_handler_exec(..) in app_timer.c is sending me back a (timeout?) error N° 4 on a 10msec application callback timer created and started before my delay function. I suppose the callback function is not being processed (and setting a breakpoint there confirms this).&lt;/p&gt;
&lt;p&gt;The problem now is why am I getting this error? Is my delay function non interruptible? I seriously doubt this is the case... and if it is how can I get around this issue?&lt;/p&gt;
&lt;p&gt;Phil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_delay_ms with a delay above 100msec causes reset with app timers running!</title><link>https://devzone.nordicsemi.com/thread/15571?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2014 14:28:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:824be1a3-d90b-4c59-b77e-1ca6a9597324</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Hi Phil,&lt;/p&gt;
&lt;p&gt;I believe the answer to your question if there is a watchdog timer initialization hidden in the app timer functions is &amp;quot;no&amp;quot;. I&amp;#39;m using the app timer C file provided by Nordic and there is no watchdog timer started in that code.&lt;/p&gt;
&lt;p&gt;Regarding the reset you are seeing, it is hard to say what that might be. Have you turned on the assert callback and set a breakpoint in it to see if something in your code is throwing an assert? Can you check the reset reason in the POWER registers to see what the reset reason is?&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>