<?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>Best process for signing firmware images when using mcuboot</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72365/best-process-for-signing-firmware-images-when-using-mcuboot</link><description>I am developing an applicaiton to run on the app core of an nRF5340, and I have mcuboot enabled for the purposes of handling DFU. 
 I have recently implemented signing the app firmware with our own pem key instead of using the default key provided by</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Mar 2022 08:56:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72365/best-process-for-signing-firmware-images-when-using-mcuboot" /><item><title>RE: Best process for signing firmware images when using mcuboot</title><link>https://devzone.nordicsemi.com/thread/359036?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 08:56:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:470f3c12-64bc-4a4c-a6ee-97ad71cad41c</guid><dc:creator>lcoudeville</dc:creator><description>&lt;p&gt;That&amp;nbsp; doesn&amp;#39;t make a difference.&amp;nbsp;Even tried &lt;em&gt;LIST(append....&lt;/em&gt; but that doesn&amp;#39;t make a difference.&lt;/p&gt;
&lt;p&gt;Added some debug messages in the &amp;quot;extensions.cmake&amp;quot; file in nrf-sdk learned that the variable mcuboot_OVERLAY_CONFIG is configured. In the macro/function&amp;nbsp;`add_overlay` I added a message debug line:&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;macro&lt;/span&gt;(&lt;span&gt;add_overlay_config image overlay_file&lt;/span&gt;)&lt;br /&gt;  &lt;span&gt;add_overlay&lt;/span&gt;(&lt;span&gt;${&lt;/span&gt;&lt;span&gt;image&lt;/span&gt;&lt;span&gt;} ${&lt;/span&gt;&lt;span&gt;overlay_file&lt;/span&gt;&lt;span&gt;} &lt;/span&gt;&lt;span&gt;OVERLAY_CONFIG&lt;/span&gt;)&lt;br /&gt;&lt;strong&gt;  message(${mcuboot_OVERLAY_CONFIG})&lt;/strong&gt;&lt;br /&gt;&lt;span&gt;endmacro&lt;/span&gt;()&lt;/pre&gt;
&lt;p&gt;When I pass the variable as cli argument (&lt;span&gt;&amp;nbsp;-Dmcuboot_OVERLAY_CONFIG=$(pwd)/mcuboot_prj.conf&amp;nbsp;&lt;/span&gt;&lt;span&gt;),&lt;/span&gt; I get:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;/home/.../mcuboot_prj.conf;&lt;strong&gt;/home/.../ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#339966;"&gt;&lt;strong&gt;Which is OK!&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When I set the variable from the CMakeLists.txt (as first line!) I get:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;/home/.../mcuboot_prj.conf&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Which is NOT OK! mcuboot is compiled without partition manager support, causing errors at boot time.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;I solved my issue with the &amp;quot;&lt;span&gt;child_image&amp;quot; approach, however, I preferred to set the variable from the CMakeLists.txt file.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best process for signing firmware images when using mcuboot</title><link>https://devzone.nordicsemi.com/thread/358913?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 15:08:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a007c6b-b67d-4ba3-884f-3fe5e1084ac7</guid><dc:creator>d_c_h_w</dc:creator><description>[quote userid="112790" url="~/f/nordic-q-a/72365/best-process-for-signing-firmware-images-when-using-mcuboot/358909#358909"]&lt;span&gt;set&lt;/span&gt;(&lt;span&gt;mcuboot_OVERLAY_CONFIG &lt;/span&gt;&amp;quot;&lt;span&gt;${&lt;/span&gt;&lt;span&gt;CMAKE_CURRENT_SOURCE_DIR&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;/mcuboot_prj.conf&lt;/span&gt;&amp;quot;)[/quote]
&lt;p&gt;I noticed you are using quotes here, could that be the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best process for signing firmware images when using mcuboot</title><link>https://devzone.nordicsemi.com/thread/358909?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 14:56:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b89bc2b5-176f-4b64-a282-bde168dc7f17</guid><dc:creator>lcoudeville</dc:creator><description>&lt;p&gt;I tried to walk on this approach, but unfortunately this doesn&amp;#39;t work with the latest ncs (1.9.1). I digged deeper&amp;nbsp;to reveal that something is loose with the &amp;quot;add_overlay*&amp;quot; functions/macro&amp;#39;s. After&amp;nbsp;investigating a lot of time I&amp;#39;m still not able to say what&amp;#39;s wrong. I temporarily resolved this issue by using the &amp;quot;child_image&amp;quot; approach. But I want to share the issue, so it can be resolved in one of the upcoming ncs releases.&lt;/p&gt;
&lt;p&gt;Setting the variable in the cmake file doesn&amp;#39;t seems to work:&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;set&lt;/span&gt;(&lt;span&gt;mcuboot_OVERLAY_CONFIG &lt;/span&gt;&amp;quot;&lt;span&gt;${&lt;/span&gt;&lt;span&gt;CMAKE_CURRENT_SOURCE_DIR&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;/mcuboot_prj.conf&lt;/span&gt;&amp;quot;)&lt;/pre&gt;
&lt;p&gt;For some reason, this late overlay config(s) are not appended when building the project. So the&amp;nbsp;nrf/subsys/partition_manager/partition_manager_enabled.conf file is not loaded resulting in mcuboot errors.&lt;/p&gt;
&lt;p&gt;The strange thing is supplying it over the command line works:&lt;/p&gt;
&lt;p&gt;west build -p=always -- -Dmcuboot_OVERLAY_CONFIG=$(pwd)/mcuboot_prj.conf &amp;amp;&amp;amp; west flash&lt;/p&gt;
&lt;p&gt;Adding some debug info shows that &amp;quot;mcuboot_OVERLAY_CONFIG&amp;quot; only contains the path set in the CMakeLists.txt and not the appended files by the ncs scripts (in my case the partition_manager_enabled.conf file).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best process for signing firmware images when using mcuboot</title><link>https://devzone.nordicsemi.com/thread/298927?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 09:26:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a256db74-676d-439c-bcbd-b497358e9c35</guid><dc:creator>d_c_h_w</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I have just tried that, and this expects the pem file in the source mcuboot directory (or use a absolute path), so it is the same as creating an append overlay in the child_image directory.&lt;/p&gt;
&lt;p&gt;In fact, I think the new v1.5.0 feature of the child_image directory is a neatened&amp;nbsp;up&amp;nbsp;implementation of doing what you have suggested.&lt;/p&gt;
&lt;p&gt;I will stick with the new child_image method and just pre-copy across the pem file to the mcuboot directory, and ignore the cmake warning.&lt;/p&gt;
&lt;p&gt;Thanks for all your suggestions&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best process for signing firmware images when using mcuboot</title><link>https://devzone.nordicsemi.com/thread/298821?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 17:07:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0cd196a-0352-401b-8dd3-e75e2776e29c</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Try doing this instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;)
    list(APPEND mcuboot_OVERLAY_CONFIG
      &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;
      )
