<?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 board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112269/custom-board-revision-extension-with-new-zephyr-hardware-model</link><description>I&amp;#39;m upgrading from SDK version v2.4 to v2.7 which introduces the new Zephyr hardware model and I&amp;#39;m struggling with the transition. I have two custom revisions is based off of the nrf5340dk: 
 In my v2.4 project I added the following to my CMakeLists.txt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jun 2024 12:39:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112269/custom-board-revision-extension-with-new-zephyr-hardware-model" /><item><title>RE: Custom board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/thread/490640?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2024 12:39:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b936f90d-df23-486d-b850-c5cdf00f40c3</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Would you like to also check this with &lt;a href="https://docs.zephyrproject.org/3.6.0/contribute/index.html#need-help-along-the-way"&gt;the Zephyr community&lt;/a&gt;? Board revision management are mostly if not all Zephyr, so the community there might have better ideas.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/thread/490052?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2024 20:40:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70e72e8c-9dc0-49e6-8cf1-8fae82daae69</guid><dc:creator>dethredic</dc:creator><description>&lt;p&gt;The overlay files are in the &amp;quot;boards&amp;quot; folder, just a typo.&lt;/p&gt;
&lt;p&gt;I still find it a little unfortunate that applications can&amp;#39;t define a custom revision anymore. I&amp;#39;ll think about it over the weekend and maybe see how much work creating new boards is going to be.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/thread/490051?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2024 20:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b855eaf5-eb34-4896-bc13-f5b70b528704</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Yes, exactly something like that. Since we are doing something different from the concept&amp;nbsp;called&amp;nbsp;&lt;em&gt;Revision&lt;/em&gt; in Zephyr, it might be better to use a different term though. Perhaps &lt;em&gt;variant&lt;/em&gt;, or&amp;nbsp;&lt;em&gt;model&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This is of course not what most projects do usually, so I understand why you call it a little hacky.&lt;/p&gt;
&lt;p&gt;If you want a more mainstream solution, for the Kconfig part, you can create a new Kconfig for just the project and add a &amp;quot;Kconfig&amp;nbsp;description &amp;#39;overlay&amp;#39;&amp;quot; to set the default value of other configs differently.&lt;br /&gt;But I can&amp;#39;t think of anything for Devicetree...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;By the way, regarding the setup that works for you in 2.4, are the overlay files under the &lt;em&gt;&amp;quot;build&amp;quot;&lt;/em&gt; folder or the &lt;em&gt;&amp;quot;boards&amp;quot;&lt;/em&gt; folder? I think it should be &lt;em&gt;&amp;quot;boards?&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/thread/490043?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2024 18:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bae73c58-741b-42ea-a5df-b722fe650404</guid><dc:creator>dethredic</dc:creator><description>&lt;p&gt;I got this working, but it feels super hacky:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;set(REVISIONS &amp;quot;foo_v4&amp;quot; &amp;quot;bar_v1&amp;quot;)
if (NOT MY_CUSTOM_REVISION IN_LIST REVISIONS)
    message(FATAL_ERROR &amp;quot;Revision &amp;#39;${MY_CUSTOM_REVISION}&amp;#39; is invalid. Accepted revisions: ${REVISIONS}&amp;quot;)
endif()

set(DTC_OVERLAY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/boards/nrf5340dk_nrf5340_cpuapp_${MY_CUSTOM_REVISION}.overlay)
set(EXTRA_CONF_FILE ${CMAKE_CURRENT_SOURCE_DIR}/boards/nrf5340dk_nrf5340_cpuapp_${MY_CUSTOM_REVISION}.conf)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then I can build with &lt;pre class="ui-code" data-mode="text"&gt;west build -b nrf5340dk/nrf5340/cpuapp -- -DMY_CUSTOM_REVISION=foo_v4&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Any suggestions on a better way to do this without creating a new board would be welcome&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/thread/489967?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2024 12:40:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3933cb5-3b95-42c0-ac2c-f116122e88f1</guid><dc:creator>dethredic</dc:creator><description>&lt;p&gt;I think that would work, at least as a short term solution. Are you suggesting that I ignore the official revision field and just add a custom &amp;quot;REVISION&amp;quot; (or similar) cmake that will set &lt;code&gt;DTC_OVERLAY_FILE/ EXTRA_CONF_FILE?&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/thread/489936?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2024 11:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bf493df-9041-4e92-bedc-298e20096772</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;I haven&amp;#39;t looked into overriding YAML file yet. However, if the changes are simple like just some pins and configs, and you don&amp;#39;t mind tweaking CMake, then there is an alternative. You can add a CMake argument, and tweak CMakeLists.txt to include new Devicetree or Kconfig overlay files based on that argument.&lt;/p&gt;
&lt;p&gt;Is this an alternative for you?&lt;/p&gt;
&lt;p&gt;Talking about biting the bullet, using a workspace application is an option too. Though I can see&amp;nbsp;that the downsides from updating the SDK are all still there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/thread/489751?ContentTypeID=1</link><pubDate>Thu, 20 Jun 2024 12:48:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fd68af3-b18c-4288-8c2e-3e5df3835500</guid><dc:creator>dethredic</dc:creator><description>&lt;p&gt;My application is a &amp;quot;freestanding application&amp;quot;, so changing the SDK isn&amp;#39;t a viable option since every developer on the project would need follow suit. I would also lose these changes when updating the SDK. Is there maybe a way to override / extend the board&amp;#39;s YAML file from my application?&lt;/p&gt;
&lt;p&gt;I liked the idea of just using a revision of the nrf5340dk because:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It&amp;#39;s way simpler, only 2 files are needed to tweak some pins / add some configs&lt;/li&gt;
&lt;li&gt;I would get updates / fixes automatically as the SDK gets updated&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If there is no longer a way to use a custom revision without updating the SDK then I guess I will bite the bullet and implement a custom board&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board revision/extension with new Zephyr hardware model</title><link>https://devzone.nordicsemi.com/thread/489711?ContentTypeID=1</link><pubDate>Thu, 20 Jun 2024 11:40:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ac1dfe1-8113-48a6-b46a-5b5ecb8a6591</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi dethredic,&lt;/p&gt;
&lt;p&gt;You shouldn&amp;#39;t have to&amp;nbsp;tweak CMakeLists.txt to make use of the board revision feature.&lt;/p&gt;
&lt;p&gt;I wonder if it&amp;#39;s just because you haven&amp;#39;t updated the nrf5340dk board&amp;#39;s YAML file? See:&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/hardware/porting/board_porting.html#write-your-board-yaml"&gt;Board Porting Guide — Zephyr Project Documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you are concerned about changing the SDK files too much, perhaps you can consider using custom board files.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>