<?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>My device is freezing and restarting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10729/my-device-is-freezing-and-restarting</link><description>My device is either freezing or restarting, and i do not know why.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Jun 2017 07:22:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10729/my-device-is-freezing-and-restarting" /><item><title>RE: My device is freezing and restarting</title><link>https://devzone.nordicsemi.com/thread/40111?ContentTypeID=1</link><pubDate>Wed, 07 Jun 2017 07:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4c8c0d7-3f55-4c9f-b4f4-f97c30dd5a20</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;If you take a look at the Call Stack, you&amp;#39;ll see from which function call the error originated and then you&amp;#39;ll have to refer to the documentation of that function on Infocenter. The error codes returned by our drivers/libraries are usually global error codes, i.e. one of the error codes listed &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group__nrf__error.html?resultof=%22%4e%52%46%5f%45%52%52%4f%52%22%20"&gt;here&lt;/a&gt;. Note: The link is specific to S132 v4.0.2, if you&amp;#39;re using another SD, then you should look up the global error codes for the SD you&amp;#39;re using.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: My device is freezing and restarting</title><link>https://devzone.nordicsemi.com/thread/40110?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 19:46:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97a16f3f-0097-44b2-b41f-a70027be3916</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;How to determine what does an error code mean? Is there any resource to read from?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: My device is freezing and restarting</title><link>https://devzone.nordicsemi.com/thread/40109?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 21:32:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a7b70af-8371-4515-a309-42372bd9b69c</guid><dc:creator>tyler</dc:creator><description>&lt;p&gt;Where do you need to define DEBUG?  I tried putting it in my main.c and I don&amp;#39;t think it worked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: My device is freezing and restarting</title><link>https://devzone.nordicsemi.com/thread/40108?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2017 14:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cfd272b-4de6-4871-8980-acdb4a9f36e9</guid><dc:creator>luke</dc:creator><description>&lt;p&gt;hello, i have a case where debug is causing a system reset. when i call this function &amp;quot;sd_ble_gap_adv_start&amp;quot;  it seems im getting system reset every 60 seconds. im running the same code on multiple devices (multiple prototypes custom made in china and dev kits) only one prototype is showing this malfunction. when i try to do the debug configurations in options for target like the step above, the prototype doesnt even start. im suspecting that the prototype has a deffective nrf52832.
any ideas or advice?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: My device is freezing and restarting</title><link>https://devzone.nordicsemi.com/thread/40107?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 12:51:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f243a535-1dad-4f93-904f-4e663a6b8b6d</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the SDK examples, we check return codes with the macro APP_ERROR_CHECK. This function calls the function &lt;code&gt;app_error_handler&lt;/code&gt;in app_error.c.
Here we find this code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#ifndef DEBUG
    NVIC_SystemReset();
#else
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This means that by default, the response to ANY return code other than NRF_SUCCESS will cause a system reset.&lt;/p&gt;
&lt;p&gt;If we have defined DEBUG, this happens:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;m_error_code = error_code;
m_line_num = line_num;
m_p_file_name = p_file_name;
UNUSED_VARIABLE(m_error_code);
UNUSED_VARIABLE(m_line_num);
UNUSED_VARIABLE(m_p_file_name);
__disable_irq();
while(loop);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We disable interrupts and stay in a loop forever. In this case we can either &lt;a href="https://devzone.nordicsemi.com/tutorials/6/"&gt;print out&lt;/a&gt; or read (with a debugger) the error code, line number and file name that returned the error code.&lt;/p&gt;
&lt;p&gt;Note the warning in the documentation of app_error_handler:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;@warning This handler is an example
only and does not fit a final product.
You need to analyze  *          how
your product is supposed to react in
case of error.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Finding the error with the Keil debugger:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1.Set optimization level 0 in target options -&amp;gt; C/C++ and define DEBUG in the preprocessor symbols.
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/optimization0_2B00_debug.PNG" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;2.Place a break point next to while(loop); (right click -&amp;gt;Insert breakpoint)&lt;/p&gt;
&lt;p&gt;3.Run the program, and wait for the error to occur.&lt;/p&gt;
&lt;p&gt;4.Read the information by hovering the mouse cursor over the value. Alternatively you can add the values to a watch by doing right click-&amp;gt;add to watch X. To display the values in decimal format rather than in hexadecimal, right click the variable (in watch window) and click on &amp;quot;Hexadecimal Display&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/watch.png" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;Find more information about debugging with Keil &lt;a href="http://www.keil.com/support/man/docs/uv4/uv4_db_using.htm"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>