<?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>Custom KCONFIG variable with custom board revisions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110092/custom-kconfig-variable-with-custom-board-revisions</link><description>Hi, 
 I&amp;#39;m having an issue getting KCONFIG to work with multiple board revisions. I have defined a custom board. It has all the files needed and we can build product code on that. We are now making some hardware changes and want to have a C flag defined</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Apr 2024 12:39:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110092/custom-kconfig-variable-with-custom-board-revisions" /><item><title>RE: Custom KCONFIG variable with custom board revisions</title><link>https://devzone.nordicsemi.com/thread/478548?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 12:39:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4f2b85e-8510-4ee4-982c-daf02b56e3b5</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;It&amp;#39;s good to know you have got things working satisfyingly. Please close this case at your convenience then. You are welcome to follow up if you ever need help looking into&amp;nbsp;what didn&amp;#39;t work with the other approaches.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom KCONFIG variable with custom board revisions</title><link>https://devzone.nordicsemi.com/thread/478520?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 10:20:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f28fe46-4405-47e5-bfcb-999eccc43f5b</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;I think I found the issue and got it working now. I never paid attention to it but I had spaces around the equals sign in the &amp;quot;CONFIG_APP_TOUCH_PT8041 = y&amp;quot; part. This causes it to fail. It has to be &amp;quot;CONFIG_APP_TOUCH_PT8041=y&amp;quot;. I can&amp;#39;t put anything in the Kconfig.board file without everything breaking in the weirdest ways possible. But putting the definition and default value for the config in the Kconfig.defconfig file works now and I can read the flag in code. As far as I&amp;#39;m concerned this fixes the issue and I have a solution to my problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom KCONFIG variable with custom board revisions</title><link>https://devzone.nordicsemi.com/thread/478518?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 10:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74ff9180-d2a8-4df4-b01e-70085ba4d331</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;I looked at the github code you linked and tried changing mine to be more inline with that. And I think I made progress but everything is still failing. My Kconfig.board now looks like this&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config BOARD_PLANK3
	bool &amp;quot;plank3&amp;quot;

config APP_TOUCH_PT8041
    bool &amp;quot;Board version using the older PT8041 touch chip&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And building versions where I have empty plank3_3_0_x.conf files also works. But if I try to set the&amp;nbsp;CONFIG_APP_TOUCH_PT8041=y in one of the version specific .conf files the build fails with completely unrelated errors.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom KCONFIG variable with custom board revisions</title><link>https://devzone.nordicsemi.com/thread/478517?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 10:07:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3135a113-66fe-4412-becf-cd2248bd13a1</guid><dc:creator>Tiit</dc:creator><description>&lt;p&gt;I can add a custom config to the main kconfig and I can access that in the c code. But doing the same thing through the board revision files fails in all sorts of fun ways. I have no previous kconfig (or any Zephyr/Linux build experience) so I really have no idea how to debug this. Is it possible to privately send you the project files and you can see what is wrong there? I got to a point now where I can build my project successfully for some board versions (where I don&amp;#39;t set&amp;nbsp;APP_TOUCH_PT8041=y) but versions that do set that will fail with completely unrelated issues. Right now I&amp;#39;m getting errors from devicetree, mcuboot and an undefined CONFIG_BOARD error when setting&amp;nbsp;APP_TOUCH_PT8041=y. It does not seem related at all so I&amp;#39;m guessing something is failing in kconfig causing everything to be misconfigured.&lt;/p&gt;
&lt;p&gt;Tiit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom KCONFIG variable with custom board revisions</title><link>https://devzone.nordicsemi.com/thread/478306?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2024 12:03:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4909e29-52d1-4ea2-9a75-c6c3060cb73b</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Tilt,&lt;/p&gt;
&lt;p&gt;Reuven&amp;#39;s&amp;nbsp;tips give a direction to approach this issue by setting up files in the project.&lt;/p&gt;
&lt;p&gt;I think you can also look into&amp;nbsp;setting up revision files for your custom board.&amp;nbsp;I will link the documentation and the implementation we have for the nRF9160 DK below.&lt;/p&gt;
&lt;p&gt;For your case, you likely can just set the default value in the &amp;lt;board&amp;gt;_&amp;lt;revision&amp;gt;.defconfig file.&lt;br /&gt;See:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/zephyr/hardware/porting/board_porting.html#multiple-board-revisions"&gt;Board Porting Guide &amp;mdash; Zephyr Project documentation (nRF Connect SDK) (nordicsemi.com)&lt;/a&gt;&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/v3.5.99-ncs1/boards/arm/nrf9160dk_nrf9160"&gt;sdk-zephyr/boards/arm/nrf9160dk_nrf9160 at v3.5.99-ncs1 &amp;middot; nrfconnect/sdk-zephyr (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For more&amp;nbsp;complex approach, you could also explore the concepts of no-prompt Kconfig, setting Kconfig value in .cmake files, and conditional default value.&lt;br /&gt;See:&amp;nbsp;&lt;a href="https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt"&gt;kernel.org/doc/Documentation/kbuild/kconfig-language.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom KCONFIG variable with custom board revisions</title><link>https://devzone.nordicsemi.com/thread/478152?ContentTypeID=1</link><pubDate>Wed, 10 Apr 2024 22:11:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd647ffa-a999-4a6e-ac4b-5a0c3c3c3357</guid><dc:creator>RM</dc:creator><description>&lt;p&gt;Hi Tiit,&lt;br /&gt;&lt;br /&gt;First you can include additional conf files in the build for the specific revisions, including references to specific kconfig files, you can also have nested kconfig files specific to the subfolders.&lt;br /&gt;&lt;br /&gt;Based on your description, looks like a configuration issue between build script, conf and kconfig files (and of course CMakeFiles). Start by adding custom config with y to project main kconfig and see if you access it in C code, using either #ifdef or #if defined or IS_ENABLED macros.&lt;br /&gt;&lt;br /&gt;Would suggest deriving from a simple sample (Empty project).&lt;br /&gt;&lt;br /&gt;Reuven&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>