<?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>Code runs in debugger, but not on power up</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7714/code-runs-in-debugger-but-not-on-power-up</link><description>I have an app built in IAR using S110, SDK 7 on PCA10028 DK board that runs fine with the debugger, but if I stop the debugger and unplug and plug back in the USB cable, it does not run. 
 This used to work, but has recently stopped. The only thing I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Jun 2015 19:24:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7714/code-runs-in-debugger-but-not-on-power-up" /><item><title>RE: Code runs in debugger, but not on power up</title><link>https://devzone.nordicsemi.com/thread/27485?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 19:24:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a1d9b4a-0201-4fcd-a7ed-235574dd8635</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;And I found the answer.&lt;/p&gt;
&lt;p&gt;I had ENABLE_DEBUG_LOG_SUPPORT enabled, and this requires an implementation of printf.  When running in the IAR debugger, there is a mechanism for &amp;quot;semi-hosting&amp;quot; that redirects printf and scanf and the like for stdio to the debugger.  Running without the debugger, nowhere for that stuff to go and it hangs.  Removing ENABLE_DEBUG_LOG_SUPPORT from my compile options allows the code to work from a power up without the debugger.&lt;/p&gt;
&lt;p&gt;Jeff.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Code runs in debugger, but not on power up</title><link>https://devzone.nordicsemi.com/thread/27484?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 18:42:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e817490-5bbb-4524-b660-957aab6a2d06</guid><dc:creator>Jeff Wormsley</dc:creator><description>&lt;p&gt;By using the LEDs and putting in rather large delays, I&amp;#39;ve found that the place the code hangs is in dm_init().  Not sure why it hangs there running outside the debugger, and not when running inside the debugger, but at least I can see where it is hanging.&lt;/p&gt;
&lt;p&gt;The dm_init() routine is fairly large, so it will take some time to figure out where it is in there that is causing the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>