<?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>Including custom zephyr module</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109063/including-custom-zephyr-module</link><description>Hello, 
 We are developing a custom Zephyr module that we would like to include into multiple projects. 
 After a lot of testing and debugging we ran into a very weird issue that we cannot explain. 
 The module looks like this: 
 
 Where the CMakeLists</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Mar 2024 14:42:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109063/including-custom-zephyr-module" /><item><title>RE: Including custom zephyr module</title><link>https://devzone.nordicsemi.com/thread/473473?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2024 14:42:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c446fbb-4881-4b91-9970-ab20818b9399</guid><dc:creator>Torsten Rasmussen</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;It does indeed try to build the module without needing the&amp;nbsp;EXTRA_ZEPHYR_MODULES. Can it be possible that the build order is different when using it through the west manifest compared to the&amp;nbsp;EXTRA_ZEPHYR_MODULES?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;yes, the build order is different.&lt;br /&gt;Zephyr modules provided with `EXTRA_ZEPHYR_MODULES` are processed after `ZEPHYR_MODULES`.&lt;br /&gt;In general `ZEPHYR_MODULES` are obtained by `west list` but can also be provided as build argument.&lt;br /&gt;&lt;br /&gt;Therefore, when `test-module` is in the manifest at the location you present, then I assume that it comes first in the list (second in case your manifest project is also a Zephyr module)&lt;/p&gt;
&lt;p&gt;In general it is wise to have Zephyr modules self-contained, however this is not always possible, and in situations where a Zephyr module depends on other modules, then one should add `depends:` to the module.yml file.&lt;/p&gt;
&lt;p&gt;For example the following will add a dependency between your module `and hal_nordic`:&lt;/p&gt;
&lt;pre&gt;name: test-module&lt;br /&gt;&lt;br /&gt;build:&lt;br /&gt;&amp;nbsp; depends:&lt;br /&gt;&amp;nbsp; - hal_nordic&lt;br /&gt;&amp;nbsp; cmake: .&lt;br /&gt;&amp;nbsp; kconfig: ./library/Kconfig&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/develop/modules.html#zephyr-module-dependencies"&gt;docs.zephyrproject.org/.../modules.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including custom zephyr module</title><link>https://devzone.nordicsemi.com/thread/472990?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2024 14:57:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1737bc2b-8c5f-4add-93ee-954bce48b3c1</guid><dc:creator>Henrico Brom</dc:creator><description>&lt;p&gt;Hi Dejan,&lt;/p&gt;
&lt;p&gt;I just tried your suggestion and removing the &lt;span&gt;EXTRA_ZEPHYR_MODULES does not seem to be the trick unfortunately. When I remove this line and add the submodule again in the west manifest, it fails with the same errors as in my original question.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; It does indeed try to build the module without needing the&amp;nbsp;EXTRA_ZEPHYR_MODULES. Can it be possible that the build order is different when using it through the west manifest compared to the&amp;nbsp;EXTRA_ZEPHYR_MODULES?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Henrico&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including custom zephyr module</title><link>https://devzone.nordicsemi.com/thread/472983?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2024 14:29:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59ab0f06-7f8c-4731-855e-8b178012d669</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;You should use either west manifest or EXTRA_ZEPHYR_MODULES variable. If you want that your module gets included in the west update, you could try to remove EXTRA_ZEPHYR_MODULES line from your CMakeLists.txt file.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>