endif()&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;From&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/zephyr/application/index.html?highlight=overlay_config#important-build-system-variables"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/zephyr/application/index.html?highlight=overlay_config#important-build-system-variables&lt;/a&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;&lt;strong&gt;&lt;span&gt;OVERLAY_CONFIG&lt;/span&gt;&lt;/strong&gt;: Additional Kconfig configuration fragment files. Multiple filenames can be separated with either spaces or semicolons. This can be useful in order to leave&amp;nbsp;&lt;strong&gt;CONF_FILE&lt;/strong&gt;&amp;nbsp;at its default value, but “mix in” some additional configuration options.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best process for signing firmware images when using mcuboot</title><link>https://devzone.nordicsemi.com/thread/298638?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 10:44:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80a419fb-a63b-4db1-98d8-53ece9237c10</guid><dc:creator>d_c_h_w</dc:creator><description>&lt;p&gt;Hi Simon, Thank you for your response and suggestions.&lt;/p&gt;
&lt;p&gt;I think your first option is basically the same as my first option. The down side to this seems to be as it is the main conf file now for mcuboot it requires extra config options for it to&amp;nbsp;be the same as a letting it configure itself.&lt;/p&gt;
&lt;p&gt;The other two options rely on absolute paths which I am not keen on, as I work locally in Windows with SES, but have a docker&amp;nbsp;environment under linux that creates builds too.&lt;/p&gt;
&lt;p&gt;I think I will stick with my 2nd option for now, it&amp;#39;s a shame that the cmake warning logic is a bit wrong assuming any key in the mcuboot directory must be a default one&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best process for signing firmware images when using mcuboot</title><link>https://devzone.nordicsemi.com/thread/298500?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 18:30:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e3cf58e-16f3-440c-83a6-ae2a43f1b495</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Would any of these methods work?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&amp;quot;In a dedicated `mcuboot_prj.conf` and pass it to the build system as: `-Dmcuboot_CONF_FILE=mcuboot_prj.confI&lt;/em&gt;&lt;br /&gt;&lt;em&gt;containing:&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;tt&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE=&amp;lt;path&amp;gt;/public-key.pem&lt;/tt&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;If using this method,&amp;nbsp;&lt;tt&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE&lt;/tt&gt;&amp;nbsp;&amp;lt;path&amp;gt; can be omitted and path will be taken relative to the location of the conf file.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;In a Kconfig fragment, like: mcuboot_overlay-keys.conf , and pass it to the build system as: `-Dmcuboot_OVERLAY_CONFIG=mcuboot_overlay-keys.conf` containing:&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Path must be absolute in this case.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;tt&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE=&amp;lt;path&amp;gt;/public-key.pem&lt;/tt&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;using `-Dmcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE=&amp;lt;path&amp;gt;/public-key.pem`.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Path must be absolute in this case.&amp;quot;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>