<?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>How can I prevent system reset?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26044/how-can-i-prevent-system-reset</link><description>Hello, I created a timer that runs the scan_start function at certain intervals.And I put this timer in the for loop. 
 static void scan_timeout_handler(void * p_context)
{
	scan_start();
}

static void timers_init(void)
{
	uint32_t err_code;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Oct 2017 10:58:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26044/how-can-i-prevent-system-reset" /><item><title>RE: How can I prevent system reset?</title><link>https://devzone.nordicsemi.com/thread/102648?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 10:58:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81b70070-d269-4ec8-86eb-525b265e830b</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;There are many lines of code inside ble_nus_c_on_ble_evt(). Please put a breakpoint in it and see if you can step through the function. There is probably also a function called ble_nus_c_evt_handler(), or similar, in your main.c file. It might be worth setting a breakpoint in there too, and see if any of the function calls inside it return any errors.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I prevent system reset?</title><link>https://devzone.nordicsemi.com/thread/102650?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2017 05:53:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e080fe33-3ca9-4968-aeec-524bb2cde155</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;I can not follow it with the Debugger(Usually freezes in &amp;quot;ble_nus_c_on_ble_evt(&amp;amp;m_ble_nus_c,p_ble_evt);&amp;quot; function). But every time the program is restarted I can reach the result that the device is reset because the led is on.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{
    uint32_t err_code;

    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
	
    ble_stack_init();
    
    err_code = ble_db_discovery_init();
    APP_ERROR_CHECK(err_code);
    
    nus_c_init();
    timers_init();

    nrf_gpio_cfg_output(LED0);
    nrf_gpio_pin_set(LED0);	
    nrf_delay_ms(1000);
    nrf_gpio_pin_clear(LED0);
for(;;)
{}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I prevent system reset?</title><link>https://devzone.nordicsemi.com/thread/102647?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 07:40:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b46d3e5-1e5f-48d8-a203-a45387dd44fc</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;So where inside ble_stack_init() do things go wrong? Have you stepped through the function with a debugger?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I prevent system reset?</title><link>https://devzone.nordicsemi.com/thread/102649?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 14:00:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12d1bce6-2886-4cd1-901c-ff1c102b0e16</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;Because I want to do continuous rssi measurement. And I do not know if I have any other way to do this.(Theoritically, &lt;strong&gt;Timeslot&lt;/strong&gt; can solve the problem, but I do not have enough knowledge about it yet.)&lt;/p&gt;
&lt;p&gt;On th other hand, I do not think the system has restarted itself because of a &lt;strong&gt;APP_ERROR_CHECK&lt;/strong&gt;. I think it has been reset cause of  &lt;strong&gt;ble_stack_init&lt;/strong&gt; function (I mean &lt;strong&gt;softdevice&lt;/strong&gt;). &lt;a href="https://devzone.nordicsemi.com/question/153504/state-machine-rtc-synchronization-with-softdevice/"&gt;I read this link&lt;/a&gt;
The system seems to be running a watchdog, and when it is finished, the program starts again from stack_init. But I&amp;#39;m not sure about the possibilities.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I prevent system reset?</title><link>https://devzone.nordicsemi.com/thread/102646?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 11:22:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb663ef7-5e13-4000-b402-2889ac75b794</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Why do you call app_timer_start() over and over in an endless for() loop?&lt;/p&gt;
&lt;p&gt;The system resets itself by default if a function returns an error which is then checked by &lt;code&gt;APP_ERROR_CHECK(err_code);&lt;/code&gt;. You should debug it &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;like this&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>