<?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>MCUBoot fails to load if using CMake Overlay Config</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92762/mcuboot-fails-to-load-if-using-cmake-overlay-config</link><description>I am developing an app with the MCUBoot and a main applicaton. I followed the SMP SVR tutorial and modified it to my needs. 
 I have noticed that if I use a config overlay for MCUBoot (in CMake), it fails to set the config CONFIG_PARTITION_MANAGER_ENABLED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Mar 2023 09:06:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92762/mcuboot-fails-to-load-if-using-cmake-overlay-config" /><item><title>RE: MCUBoot fails to load if using CMake Overlay Config</title><link>https://devzone.nordicsemi.com/thread/416720?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 09:06:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03329e42-213c-415b-9f87-78e37a29dadf</guid><dc:creator>Alexey Papkovskiy</dc:creator><description>&lt;p&gt;So, I run into the same issue, the solution is pretty easy, you have to change how you set&amp;nbsp;&lt;span&gt;mcuboot_OVERLAY_CONFIG, it has to be CACHE variable&lt;br /&gt;&lt;br /&gt;if(MYCONDITION_FOR_USING_OVERLAY)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_LIST_DIR}/child_image/mcuboot_my_overlay.conf&amp;nbsp;&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;CACHE&lt;/span&gt;&lt;span style="font-family:inherit;"&gt; &lt;/span&gt;&lt;span style="font-family:inherit;"&gt;STRING&lt;/span&gt;&lt;span style="font-family:inherit;"&gt; &lt;/span&gt;&lt;span style="font-family:inherit;"&gt;&amp;quot;MCUBOOT configuration&amp;quot;&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;endif()&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If it is not CACHE the build system doesn&amp;#39;t add&amp;nbsp;${NRF_DIR}/subsys/partition_manager/partition_manager_enabled.conf to config overlays, and Partition Manager will be not enabled on MCUboot&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot fails to load if using CMake Overlay Config</title><link>https://devzone.nordicsemi.com/thread/392423?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 13:59:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c71f057-3a15-4cb8-833f-21fbef4bb255</guid><dc:creator>vcbz</dc:creator><description>&lt;p&gt;yes thats one way, but I need the overlay as I only want to enable certain debug options on the bootloader when I build a debug release. I could also try the approach &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span class="cp"&gt;&amp;lt;ACI_NAME&amp;gt;_&amp;lt;buildtype&amp;gt;.conf&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;specfied in the docs&amp;nbsp; for child images and check if that helps&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/ug_multi_image.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/ug_multi_image.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot fails to load if using CMake Overlay Config</title><link>https://devzone.nordicsemi.com/thread/391093?ContentTypeID=1</link><pubDate>Tue, 18 Oct 2022 07:36:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d83b64e-0a45-4af1-8065-d68c49955a58</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;From &lt;a title="https://developer.nordicsemi.com/nrf_connect_sdk/doc/latest/nrf/ug_multi_image.html#image-specific-variables" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_multi_image.html#image-specific-variables" rel="noopener noreferrer" target="_blank"&gt;Multi-Image builds, Image Specific Variables:&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;The build system grabs the Kconfig fragment or configuration file
