<?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>Debugging from VSCode with nRF Connect Extension</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87579/debugging-from-vscode-with-nrf-connect-extension</link><description>Hello, I&amp;#39;m having problems to debug my application when I check the &amp;quot;Enable debug options&amp;quot; in the build configuration. If I don&amp;#39;t check this box, I can debug, however, most of the break points are ignored and most of the variables are optimized, making</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 May 2022 10:22:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87579/debugging-from-vscode-with-nrf-connect-extension" /><item><title>RE: Debugging from VSCode with nRF Connect Extension</title><link>https://devzone.nordicsemi.com/thread/366672?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 10:22:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56860b2d-9d56-4d18-b573-874fb48393d3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see, that is the latest. I have not been able to reproduce myself and have not found any other reports of this. Are there other factors that are need to reproduce this? Also, which Linux distribution (and version of it) are you using?&lt;/p&gt;
&lt;p&gt;For now, enabling debug options in the project configuration file or&amp;nbsp;just adding &amp;quot;&lt;code&gt;-DCONFIG_DEBUG_OPTIMIZATIONS=y&lt;/code&gt;&amp;quot; as an extra CMake argument when you make a build configuration in VS Code should be a good workaround.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging from VSCode with nRF Connect Extension</title><link>https://devzone.nordicsemi.com/thread/366519?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 14:09:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f968b4e-9788-4b53-9989-9ef4bd620755</guid><dc:creator>diogodias</dc:creator><description>&lt;p&gt;2022.4.219&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging from VSCode with nRF Connect Extension</title><link>https://devzone.nordicsemi.com/thread/366518?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 14:08:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba85624e-6dbc-4bdf-a87e-4365438b0862</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Which version is nRF Connect for VS Code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging from VSCode with nRF Connect Extension</title><link>https://devzone.nordicsemi.com/thread/366516?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 14:03:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c99620db-979c-45ba-9298-37ab9693ba6c</guid><dc:creator>diogodias</dc:creator><description>&lt;p&gt;No problem.&amp;nbsp;&lt;br /&gt;Nothing happens, it just gets stuck in&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;quot;Debugger requested to halt target...&amp;quot; and the debugger doesn&amp;#39;t start.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My vscode version is 1.66.2 and nRF Connect Exntension Pack is v2021.9.1.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging from VSCode with nRF Connect Extension</title><link>https://devzone.nordicsemi.com/thread/366512?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 13:57:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ed228ab-9ee3-4fb9-a78b-fdd327ebe809</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Ah, sorry. I misread your question. No, you should be able to debug with the checkbox checked.&amp;nbsp;I do not see anything obviously wrogn when browsing through the log in your original post. What happens when you try to debug with the&amp;nbsp;&amp;quot;Enable debug options&amp;quot; box checked? And which VS Code version and version of the nRF plugins do you use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging from VSCode with nRF Connect Extension</title><link>https://devzone.nordicsemi.com/thread/366507?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 13:52:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d167716-8038-4107-ac08-631c1472a2c1</guid><dc:creator>diogodias</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for your response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes, I&amp;#39;m aware of code optimization and that it makes debug harder.&amp;nbsp; With the&amp;nbsp;&lt;span&gt;CONFIG_DEBUG_OPTIMIZATIONS=y I was able to properly debug and my &amp;quot;problem&amp;quot; is solved. However, just out of curiosity, do you know why I cant debug the board if I check the&amp;nbsp;&amp;quot;Enable debug options&amp;quot; in the build configuration? As you can see in the code that I posted, I get stuck in &amp;quot;Debugger requested to halt target...&amp;quot;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging from VSCode with nRF Connect Extension</title><link>https://devzone.nordicsemi.com/thread/366417?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 11:02:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba343e3e-e382-4ac9-84a9-afe9f6a0be5c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is a general concept that compilers will do code optimization if configured to do so, and for release builds you typically always enable optimization. This can&amp;nbsp;of course on speed, code size, etc. This changes the machine code so that it does not&amp;nbsp;exactly map the C code, so it makes debugging harder. Therefor you often want to disable&amp;nbsp;optimization when you debug. The&amp;nbsp;&amp;quot;Enable debug options&amp;quot; in nRF Connect for VS Code causes&amp;nbsp;optimization to be disabled, and also sets a few other options to&amp;nbsp;further aid&amp;nbsp;debugging VS code. If you want to permanently disable&amp;nbsp;optimization you can do that, for instance by adding&amp;nbsp;&lt;span&gt;&lt;code&gt;CONFIG_DEBUG_OPTIMIZATIONS=y&lt;/code&gt; to your prj.conf. See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/71059/how-to-set-optimisation-level-in-ses-5-34a-nordic-version/292018#292018"&gt;this post&lt;/a&gt; for more.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>