<?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>Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115575/own-snippets-in-nrf-connect-for-vs-code</link><description>I have created a Zephyr Snippet (derived from the cdc-acm-console sample). 
 
 I am unable to select it in the Build Configuration. It is listed in the dropbox where the sample snippets are listed. When I add it via Browse, I can only select files, not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Mar 2026 07:30:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115575/own-snippets-in-nrf-connect-for-vs-code" /><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/563281?ContentTypeID=1</link><pubDate>Mon, 16 Mar 2026 07:30:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4029d09-5dc7-46b2-baad-fe5677764f91</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I will report it to our VS Code team.&amp;nbsp;&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><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/563256?ContentTypeID=1</link><pubDate>Sun, 15 Mar 2026 08:04:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65ba94c3-7fe3-4376-8bd5-9b130d3d5f55</guid><dc:creator>Monkeytronics</dc:creator><description>&lt;p&gt;OK. Must be the reload window that was missing... Couldn&amp;#39;t you make it so that this step is not necessary. In my frustration to make progress, I spent time figuring out how to bring in conf files directly through cmake instead. Which works fine as it happens. I think I &amp;#39;ll stick with that as it does not require that I remember any&amp;nbsp;magic steps or&amp;nbsp;incantations to work.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/563090?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2026 10:10:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f348c578-0dac-4bce-9ba6-e9c7433685bb</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, so I tested now, copied a snippet (used the hw-flow-control found in NCS\nrf\snippets), created a folder named &amp;quot;snippets&amp;quot; in my application folder, and pasted the snippet in there. I renamed the folder &amp;quot;my-hw-flow-control&amp;quot; (from hw-flow-control), and changed the name of the snippet inside snippet.yml from:&lt;/p&gt;
