<?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>Debug BLE &amp;quot;Softdevice&amp;quot;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66805/debug-ble-softdevice</link><description>I recently got the nRF52-DK for using as BLE Relay evaluation. 
 I have downloaded following and installed to run the code 
 - Segger Embedded Studio (v5.1) 
 - nRF5_SDK_17.0.2_d674dde 
 1. I have searched the forum and others saying debugger cannot be</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Oct 2020 16:27:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66805/debug-ble-softdevice" /><item><title>RE: Debug BLE "Softdevice"</title><link>https://devzone.nordicsemi.com/thread/273852?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 16:27:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a2d5f28-50a1-4c74-86b3-02058f770e71</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;I don&amp;#39;t think it&amp;#39;s guaranteed that volatile will stop the compiler from removing an entirely useless variable?&lt;/p&gt;
&lt;p&gt;See:&amp;nbsp;&lt;a href="https://www.avrfreaks.net/comment/3004761#comment-3004761"&gt;www.avrfreaks.net/.../3004761&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug BLE "Softdevice"</title><link>https://devzone.nordicsemi.com/thread/273849?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 16:25:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e4b2786-a5d8-4b1a-bb7e-e089105834e6</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;You need to show a complete example which illustrates the issue.&lt;/p&gt;
&lt;p&gt;If&amp;nbsp;&lt;span&gt;p_local_evt&amp;nbsp; is static, and is never read, then it is certainly up for optimisation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;By removing static, you make it global; so the compiler cannot know if it is referenced elsewhere or not - so cannot optimise it away.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug BLE "Softdevice"</title><link>https://devzone.nordicsemi.com/thread/273588?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 19:48:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d432a1e-6820-4011-bee4-139c582367ec</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Typically if you don&amp;#39;t want the compiler to&amp;nbsp;optimize away the variable&amp;nbsp;you can use&amp;nbsp;volatile when declaring the variable;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/246127/why-is-volatile-needed-in-c"&gt;https://stackoverflow.com/questions/246127/why-is-volatile-needed-in-c&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug BLE "Softdevice"</title><link>https://devzone.nordicsemi.com/thread/273561?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 15:36:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2374be1a-cc10-44cf-b1e0-63ed3572038a</guid><dc:creator>dilbert168</dc:creator><description>&lt;p&gt;my mistake , I meant to refer to &amp;quot;static variable&amp;quot;.&lt;/p&gt;
&lt;p&gt;In below example :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;static ble_evt_t const *p_local_evt;&lt;/p&gt;
&lt;p&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)&lt;br /&gt;{&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; // For readability.&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; p_local_evt = p_ble_evt;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The &amp;quot;p_local_evt&amp;quot; will not able to perform &amp;quot;Quick Watch&amp;quot;.&amp;nbsp; But it works if I removed &amp;quot;static&amp;quot;.&lt;/p&gt;
&lt;p&gt;I know this has nothing to do with Nordic or firmware.&lt;/p&gt;
&lt;p&gt;Just wonder this is known issue in Segger as well... As I am using TI (CCStudio) has same issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug BLE "Softdevice"</title><link>https://devzone.nordicsemi.com/thread/273411?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 09:17:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ca03991-5aa1-44d4-8656-4a57f76e8284</guid><dc:creator>awneil</dc:creator><description>[quote userid="94049" url="~/f/nordic-q-a/66805/debug-ble-softdevice"]debugger cannot be used when &amp;quot;Stop&amp;quot; and &amp;quot;Continue&amp;quot; as BLE Stack is using same CPU to run.&amp;nbsp; Is this still the limitation now ?[/quote]
&lt;p&gt;Yes - you still need the Monitor Mode Debug.&lt;/p&gt;
[quote userid="94049" url="~/f/nordic-q-a/66805/debug-ble-softdevice"]the local variable cannot be added to watch[/quote]
&lt;p&gt;That&amp;#39;s not true.&lt;/p&gt;
&lt;p&gt;However - as for &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt; &lt;/em&gt;modern compiler and &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt; &lt;/em&gt;IDE - you have to beware of compiler optimisation. This is a standard &amp;#39;C&amp;#39; programming thing; not specific to Nordic or Segger - or even embedded.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>