specified in a CMake argument relative to that image’s application
directory.
For example, the build system uses nrf/samples/bootloader/my-fragment.conf when building with the -Db0_OVERLAY_CONFIG=my-fragment.conf option, whereas -DOVERLAY_CONFIG=my-fragment.conf grabs the fragment from the main application’s directory, such as zephyr/samples/hello_world/my-fragment.conf.&lt;/pre&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So the fix would be to use mcuboot_CONF_FILE instead. Keep in mind that with &lt;span&gt;mcuboot_CONF_FILE, you need to re-specify the whole config file and not just overlay,&amp;nbsp;so the easier way is just to use child_image/mcuboot.conf&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot fails to load if using CMake Overlay Config</title><link>https://devzone.nordicsemi.com/thread/391053?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 17:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c937086-f80f-4dda-9f7c-79ff17a41fa0</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I need to ask my colleague to help me with this. Please wait until I get some more insights from him.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot fails to load if using CMake Overlay Config</title><link>https://devzone.nordicsemi.com/thread/390704?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2022 18:15:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f1041ee-32e7-44dd-8808-3be82c9ec766</guid><dc:creator>vcbz</dc:creator><description>&lt;p&gt;Well escaping the characters did not help, Zephyr interpreted it as&lt;br /&gt;&lt;br /&gt;file not found:&lt;br /&gt; C:/ncs/v2.0.0/bootloader/mcuboot/boot/zephyr/&amp;quot;C:/MY_PROJECT_PATH/child_image/mcuboot_Debug.conf&amp;quot;&lt;/p&gt;
&lt;p&gt;The variable is set correctly here is the outpt&lt;/p&gt;
&lt;p&gt;message(SEND_ERROR &amp;quot;overlay config is ${mcuboot_OVERLAY_CONFIG}&amp;quot; )&lt;/p&gt;
&lt;p&gt;overlay config is&lt;br /&gt;&amp;nbsp; C:/MY_PROJECT_PATH/child_image/mcuboot_Debug.conf&lt;/p&gt;
&lt;p&gt;What I dont understand is why zephyr ignores my partition_static.yml when using the overlay config... The problem is not related to the MCuboot config not being passed or merged in the build process but rather that when using the mcuboot overlay as discussed above those two specifc defines for partition configuration are not set anymore. Note that these configurations are not set by me but I guess they are selected with the partition manager script.&lt;br /&gt;&lt;br /&gt;I also checked the partition manager script output and seems correct&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-- Found partition manager static configuration: C:/MY_PROJECT_PATH/pm_static.yml&lt;br /&gt;Partition &amp;#39;mcuboot&amp;#39; is not included in the dynamic resolving since it is statically defined.&lt;br /&gt;Partition &amp;#39;mcuboot_pad&amp;#39; is not included in the dynamic resolving since it is statically defined.&lt;br /&gt;Partition &amp;#39;mcuboot_primary&amp;#39; is not included in the dynamic resolving since it is statically defined.&lt;br /&gt;Partition &amp;#39;mcuboot_primary_app&amp;#39; is not included in the dynamic resolving since it is statically defined.&lt;br /&gt;Partition &amp;#39;mcuboot_secondary&amp;#39; is not included in the dynamic resolving since it is statically defined.&lt;br /&gt;Partition &amp;#39;nvs_storage&amp;#39; is not included in the dynamic resolving since it is statically defined.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot fails to load if using CMake Overlay Config</title><link>https://devzone.nordicsemi.com/thread/390635?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2022 12:04:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ad7bb5e-54cc-4a78-a07d-f0877b42aae8</guid><dc:creator>vcbz</dc:creator><description>&lt;p&gt;I will try to check by printing the mcuboot_OVERLAY_CONFIG variable in cmake after setting it.&amp;nbsp; The way I know that specifcally the config CONFIG_PARTITION_MANAGER_ENABLED&amp;nbsp; and CONFIG_FLASH_MAP_CUSTOM are different is because I compared the .config and autonf.h files of the childimage (mcuboot) with winmerge.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;About escaping characters I will have a look about this, because I am also using a private key and know about this issue. Actually I had to escape characters three times&amp;nbsp; when I was using a private key &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f605.svg" title="Sweat smile"&gt;&amp;#x1f605;&lt;/span&gt;, anyhow that is not my problem but will see if escaping characters as well for the MCUBoot overlay config solves this.&lt;/p&gt;
&lt;p&gt;set(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE \\\&amp;quot;${CMAKE_CURRENT_LIST_DIR}/keys/mcuboot_sign.pem\\\&amp;quot;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot fails to load if using CMake Overlay Config</title><link>https://devzone.nordicsemi.com/thread/390610?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2022 10:51:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d921215-eab6-4bf7-ac99-85b88576dbaa</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Can you please&amp;nbsp;verify that his configurations are actually set by checking the build/mcuboot/zephyr/include/generated/autoconf.h or by running &amp;quot;menuconfig&amp;quot; inside build/mcuboot.&lt;/p&gt;
&lt;p&gt;My colleague says he had some issues with paths inside CMakeLists.txt. Can you&amp;nbsp;do &amp;quot;message(mcuboot_OVERLAY_CONFIG)&amp;quot; after setting it, to double check inside CMakeList.txt also.&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;See &lt;a title="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/blob/1111836cd720127c7f2b0dc0bec9f7ef496b8954/bootloader_samples/mcuboot_smp_custom_key/cmakelists.txt#l5" href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/blob/1111836cd720127c7f2b0dc0bec9f7ef496b8954/bootloader_samples/mcuboot_smp_custom_key/CMakeLists.txt#L5" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt; for how to escape the paths:&lt;/div&gt;
&lt;blockquote&gt;&lt;span&gt;set&lt;/span&gt;(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE &lt;span&gt;\\&lt;/span&gt;&lt;span&gt;&amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/custom_key_dir/custom_priv.pem\\&amp;quot;&lt;/span&gt;)&lt;/blockquote&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>