<?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>Switched to IAR and project continuously restarts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17686/switched-to-iar-and-project-continuously-restarts</link><description>I started evaluating the nRF52 using Keil and everything worked great. However, I switched to developing in IAR because I have a full license. I&amp;#39;m using the same code (ble peripheral uart example), but now the unit will restart after a few seconds. If</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Dec 2016 13:00:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17686/switched-to-iar-and-project-continuously-restarts" /><item><title>RE: Switched to IAR and project continuously restarts</title><link>https://devzone.nordicsemi.com/thread/68048?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2016 13:00:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b5484ce-a383-4498-af5a-c8475eefb3fc</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Executing code after going to system OFF will lead to undefined behavior. The application should add an infinite loop after going to system OFF to avoid this, see the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_2_0_17_1_0#unique_1053952700"&gt;Product Specification&lt;/a&gt;. The SDK example does not do this and we are working on improving this.&lt;/p&gt;
&lt;p&gt;Related link: &lt;a href="https://devzone.nordicsemi.com/question/64370/sd_power_system_off-returns-immediately-and-forces-reset/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To avoid system reset when functions return error code (and it is checked with APP_ERROR_CHECK), you should define DEBUG in the preprocessor symbols. This will make the application end up in an infinite while loop in the error handler. See &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;here&lt;/a&gt; for more info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switched to IAR and project continuously restarts</title><link>https://devzone.nordicsemi.com/thread/68047?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 08:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76c8707f-a7dd-47d6-8f36-c232b3f50c41</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;I can see that most likely sleep_mode_enter function returns error code when your code tries to go to sleep. When I tried to run nearly the same code in debug mode I had the same. In normal mode it works. I  may be wrong but I have a feeling that I have read somewhere that nRF52 in debug mode can&amp;#39;t go to sleep. Nordic can give more details. Or search on this forum. Update: &lt;a href="https://devzone.nordicsemi.com/question/90414/why-does-nrf52-hrs-sdk11-example-sd_power_off-return-6/"&gt;this is the answer with exactly the same error code&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switched to IAR and project continuously restarts</title><link>https://devzone.nordicsemi.com/thread/68046?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2016 20:22:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:488d3b78-74d7-4009-bc63-e94bdd64d70d</guid><dc:creator>butch</dc:creator><description>&lt;p&gt;You can look up the error code in components/libraries/util/sdk_errors.h  Convert 8198 to hex?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switched to IAR and project continuously restarts</title><link>https://devzone.nordicsemi.com/thread/68043?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2016 08:37:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a983173-cd6e-4da7-b940-b66d970bc63b</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;If you put breakpoint in app_error_handler_bare() then you can see error code. Also look at the function calls history under the View tab in IAR, so you can see where app_error_handler_bare was called.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switched to IAR and project continuously restarts</title><link>https://devzone.nordicsemi.com/thread/68045?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2016 00:30:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ddd784c-c400-4318-8bb7-212626649240</guid><dc:creator>jmc</dc:creator><description>&lt;p&gt;It calls &lt;code&gt;app_error_handler_bare()&lt;/code&gt;, which is in the file app_error.c.  This eventually calls &lt;code&gt;NVIC_SystemReset();&lt;/code&gt;.  No idea why this gets called.  If I single step, then the error is thrown after 5-6 seconds (about 10 steps).  If I let the code run, then it takes 2-3 minutes before the error is thrown.&lt;/p&gt;
&lt;p&gt;I doubled the stack and heap sizes and it didn&amp;#39;t help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switched to IAR and project continuously restarts</title><link>https://devzone.nordicsemi.com/thread/68042?ContentTypeID=1</link><pubDate>Mon, 14 Nov 2016 09:09:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:670eaedb-98b3-40af-a772-03674b0a08cc</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Are you using IAR project settings from example? Main thing is linker file and preprocessor definitions in project. Or try to set break point in error handler to find out which function inside ble_advertising_start() returns error and resets your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switched to IAR and project continuously restarts</title><link>https://devzone.nordicsemi.com/thread/68044?ContentTypeID=1</link><pubDate>Sat, 12 Nov 2016 06:07:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f745805a-263c-4d63-85d8-a665a290ec0c</guid><dc:creator>Artucas</dc:creator><description>&lt;p&gt;If removing &lt;code&gt;ble_advertising_start();&lt;/code&gt; helped you, then my first guess would be to look at stack configuration. Maybe it is not enough space for the stack and you are experiencing issues with stack overflow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>