<?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>Use of EXTRA_ZEPHYR_MODULES and custom board within a project with several freestanding apps</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113970/use-of-extra_zephyr_modules-and-custom-board-within-a-project-with-several-freestanding-apps</link><description>Some guidance on this query,please. I have a project with several freestanding application (please check topology below). I would like all the apps to acccess a custom board definition. I use the same zephyr west workspace for several projects so I would</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Aug 2024 12:58:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113970/use-of-extra_zephyr_modules-and-custom-board-within-a-project-with-several-freestanding-apps" /><item><title>RE: Use of EXTRA_ZEPHYR_MODULES and custom board within a project with several freestanding apps</title><link>https://devzone.nordicsemi.com/thread/498639?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2024 12:58:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16a8b5c3-66c6-460d-900b-85b91faf95a7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tried testing this on my end but did not encounter any build errors. I&amp;#39;ve attached the test sample I created. Could you please review it to see&amp;nbsp;what we are doing differently?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/external_5F00_module_5F00_test.zip"&gt;devzone.nordicsemi.com/.../external_5F00_module_5F00_test.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Folder structure:&lt;/p&gt;
&lt;p&gt;external_module_test/&lt;br /&gt;├── hello_world&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── build&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── CMakeLists.txt&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── prj.conf&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── README.rst&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── sample.yaml&lt;br /&gt;│&amp;nbsp;&amp;nbsp; └── src&lt;br /&gt;├── hello_world_1&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── build&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── CMakeLists.txt&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── prj.conf&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── README.rst&lt;br /&gt;│&amp;nbsp;&amp;nbsp; ├── sample.yaml&lt;br /&gt;│&amp;nbsp;&amp;nbsp; └── src&lt;br /&gt;└── my_module&lt;br /&gt; ├── boards&lt;br /&gt; └── zephyr&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of EXTRA_ZEPHYR_MODULES and custom board within a project with several freestanding apps</title><link>https://devzone.nordicsemi.com/thread/498624?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2024 12:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29829b36-3073-4a23-a67d-9d7e9ab116c1</guid><dc:creator>Ignacio</dc:creator><description>&lt;p&gt;Thanks for the prompt reply Vidar. If I try to set the module directly on the proect folder, I get the below error. Is there a way to overcome this? Is it a requirement to place the modules files on a separate directory?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CMake Error at /opt/ncs/v2.6.0/zephyr/CMakeLists.txt:591 (add_subdirectory):
The binary directory

/home/x/git/zephyr_project_sample/source/build

is already used to build a source directory. It cannot be used to build
source directory

/home/x/git/zephyr_project_sample

Specify a unique binary directory name.&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of EXTRA_ZEPHYR_MODULES and custom board within a project with several freestanding apps</title><link>https://devzone.nordicsemi.com/thread/498593?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2024 09:55:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:894e6b77-a613-469e-bcb2-15a94fb00d5f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;beleive&amp;nbsp;you need to specify the absolute path to your zephyr module when setting it from your CMakelists.txt file before find_package().&lt;/p&gt;
&lt;p&gt;e.g.,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION ...
set(EXTRA_ZEPHYR_MODULES &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/../&amp;quot;)

find_package(..&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, &amp;#39;boards&amp;#39; should be a subdirectory of your module directory.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;e.g.,&lt;/p&gt;
&lt;p&gt;my_module/&lt;br /&gt;├── boards&lt;br /&gt;│&amp;nbsp;&amp;nbsp; └── arm&lt;br /&gt;└── zephyr&lt;br /&gt; └── module.yml&lt;/p&gt;
&lt;p&gt;module.yml&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;build:
  settings:
    board_root: .&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another way to use an out-of-tree board without creating a new Zephyr module is to append the path to your board root to the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/develop/application/index.html#boards"&gt;BOARD_ROOT&lt;/a&gt; variable by adding the following line to your CMakeLists.txt file:&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regardless of the approach you use, you may need to&amp;nbsp;specify the board root path in the VS code extension for it to detect your custom board:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/bd_boards_devices.html#finding-new-boards"&gt;https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/bd_boards_devices.html#finding-new-boards&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>