<?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 multiple set-value and priority</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96596/kconfig-multiple-set-value-and-priority</link><description>I would like to know the behavior when multiple Kconfig value settings are defined. Settings are made in the following three places. (app directory) Setting value of NRFX_GPIOTE_NUM_OF_EVT_HANDLERS 1. Kconfig config NRFX_GPIOTE_NUM_OF_EVT_HANDLERS default</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 19 Feb 2023 05:09:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96596/kconfig-multiple-set-value-and-priority" /><item><title>RE: Kconfig multiple set-value and priority</title><link>https://devzone.nordicsemi.com/thread/410750?ContentTypeID=1</link><pubDate>Sun, 19 Feb 2023 05:09:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d3c0766-2d59-4967-bb53-32095ffc5393</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;OK.Thanks.&lt;/p&gt;
&lt;p&gt;I found that you can specify multiple files in the CONF_FILE variable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kconfig multiple set-value and priority</title><link>https://devzone.nordicsemi.com/thread/409750?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2023 07:51:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eebc28f-ebee-4b71-b350-4545ddd9cc81</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="loquat"]I want to set priority following,&lt;br /&gt;1.prj.conf&lt;br /&gt;2.CMakeLists.txt&lt;br /&gt;3. Kconfig &amp;quot;default&amp;quot; keyword.[/quote]
&lt;p&gt;Then you set it like I showed in the edited initial response:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

...

set(CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS 4 CACHE INTERNAL &amp;quot;&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
[quote user="loquat"]What I ended up wanting to do is load multiple proj.confs.[/quote]
&lt;p&gt;You can&amp;nbsp;use &amp;quot;OVERLAY_CONFIG&amp;quot; variable to do this. Read about it here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/3.2.0/develop/application/index.html#important-build-system-variables"&gt;https://docs.zephyrproject.org/3.2.0/develop/application/index.html#important-build-system-variables&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="loquat"]Myapps/Kconfig can not override default value?[/quote]
&lt;p&gt;No, you cannot redefine a already existing kconfig entry, but you can&amp;nbsp;set a dependency on your own defined symbol:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;depends on SYMBOL &amp;gt;= VALUE&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/3.2.0/build/kconfig/index.html"&gt;https://docs.zephyrproject.org/3.2.0/build/kconfig/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kconfig multiple set-value and priority</title><link>https://devzone.nordicsemi.com/thread/409676?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 16:08:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd59e61a-dbdd-4136-afec-beea7acf5eba</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;I want to set priority following,&lt;br /&gt;1.prj.conf&lt;br /&gt;2.CMakeLists.txt&lt;br /&gt;3. Kconfig &amp;quot;default&amp;quot; keyword.&lt;br /&gt;&lt;br /&gt;Where should I describe it in CMakeLists.txt, is it possible?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And one more question.&lt;/p&gt;
&lt;p&gt;Myapps/Kconfig can not override default value?&lt;/p&gt;
&lt;p&gt;I try,&lt;/p&gt;
&lt;p&gt;MyApps/Kconfig&lt;br /&gt;config BT_EXT_ADV_MAX_ADV_SET&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;default 4&lt;/p&gt;
&lt;p&gt;But, .config is&lt;br /&gt;CONFIG_BT_EXT_ADV_MAX_ADV_SET=1&lt;br /&gt;(BT_EXT_ADV_MAX_ADV_SET&amp;#39; default value defined &amp;#39;1&amp;#39; by zephyr/subsys/bluetooth/Kconfig.adv)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What I ended up wanting to do is load multiple proj.confs.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Is there any way?&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kconfig multiple set-value and priority</title><link>https://devzone.nordicsemi.com/thread/409664?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 15:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e2f09d0-1f84-4d0c-a11f-c5a1f6f19c34</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You&amp;#39;re right. It depends on where you place it in the CMakeLists.txt file.&lt;/p&gt;
&lt;p&gt;If you place the set(..) before the find_package(..) line, the ordering will change&amp;nbsp;to what you have now.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll update my original answer.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kconfig multiple set-value and priority</title><link>https://devzone.nordicsemi.com/thread/409658?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 15:17:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e000e96f-fd72-4c77-93bb-f964aa7f2633</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;Realy?&lt;/p&gt;
&lt;p&gt;I try on scan_adv project&lt;/p&gt;
&lt;p&gt;Kconfig&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;source &amp;quot;Kconfig.zephyr&amp;quot;

config NRFX_GPIOTE_NUM_OF_EVT_HANDLERS
	default 2
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;CMakeLists.txt&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)

set(CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS 4 CACHE INTERNAL &amp;quot;&amp;quot;)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(scan_adv)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS=8
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;The expected setting value is&lt;br /&gt;CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS=8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;but actually&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS=4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;what am i doing wrong?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kconfig multiple set-value and priority</title><link>https://devzone.nordicsemi.com/thread/409561?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 11:48:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d406809-71df-44f5-bd86-e3f1677a5201</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The value set in the application sets precedence:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/3.1.0/build/kconfig/setting.html#the-initial-configuration"&gt;https://docs.zephyrproject.org/3.1.0/build/kconfig/setting.html#the-initial-configuration&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But; The CMakeLists.txt ordering also has an effect.&lt;/p&gt;
&lt;p&gt;If this is your CMakeLists.txt:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)

set(CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS 4 CACHE INTERNAL &amp;quot;&amp;quot;)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then the ordering is:&lt;/p&gt;
&lt;p&gt;1. CMakeLists.txt&lt;/p&gt;
&lt;p&gt;2. prj.conf&lt;/p&gt;
&lt;p&gt;3. Kconfig &amp;quot;default&amp;quot; keyword.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you switch the lines, so that find_package is first:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

set(CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS 4 CACHE INTERNAL &amp;quot;&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then it will be:&lt;/p&gt;
&lt;p&gt;1. prj.conf&lt;/p&gt;
&lt;p&gt;2. CMakeLists.txt&lt;/p&gt;
&lt;p&gt;3. Kconfig &amp;quot;default&amp;quot; keyword.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>