<?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>Application code debugging will ALWAYS hang in SoftDevice address range</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/190/application-code-debugging-will-always-hang-in-softdevice-address-range</link><description>I&amp;#39;m having a very strange issue when trying to debug application code on my Nordic platform. I&amp;#39;m hoping that someone else can shed some light on the issue, or at least confirm if others are seeing it. 
 The background:
ANT-based application using nRF51422</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Aug 2013 16:22:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/190/application-code-debugging-will-always-hang-in-softdevice-address-range" /><item><title>RE: Application code debugging will ALWAYS hang in SoftDevice address range</title><link>https://devzone.nordicsemi.com/thread/1043?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2013 16:22:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fddf8ab-f68f-4346-bfc7-cc39db32c7ce</guid><dc:creator>henning larsen</dc:creator><description>&lt;p&gt;I see something similar - in some of the example projects for nRF51422 using softdevice and Keil.&lt;/p&gt;
&lt;p&gt;For instance in the ant_bicyle_power_only_sensor..
In the infinite event handling loop:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for ( ; ; ) 
{             
                   return_value = sd_app_event_wait(); 
                   APP_ERROR_CHECK(return_value);
                    if (!m_ant_stack_event_received)
                  {            
                       ....
                   }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I put a breakpoint anywhere in this loop and it gets hit, the application stops working when resuming. Without a breakpoint or when it is not hit, the application is running as expected.&lt;/p&gt;
&lt;p&gt;I can also break into the loop by setting a breakpoint while it is running in the debugger (never been stopped in debugger), but when resuming it will run at most one loop, then the application is hung and RF communication stops. Probably it is caught in a fatal assert() as mentioned in above link.&lt;/p&gt;
&lt;p&gt;I also tried to set AllowSimulation = 0 in the JLinkSettings.ini as I have read somewhere to be recommended - but it does not make any difference at all.&lt;/p&gt;
&lt;p&gt;So are we really left with print-statements to debug while softdevice is active?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application code debugging will ALWAYS hang in SoftDevice address range</title><link>https://devzone.nordicsemi.com/thread/1041?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2013 11:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0879e417-0c20-466f-aa82-633a42e0f332</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;If you run the program without a debugger, does it work? (i.e. are you able to receive data in ANTWare or similar?) Also, do you use the debugger in µVision, or some other setup? If something else, what exactly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application code debugging will ALWAYS hang in SoftDevice address range</title><link>https://devzone.nordicsemi.com/thread/1042?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2013 18:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9335b4b5-114c-4de1-91fd-dffd44c6a7b5</guid><dc:creator>Guest</dc:creator><description>&lt;p&gt;And to clarify, unlike in the post linked below, I am not trying to set a breakpoint before the SoftDevice call. Any breakpoint placed after a SD call (with no BPs before) recreates the issue.&lt;/p&gt;
&lt;p&gt;I suppose that in connecting to/halting the processor when I establish the debugging session is similar to hitting a breakpoint, but I just can&amp;#39;t accept that one of the primary uses of a HW debugger (setting HW breakpoints) is (essentially) completely foobed, as suggested in that reply.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/how-can-i-debug-a-softdevice-application#reply-82" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/how-can-i-debug-a-softdevice-application#reply-82&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application code debugging will ALWAYS hang in SoftDevice address range</title><link>https://devzone.nordicsemi.com/thread/1040?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2013 18:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d9f269a-a31f-4398-8471-e6d11d93145d</guid><dc:creator>Bastiaan</dc:creator><description>&lt;p&gt;And to clarify, unlike in the post linked below, I am not trying to set a breakpoint before the SoftDevice call. Any breakpoint placed after a SD call (with no BPs before) recreates the issue.&lt;/p&gt;
&lt;p&gt;I suppose that in connecting to/halting the processor when I establish the debugging session is similar to hitting a breakpoint, but I just can&amp;#39;t accept that one of the primary uses of a HW debugger (setting HW breakpoints) is (essentially) completely foobed, as suggested in that reply.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/how-can-i-debug-a-softdevice-application#reply-82" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/how-can-i-debug-a-softdevice-application#reply-82&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>