<?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>Shared config values in multi-image build</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107010/shared-config-values-in-multi-image-build</link><description>I&amp;#39;m working with an nRF5340 and am trying to set up a multi-image build in VS Code with the &amp;quot;rpc_host&amp;quot; project on the network core using the &amp;quot;CONFIG_BT_RPC_STACK=y&amp;quot; config value. I&amp;#39;m basing this off of the Bluetooth: Peripheral HIDS Mouse sample, which</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Jan 2024 07:38:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107010/shared-config-values-in-multi-image-build" /><item><title>RE: Shared config values in multi-image build</title><link>https://devzone.nordicsemi.com/thread/466149?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2024 07:38:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b635227a-7023-4372-b5e0-f1d7e8334310</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Some extra insight:&lt;/p&gt;
&lt;p&gt;Sysbuild is in an experimental state, and is supported for Nordic boards. If you are using a custom nRF5340 board, you should not use sysbuild at this stage.&lt;/p&gt;
&lt;p&gt;For the default installation of NCS, using ZEPHYR_BASE/../nrf is going to work. But there could be cases where the folder structure or folder names has been changed. Using ZEPHYR_NRF_MODULE instead is therefore safer.&lt;/p&gt;
&lt;p&gt;The full command is then&lt;/p&gt;
&lt;p&gt;&lt;code&gt;set(-Drpc_host_EXTRA_CONF_FILE=&amp;quot;\${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/peripheral_hids_mouse/shared-fragment.conf&amp;quot;)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shared config values in multi-image build</title><link>https://devzone.nordicsemi.com/thread/465975?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 11:57:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31099b4a-72a9-4ec3-8b29-0f3dd5fbdf8e</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry about the delay.&lt;/p&gt;
[quote user="JordanK"]1. Is there a way to specify a CMake flag in a sysbuild config (i.e. in sysbuild.cmake)?[/quote]
&lt;p&gt;You can add a CMake flag in sysbuild.cmake. I created a sysbuild.cmake in the Peripheral HIDS mouse sample directory which included&lt;/p&gt;
&lt;p&gt;&lt;code&gt;set(-Drpc_host_EXTRA_CONF_FILE=&amp;quot;&amp;lt;absolute-path-to-project-directory&amp;gt;/shared-fragment.conf&amp;quot;) &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;set(-DEXTRA_CONF_FILE=shared-fragment.conf)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;which had the same outcome as adding the CMake flags to the Extra CMake arguments in the build configuration.&lt;/p&gt;
&lt;p&gt;You can use the ZEPHYR_BASE variable in the path. For example \${ZEPHYR_BASE}/../nrf/bluetooth/samples/peripheral_hids_mouse/shared-fragment.conf&lt;/p&gt;
[quote user="JordanK"]3. What&amp;#39;s the best way to specify the &amp;quot;path-to_&amp;quot; in the&amp;nbsp;&lt;span&gt;&amp;lt;path-to_your-shared-fragment.conf&amp;gt;? I tried using a CMAKE variable (-Drpc_host_OVERLAY_CONFIG=${CMAKE_SOURCE_DIR}/overlay-shared.conf) because, as I&amp;#39;m sure you know, it otherwise attempts to use the child image&amp;#39;s&amp;nbsp;source directory as the path root. This didn&amp;#39;t work though (it still used the child image&amp;#39;s source directory). I also tried the&amp;nbsp;CMAKE_CURRENT_SOURCE_DIR (no difference), CMAKE_BINARY_DIR (uses the build directory), and PROJECT_SOURCE_DIR (doesn&amp;#39;t seem to be set) variables, none of which worked.&lt;/span&gt;[/quote]
&lt;p&gt;CMake variables can be used from command line*. This is essentially what is done when applying flags to the build command or adding the command in sysbuild.cmake. In conclusion, the best way is to use sysbuild.cmake to add the CMake argument for specifying the path to the shared Kconfig fragment.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;* Edit: This is not 100% correct:&lt;/p&gt;
&lt;p&gt;If the CMake variable is defined early and is internal, it can be used in the path and the build system will resolve it. The ZEPHYR_BASE variable is an example of an early defined internal CMake variable. You can read more on these configurations in &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/zephyr/build/kconfig/setting.html#the-initial-configuration"&gt;The Initial Configuration&lt;/a&gt; part of the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/zephyr/build/kconfig/setting.html"&gt;Setting Kconfig configuration&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shared config values in multi-image build</title><link>https://devzone.nordicsemi.com/thread/465173?ContentTypeID=1</link><pubDate>Sat, 20 Jan 2024 04:20:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c9565fa-a398-46cb-9909-bcd7b27df732</guid><dc:creator>Kyle</dc:creator><description>&lt;p&gt;Hi Maria, were you able to get any info on items 1 and 3?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shared config values in multi-image build</title><link>https://devzone.nordicsemi.com/thread/462634?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2024 09:07:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60941e12-f94c-4139-bed2-b86b723f0b7f</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Great to see this was helpful.&lt;/p&gt;
&lt;p&gt;Comments and answers to your questions:&lt;/p&gt;
&lt;p&gt;1. Sysbuild is pretty new for me, so I have to ask my colleagues about this.&lt;/p&gt;
&lt;p&gt;2. Good catch. OVERLAY_CONFIG has been replaced by EXTRA_CONF_FILE from NCS v2.5.0 (Zephyr v3.4.99 as well). My previous answer is valid for NCS versions &amp;lt; 2.5.0. For NCS v2.5.x, you use EXTRA_CONF_FILE to apply Kconfig fragments to your build. The change is listed in the release notes for Zephyr 3.4.0 under &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/releases/release-notes-3.4.html#build-system-and-infrastructure"&gt;Build system and infrastructure&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;3. I found that specifying the relative path and the absolute path worked. I get that this is tedious, so I will post a question internally to see if some of the developers has some tips.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shared config values in multi-image build</title><link>https://devzone.nordicsemi.com/thread/462589?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2024 17:43:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d26a89e6-7108-46f4-a00b-1141e8e4ee20</guid><dc:creator>Kyle</dc:creator><description>&lt;p&gt;Thanks Maria, this is super helpful. A few additional questions:&lt;br /&gt;&lt;br /&gt;1. Is there a way to specify a CMake flag in a sysbuild config (i.e. in sysbuild.cmake)?&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;What is the difference between the OVERLAY_CONFIG and EXTRA_CONF_FILE build variables? I&amp;#39;m guessing that EXTRA_CONF_FILE is the new version (it&amp;#39;s listed in the &lt;a href="https://docs.zephyrproject.org/latest/develop/application/index.html"&gt;&amp;quot;latest&amp;quot; Zephyr documentation&lt;/a&gt;) and OVERLAY_CONFIG is an old term (it&amp;#39;s last shown in the &lt;a href="https://docs.zephyrproject.org/3.3.0/develop/application/index.html"&gt;3.3.0 Zephyr documentation&lt;/a&gt;)? Since nRF Connect SDK 2.5.1 is using Zephyr 3.4.99 though, it would seem that I should be using EXTRA_CONF_FILE instead?&lt;/p&gt;
&lt;p&gt;3. What&amp;#39;s the best way to specify the &amp;quot;path-to_&amp;quot; in the&amp;nbsp;&lt;span&gt;&amp;lt;path-to_your-shared-fragment.conf&amp;gt;? I tried using a CMAKE variable (-Drpc_host_OVERLAY_CONFIG=${CMAKE_SOURCE_DIR}/overlay-shared.conf) because, as I&amp;#39;m sure you know, it otherwise attempts to use the child image&amp;#39;s&amp;nbsp;source directory as the path root. This didn&amp;#39;t work though (it still used the child image&amp;#39;s source directory). I also tried the&amp;nbsp;CMAKE_CURRENT_SOURCE_DIR (no difference), CMAKE_BINARY_DIR (uses the build directory), and PROJECT_SOURCE_DIR (doesn&amp;#39;t seem to be set) variables, none of which worked.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shared config values in multi-image build</title><link>https://devzone.nordicsemi.com/thread/462522?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2024 14:02:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fe3d7cd-1812-45d8-ac89-b188f98aac0b</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;Well done on the research you have done on this. The way to use a shared fragment on two images is to use extra CMake arguments when building.&lt;/p&gt;
[quote user=""]&lt;span&gt;Specify a shared fragment for both the child image (&amp;quot;rpc_host&amp;quot;) and the parant/application image. Since the child image is enabled by &amp;quot;CONFIG_BT_RPC_STACK&amp;quot;, though, and not by any kind of West build configuration, I can&amp;#39;t find a way to apply a fragment to it.&lt;/span&gt;[/quote]
&lt;p&gt;This is the way to go. You can add the CMake flag -Drpc_host_OVERLAY_CONFIG=&amp;lt;path-to_your-shared-fragment.conf&amp;gt; and -DOVERLAY_CONFIG=&amp;lt;your-shared-fragment&amp;gt;.conf to the build command to apply the fragment to both the RPC host child image and the application image. When building the child image, the build system will search in the child image application directory, so you need to specify the whole relative path from the child image application directory to your shared fragment or the full absolute path to your shared fragment. &lt;/p&gt;
[quote user=""]&lt;span&gt;As a separate, semi-related question: the&amp;nbsp;&lt;/span&gt;CONFIG_BT_RPC_STACK config value (and Bluetooth over RPC in general) is &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/e3dabca027f136c6392f384bb5d8ef19930ceda6/subsys/bluetooth/rpc/Kconfig#L8C1-L8C1"&gt;marked in the SDK&lt;/a&gt; as &amp;quot;EXPERIMENTAL&amp;quot;. The nRF5340, however, has been out for almost 4 years now, so I would expect that there would be production-grade options for utilizing the networking core. If BLE over RPC is experimental, what&amp;#39;s the recommended production-grade option for offloading BLE to the network core?[/quote]
&lt;p&gt;HCI RPMsg is not experimental, though it is part of a dual chip configuration, so it is only the Bluetooth LE controller which is on the network core. &lt;/p&gt;
&lt;p&gt;If you want to know anything about future features or our roadmap in general, please contact your Regional Sales Director.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>