<?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>Out of tree driver sample in</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121961/out-of-tree-driver-sample-in</link><description>Hello 
 I created the out of tree sample sensor application with SDK 2.6.2 and it built just fine However it builds only when it is inside the sdk that was pulled when I selected sample in VSCode 
 My goal is to make it a standalone app with the &amp;quot;drivers</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Jun 2025 22:41:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121961/out-of-tree-driver-sample-in" /><item><title>RE: Out of tree driver sample in</title><link>https://devzone.nordicsemi.com/thread/538322?ContentTypeID=1</link><pubDate>Thu, 05 Jun 2025 22:41:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc362738-55ee-4e55-809f-814c97db4f9e</guid><dc:creator>AndyM</dc:creator><description>&lt;p&gt;Thank you&amp;nbsp;&lt;br /&gt;I&amp;#39;ll give it a try and let you know&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of tree driver sample in</title><link>https://devzone.nordicsemi.com/thread/538065?ContentTypeID=1</link><pubDate>Wed, 04 Jun 2025 13:09:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dcced56-c671-4426-b027-e27edacc7cf8</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;I understand that&amp;#39;s what you want, but not why you want it. I don&amp;#39;t see any&amp;nbsp;technical need that cannot be satisfied with the current setup.&lt;/p&gt;
&lt;p&gt;If I know your blocking points, perhaps I can suggest an easier alternative, or feedback to our teams of a use case.&lt;/p&gt;
&lt;p&gt;Nonetheless, I tried&amp;nbsp;making these change to the ncs-example-application in addition to moving &amp;quot;dts,&amp;quot; &amp;quot;drivers,&amp;quot; and &amp;quot;lib.&amp;quot; It works.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;diff --git a/CMakeLists.txt b/CMakeLists.txt
index b8b7f59..35a37ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,5 +6,5 @@
 
 zephyr_include_directories(include)
 
-add_subdirectory(drivers)
-add_subdirectory(lib)
+add_subdirectory(app/drivers)
+add_subdirectory(app/lib)
diff --git a/Kconfig b/Kconfig
index 3bd03f2..7454873 100644
--- a/Kconfig
+++ b/Kconfig
@@ -5,5 +5,5 @@
 # as the module Kconfig entry point (see zephyr/module.yml). You can browse
 # module options by going to Zephyr -&amp;gt; Modules in Kconfig.
 
-rsource &amp;quot;drivers/Kconfig&amp;quot;
-rsource &amp;quot;lib/Kconfig&amp;quot;
+rsource &amp;quot;app/drivers/Kconfig&amp;quot;
+rsource &amp;quot;app/lib/Kconfig&amp;quot;
diff --git a/zephyr/module.yml b/zephyr/module.yml
index 047032a..e2c722d 100644
--- a/zephyr/module.yml
+++ b/zephyr/module.yml
@@ -17,4 +17,4 @@ build:
     # Zephyr will use the `&amp;lt;dts_root&amp;gt;/dts` for additional dts files and
     # `&amp;lt;dts_root&amp;gt;/dts/bindings` for additional dts binding files. The `.` is
     # the root of this repository.
-    dts_root: .
+    dts_root: app/.
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of tree driver sample in</title><link>https://devzone.nordicsemi.com/thread/537923?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2025 16:38:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae3fc0bc-3f8e-46e2-b754-d341371c610c</guid><dc:creator>AndyM</dc:creator><description>&lt;p&gt;Yes,i would like to keep evertyhing inside the app directory if that&amp;#39;s possible&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of tree driver sample in</title><link>https://devzone.nordicsemi.com/thread/537922?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2025 16:32:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10d98343-3ab2-4ba1-8ab9-0db83d7e9c76</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Andy,&lt;/p&gt;
&lt;p&gt;Are you using &lt;a href="https://github.com/nrfconnect/ncs-example-application/tree/v2.6.2"&gt;the NCS Example Application&lt;/a&gt;, or is it just a naming coincidence?&lt;/p&gt;
&lt;p&gt;I see that your&amp;nbsp;attached project does have a west.yml file, so it seems you indeed are using the example application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In such a case, notice how in the example, there are&amp;nbsp;directories named &amp;quot;drivers,&amp;quot; &amp;quot;lib,&amp;quot; and &amp;quot;dts&amp;quot; on the same level as the &amp;quot;app&amp;quot; directory.&lt;/p&gt;
&lt;p&gt;This is the intended design.&amp;nbsp;Is there any reason why you need those directories inside the &amp;quot;app&amp;quot; directory?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>