&lt;p&gt;name: hw-flow-control&lt;br /&gt;to&lt;br /&gt;name: my-hw-flow-control&lt;/p&gt;
&lt;p&gt;After this, you need to restart VS Code for it to reload the snippets in your applications (or you can use the reload window option by pressing ctrl+shift+p, and enter the command &amp;quot;reload window&amp;quot; and hit enter).&lt;/p&gt;
&lt;p&gt;Then the custom snippet &amp;quot;my-hw-flow-control&amp;quot; should appear in the list.&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><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/563066?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2026 01:35:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59ce534f-26ac-41e9-b97e-fc50d62f0996</guid><dc:creator>Monkeytronics</dc:creator><description>&lt;p&gt;Just have a go replicating what I describe. I&amp;#39;m sure a zephyr expert could get this working in 5 minutes. If there is an issue in how the nordic sdk handles the build process, it should become apparent for you as it has for me. Equally, if I&amp;#39;ve missed an obvious step, it might be worth documenting it for future.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/562995?ContentTypeID=1</link><pubDate>Wed, 11 Mar 2026 08:13:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e58d54d5-a8ea-43fe-908e-ac582c2f3114</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Monkeytronics"]After I get it working, mysnippet appears from that point on in the drop down! Which is just priceless.[/quote]
&lt;p&gt;Can you please describe what exactly you needed to get working in order to do this? I agree that it shouldn&amp;#39;t be that troublesome to add this, but if you can guide me to get this working locally, it would be easier to point our developers in the right direction.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it possible to upload an application with a custom snippet that appears in the drop down? And some guide to hhow you got it to work? (I have not tried this since the last time there was activity in this ticket, which was back in October 2024).&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><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/562970?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2026 23:14:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b92f3ad-3488-457a-a74b-2b063de10a71</guid><dc:creator>Monkeytronics</dc:creator><description>&lt;p&gt;Would I be right in saying this still doesn&amp;#39;t work?&lt;/p&gt;
&lt;p&gt;In my case, I&amp;#39;m even happy to accept putting snippets directly in the applcation folder. But that&amp;#39;s not working for me either.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Based on reading the zephyr docs on the subject of snippets and the SNIPPET_ROOT, I would expect to be&amp;nbsp;save snippets as eg -&amp;nbsp;{app folder}/snippets/{board}/snippets.yml.&amp;nbsp; I even went to the trouble of explicitly adding the app root to the SNIPPET_ROOT variable (which Ithink whould actually be set by default), and verified that it was correct. But even with all of that, my custom snippets do NOT appear in the build configuration drop down.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have no idea whether it&amp;#39;s relevant, but the snippets list is empty in .vscode-nrf-connect.json file inside the build folder. Obviously this is a generated file, so only mention as evidence.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Searching around the build folder, I actually notice that my custom snippet appears in the snippets_generated.json in {build}/{app}/zephyr/&amp;nbsp; &amp;nbsp; &amp;nbsp; However, obviously this has no effect on the nrf connect&amp;#39;s ability to correctly pick this up and add it to the build configuration drop down.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Would be great if this stuff was easier.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;UPDATE&lt;/p&gt;
&lt;p&gt;------------&lt;/p&gt;
&lt;p&gt;Adding -DSNIPPET=mysnippet adds the snippet - but it breaks due to multi-image build.&lt;/p&gt;
&lt;p&gt;-D1-air_SNIPPET=mysnippet works. And limits the application&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After I get it working, mysnippet appears from that point on in the drop down! Which is just priceless. Could you put your heads together and fix this. The whole point of your extension is so that developers don&amp;#39;t need to be experts in zephyr and cmake.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/506731?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 13:06:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ef42474-5823-49ea-8288-0e6f38d3003c</guid><dc:creator>mabe</dc:creator><description>&lt;p&gt;Great news. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/506725?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 12:43:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3cff99f-965e-4215-9aae-7eb4c71c7f2b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I should mention that discussing this with our extension developers, they realized that the browse functionality that you referred to isn&amp;#39;t working as intended. They will try to fix it for the next version &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; If that works as intended, you should be able to store your snippets anywhere, and select them from that menu.&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><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/506722?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 12:37:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8882a81e-dfc9-48b0-b772-0cd91d96cfcd</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Yes, I saw. It is also possible to add it to your application root folder (the application that you are working in).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I found it by looking in the ncs\zephyr\cmake\modules\snippets.cmake, and saw that it mentioned &amp;quot;APPLICATION_SOURCE_DIR&amp;quot;.&lt;/p&gt;
&lt;p&gt;I guess the question is how to use this outside the application folder (because I imagine you would want to have a folder where you keep all your snippets), and outside the SDK (to keep it pristine). That is where it becomes a little more tricky.&lt;/p&gt;
&lt;p&gt;If your application is part of a &lt;a href="https://docs.zephyrproject.org/latest/develop/modules.html#modules-external-projects"&gt;Zephyr Module&lt;/a&gt;, then it is possible to add your own snippet root when including it in your build system:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/develop/modules.html#build-settings"&gt;https://docs.zephyrproject.org/latest/develop/modules.html#build-settings&lt;/a&gt;&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><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/506694?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 11:10:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d00be631-8ba9-43aa-aabd-72459c5fd993</guid><dc:creator>mabe</dc:creator><description>&lt;p&gt;Just putting the snippet into&amp;nbsp;&lt;span&gt;ncs\zephyr\snippets makes it available in the selection box. Might require a restart of VScode. Did not verify.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Own snippets in nRF Connect for VS Code</title><link>https://devzone.nordicsemi.com/thread/506644?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 08:17:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70aa3702-a13f-413b-931f-7c02ccd5cd86</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes, I see what you are seeing. I will ask our developers how this is supposed to work, and how you can add snippets outside the NCS folder.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q1: Where are you currently storing your snippet? In a folder inside NCS or outside?&lt;/p&gt;
&lt;p&gt;Q2: Can you try storing it either in ncs\nrf\snippets, or in ncs\zephyr\snippets, and then use the the additional &amp;quot;Extra CMake argument&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;-DSNIPPET=&amp;quot;oppo-serial&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Like this:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1729152985296v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Does that work with your snippet?&lt;/p&gt;
&lt;p&gt;I know it is not ideal, but in the meantime I will try to figure out if it is possible to add snippets from outside the SDK folder, and how to do it in VS Code.&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>