<?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>Kconfig and prj.conf question</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79660/kconfig-and-prj-conf-question</link><description>Hi, 
 
 I was looking at this page https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_modifying.html and saw the following line: 
 
 &amp;quot;When building your application, the different Kconfig and *_defconfig files and the prj.conf file are</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Sep 2021 23:55:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79660/kconfig-and-prj-conf-question" /><item><title>RE: Kconfig and prj.conf question</title><link>https://devzone.nordicsemi.com/thread/329693?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 23:55:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e530178-67a1-484a-bd38-99003b86b5b0</guid><dc:creator>alvin.le</dc:creator><description>&lt;p&gt;Thank you for your detailed response!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kconfig and prj.conf question</title><link>https://devzone.nordicsemi.com/thread/329692?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 23:54:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb797fef-d9ab-4639-805f-fedbe5649dd6</guid><dc:creator>alvin.le</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kconfig and prj.conf question</title><link>https://devzone.nordicsemi.com/thread/329539?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 07:27:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ab52008-aa78-4049-bc11-6e5c0e63176c</guid><dc:creator>duyanh.y4n</dc:creator><description>&lt;p&gt;Hi, according to my experience working with zephyr, the priority from lowest to highest is as follows (configs in lower priority files will be overwritten by the higher ones):&lt;/p&gt;
&lt;p&gt;Kconfig -&amp;gt; *_defconfig -&amp;gt;prj.conf&lt;/p&gt;
&lt;p&gt;If we read the build log, we can see that sequence above is exactly the appearing sequence of those files when compiling built binaries. (Kconfig files are read firstly, then the *_defconfig, then the prj.conf)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think it would be helpful when we also understand the purpose of each file:&lt;/p&gt;
&lt;p&gt;- Kconfig: config definitions (default values may be given, however, is optional) - we can not redefine configs here if they are defined somewhere else.&lt;/p&gt;
&lt;p&gt;- *_defconfig: default configs - we assign the default config values for our new hardware platform in this file.&lt;/p&gt;
&lt;p&gt;- prj.conf: application configs - we assign the config values for our application, which contain the main function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kconfig and prj.conf question</title><link>https://devzone.nordicsemi.com/thread/329538?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 07:15:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8e44826-832f-43aa-aca8-ae586cf6cc65</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
[quote user=""]When the files are merged together, which of the three files are prioritized?[/quote]
&lt;p&gt;&amp;nbsp;Have a look at the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.1/zephyr/guides/build/index.html#build-overview"&gt;Zephyr documentation on Build overview&lt;/a&gt;&amp;nbsp;and the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.1/zephyr/guides/kconfig/index.html#kconfig"&gt;Kconfig documentation.&lt;/a&gt;&amp;nbsp;The latter explains what order the different &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.1/zephyr/guides/kconfig/setting.html#the-initial-configuration"&gt;configuration files are merged under The initial configuration&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]How do you decide which variables are put into Kconfig and&amp;nbsp;which are put into prj.conf?[/quote]
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.1/zephyr/guides/kconfig/tips.html#kconfig-tips-and-best-practices"&gt;Kconfig - Tips and best practices&lt;/a&gt; gives a good overview of this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>