<?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 custom Kconfig options in defconfig of custom board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96519/use-custom-kconfig-options-in-defconfig-of-custom-board</link><description>Greetings, 
 
 I have defined some custom Kconfig options for our custom FW ( custom device and board) which I use in my prj.config file successfully (Located in C:/ncs/project_dir/ project _dir /src and also some subdirectories of this) and was wondering</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Aug 2023 02:47:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96519/use-custom-kconfig-options-in-defconfig-of-custom-board" /><item><title>RE: Use custom Kconfig options in defconfig of custom board</title><link>https://devzone.nordicsemi.com/thread/439586?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2023 02:47:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ade2257-2bd2-4b6f-b16c-75433c1cc009</guid><dc:creator>jhc</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use &lt;code&gt;r&lt;span&gt;source &amp;quot;src/Kconfig&amp;quot; instead.&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;An&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;rsource&lt;/span&gt;&lt;/code&gt;&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;statement is available for including files specified with a &lt;strong&gt;relative path&lt;/strong&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use custom Kconfig options in defconfig of custom board</title><link>https://devzone.nordicsemi.com/thread/409959?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2023 21:43:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b3e1b46-437c-4620-b765-857ac85051de</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;If you mean to have them in the app, you need to source them from their src/Kconfig file.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;a title="https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/kconfig" href="https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/Kconfig" rel="noopener noreferrer" target="_blank"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/Kconfig&lt;/a&gt; shows how to source other Kconfigs but the board should not be sourcing the application&amp;#39;s Kconfig files, the board should source its own files only, the application should source its own files only.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;-Amanda H.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use custom Kconfig options in defconfig of custom board</title><link>https://devzone.nordicsemi.com/thread/409392?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2023 15:37:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34b12415-f711-4b0a-8500-d429853480b1</guid><dc:creator>clockis</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you very much for the quick response.&lt;/p&gt;
&lt;p&gt;I may have not been able to explain myself correctly.&lt;/p&gt;
&lt;p&gt;What I actually meant is that I have already created custom configuration options(Kconfig files for different modules inside my source code directory) but I want to use those same custom configuration options&amp;nbsp;in my custom_board Kconfig file and .defconfg file.&lt;/p&gt;
&lt;p&gt;Here is my project&amp;#39;s file structure just to give you a more clear picture:&lt;/p&gt;
&lt;pre&gt;+- &amp;lt;Project_directory&amp;gt;&lt;br /&gt; +- boards&lt;br /&gt; | +- arm&lt;br /&gt; |   +- &amp;lt;custom_board&amp;gt;&lt;br /&gt; |     +- Kconfig&lt;br /&gt; |     +- Kconfig.board&lt;br /&gt; |     +- Kconfig.defconfig&lt;br /&gt; |     +- &amp;lt;custom_board&amp;gt;.dts&lt;br /&gt; |     +- &amp;lt;custom_board&amp;gt;.defconfig&lt;br /&gt; +- src&lt;br /&gt;   +- Kconfig&lt;br /&gt;   +- Kconfig.app_info&lt;br /&gt;   +- Kconfig.fw_version&lt;br /&gt;   +- Kconfig.hw_version&lt;br /&gt;   +- modules&lt;br /&gt;   | +- Kconfig&lt;br /&gt;   | +- Kconfig.something&lt;br /&gt;   | +- Kconfig.something_else&lt;br /&gt;   +- protocols&lt;br /&gt;   | +- Kconfig&lt;br /&gt;   | +- Kconfig.something&lt;br /&gt;   | +- Kconfig.something_else&lt;br /&gt;   +- sensors&lt;br /&gt;   | +- Kconfig&lt;br /&gt;   | +- Kconfig.something&lt;br /&gt;   | +- Kconfig.something_else&lt;/pre&gt;
&lt;p&gt;Every Kconfig file in the &amp;quot;src&amp;quot; directory has been created and has all the custom configuration options needed for our application. Also we have successfully included them in the prj.conf file and the application code. The application has been built successfully and works great using these new custom configuration options we created.&lt;/p&gt;
&lt;p&gt;Now I want to use these custom configuration options(that already exist in the src directory and subdirectories) in the &amp;lt;custom_board&amp;gt;.defconfig file so I tried using a command like:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;source&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;$(PROJECT_DIR)/feel_v2_fw/src/Kconfig&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;in the &amp;lt;Project_directory&amp;gt;/boards/arm/&amp;lt;custom_board&amp;gt;/&lt;/span&gt;&lt;/span&gt;Kconfig.defconfig and the &lt;span&gt;&amp;lt;Project_directory&amp;gt;/boards/arm/&amp;lt;custom_board&amp;gt;/&lt;/span&gt;Kconfig file inside the board directory but with no success.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;How do I include a file in my Kconfig that is in a different directory (not a sub directory).&lt;/div&gt;
&lt;div&gt;I want include the Kconfig custom options I have already created:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;lt;Project_directory&amp;gt;/src/&lt;/span&gt;&lt;span&gt;Kconfig ,&amp;nbsp;&amp;lt;Project_directory&amp;gt;/src/modules/Kconfig ,&amp;nbsp;&amp;lt;Project_directory&amp;gt;/src/protocols/Kconfig ,&amp;nbsp;&amp;lt;Project_directory&amp;gt;/src/sensors/Kconfig&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;in the&amp;nbsp;&amp;lt;Project_directory&amp;gt;/boards/arm/&amp;lt;custom_board&amp;gt;/Kconfig&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I want to include the options residing in the src folder and subfolders without having to rewrite a multitude of files again in the Kconfig.defconfig file&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;what Kconfig command or preprocessor directive do I need to use to successfully include them in my&amp;nbsp;&lt;span&gt;&amp;lt;Project_directory&amp;gt;/boards/arm/&amp;lt;custom_board&amp;gt;/&lt;/span&gt;&lt;span&gt;Kconfig file which is in a different directory?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thank you very much and I look forward to hearing from you!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Stavros&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use custom Kconfig options in defconfig of custom board</title><link>https://devzone.nordicsemi.com/thread/409378?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2023 14:13:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:457cdb1f-f8de-41bb-bf3e-391bbe39c500</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;You can add it to your board file, to one of the Kconfig files or the _defconfig file.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;For example here, adding a custom option: &lt;a title="https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/kconfig#l25" href="https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/Kconfig#L25" rel="noopener noreferrer" target="_blank"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/Kconfig#L25&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then change other options if that is enabled: &lt;a title="https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/kconfig.defconfig#l27" href="https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/Kconfig.defconfig#L27" rel="noopener noreferrer" target="_blank"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/Kconfig.defconfig#L27&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And configuration items that are always applied: &lt;a title="https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig" href="https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig" rel="noopener noreferrer" target="_blank"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>