<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>some trouble in VSC</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/87713/some-trouble-in-vsc</link><description>Hi, all 
 
 I have some issues about developing on nRF connect SDK with VSCode: 
 
 Go to definition for macro always jumps to the wrong place. For example, BT_DATA_BYTES would go to definition BT_DATA in bluetooth.h, that makes me crazy. 
 NRF TERMINAL</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Wed, 18 May 2022 10:42:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/87713/some-trouble-in-vsc" /><item><title>RE: some trouble in VSC</title><link>https://test-devzone.nordicsemi.com/thread/368283?ContentTypeID=1</link><pubDate>Wed, 18 May 2022 10:42:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:646f119f-06fe-43f5-bbd0-f7f184a29183</guid><dc:creator>user26071</dc:creator><description>&lt;p&gt;I got some feedback from our nRF Connect for Visual Studio Code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding the extra CMake arguments:&lt;/p&gt;
&lt;p&gt;The recommended way to do this is through the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;tt&gt;target_compile_definitions&lt;/tt&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;cmake command in CMakeLists.txt, although they can pass them in the &amp;quot;Extra CMake arguments&amp;quot; as well.&lt;/p&gt;
&lt;p&gt;In cmake, they&amp;#39;ll need to set up a flag that controls the behavior - for instance &amp;quot;APP_DBG_LEVEL&amp;quot;. Then, in their cmake code, they can check this flag, and activate other settings or behavior depending on the value. Like explained in this Stack overflow answer, for instance:&amp;nbsp;&lt;a class="external-link" href="https://stackoverflow.com/a/48984477/2495121" rel="nofollow noopener noreferrer" target="_blank"&gt;https://stackoverflow.com/a/48984477/2495121&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here, he added a flag called&amp;nbsp;&lt;tt&gt;USE_MY_LIB&lt;/tt&gt;&amp;nbsp;to control compilation flags and other things. The &amp;quot;unset()&amp;quot; in the last line of his snippet isn&amp;#39;t technically required for this scenario.&lt;/p&gt;
&lt;p&gt;Where the snippet in that answer says &amp;quot;#add some compilation flags&amp;quot;, they could for instance do&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;target_compile_definitions(app PRIVATE ABC=5)&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;which creates a define called &amp;quot;ABC&amp;quot; that can be referenced in the source code.&lt;/p&gt;
&lt;p&gt;This way, they don&amp;#39;t need to specify -DCMAKE_C_FLAGS=&amp;quot;-DABC=5&amp;quot; on the command line to get the expected behavior, but could enable different configuration types through more understandable command line flags, if required.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;They also mentioned that they are considering to add the possibility to add/remove CMake flags, but I don&amp;#39;t know when/if that will be released.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: some trouble in VSC</title><link>https://test-devzone.nordicsemi.com/thread/366908?ContentTypeID=1</link><pubDate>Mon, 09 May 2022 11:43:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83390704-fc6a-403c-8673-46ea8ee7699f</guid><dc:creator>user26071</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]&lt;span&gt;&lt;strong&gt;Go to definition&lt;/strong&gt; for &lt;strong&gt;macro&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;always jumps to the wrong place. For example,&amp;nbsp;&lt;span&gt;&lt;em&gt;&lt;strong&gt;BT_DATA_BYTES&lt;/strong&gt; &lt;/em&gt;would go to definition&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;BT_DATA&lt;/strong&gt; &lt;/em&gt;in bluetooth.h, that makes me crazy.[/quote]
&lt;p&gt;I agree that this is annoying, but the nRF Connect for VS Code is using some built in modules from VS Code, and these are the ones returning the wrong locations. I believe that our team is looking into this.&lt;/p&gt;
[quote user=""]&amp;nbsp;&lt;span&gt;&lt;strong&gt;NRF TERMINAL&lt;/strong&gt;&amp;nbsp;stops&amp;nbsp;working when I&amp;nbsp;&lt;strong&gt;Flash&lt;/strong&gt; the chip and can&amp;#39;t reconnect automatically.&amp;nbsp;&lt;/span&gt;&lt;span&gt;But it works in SES.&lt;/span&gt;[/quote]
&lt;p&gt;Yes. RTT Viewers (Like Segger&amp;#39;s RTT Viewer and the one in nRF Connect for VS code will disconnect when you flash the chip. The reason it works &amp;quot;seamlessly&amp;quot; in SES is that it automatically reconnects when it is done flashing (not surprisingly, since this is Segger&amp;#39;s own IDE). I will request this feature from our developers.&lt;/p&gt;
[quote user=""]How to add extra Cmake arguments, for example, I want to add&lt;em&gt; set&lt;span&gt;(&lt;/span&gt;CMAKE_CXX_FLAGS&amp;nbsp;&lt;span&gt;&amp;quot;-O3 -Wall -Wextra&amp;quot;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/em&gt;[/quote]
&lt;p&gt;You can add extra CMake arguments when you create a new build configuration in nRF Connect for VS Code. Unfortunately, there is no way to add extra arguments without creating a new build configuration at this point in time.&lt;/p&gt;
[quote user=""]When using &lt;strong&gt;KConfig&lt;/strong&gt; to search for something, and &lt;em&gt;&lt;strong&gt;Jump to item&lt;/strong&gt;&lt;/em&gt;, it&amp;#39;s hard for me to find the item since there&amp;#39;s not any highlight for it.[/quote]
&lt;p&gt;Noted this one as well.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;General: Thank you for your feedback. Some of these I have noticed myself, as I use nRF Connect for VS Code daily, but it is always good to get feedback from other users, so that we can forward it to our developers. I will forward this entire post to our nRF Connect for VS Code development team.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>