<?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 Sign the firmware</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88416/mcuboot-sign-the-firmware</link><description>Hello Everyone, 
 
 First of all, what a terrible experience this has been. I&amp;#39;m trying to use custom RSA private key in order to sign the firmware before we go into production. However whatever I do, I can&amp;#39;t get rid of this warning: Let me say that I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Jun 2022 23:18:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88416/mcuboot-sign-the-firmware" /><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/373797?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 23:18:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9847d90f-c17d-46f1-8cdc-3d1fed41e449</guid><dc:creator>mytzyiay</dc:creator><description>[quote userid="110917" url="~/f/nordic-q-a/88416/mcuboot-sign-the-firmware/373782"]Why is it necessary to double escape (\\&amp;quot;) the quotation marks in the sample code you provided?[/quote]
&lt;p&gt;I believe this is the same issue as&amp;nbsp;&lt;a id="" href="https://github.com/nrfconnect/sdk-nrf/pull/7997"&gt;https://github.com/nrfconnect/sdk-nrf/pull/7997&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;i.e. the NCS cmake scripts cache the value of this variable but they&amp;#39;re storing that value without properly escaping the quotes.&lt;/p&gt;
&lt;p&gt;Hoping it gets fixed in v2.1.0.&lt;/p&gt;
&lt;p&gt;(Also I suspect that backslashes&amp;nbsp;might suffer from a similar issue, but I&amp;#39;ll leave it to the Windows users to test that.)&lt;/p&gt;
[quote userid="110917" url="~/f/nordic-q-a/88416/mcuboot-sign-the-firmware/373782"]Per that link above it seems necessary to set both CONFIG_MCUBOOT_SIGNATURE_KEY_FILE and CONFIG_BOOT_SIGNATURE_KEY_FILE. Is that correct, or is it sufficient to set only CONFIG_BOOT_SIGNATURE_KEY_FILE?[/quote]
&lt;p&gt;I&amp;#39;m just a random user so maybe I&amp;#39;m doing things all wrong, but after applying the change from the above PR on github, this is what has worked for me:&lt;/p&gt;
&lt;pre&gt;OTA_ARGS = \&lt;br /&gt;&amp;nbsp;-DOVERLAY_CONFIG=overlay-fota.conf \&lt;br /&gt;&amp;nbsp;-DPM_STATIC_YML_FILE=pm_ota.yml \&lt;br /&gt;&amp;nbsp;-D&amp;quot;mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE=\&amp;quot;$(ZIGBEE_SIGNING_KEY)\&amp;quot;&amp;quot; \&lt;br /&gt;&amp;nbsp;-D&amp;quot;CONFIG_MCUBOOT_IMAGE_VERSION=\&amp;quot;$(shell ./scripts/unix-time-to-version.sh)\&amp;quot;&amp;quot; \&lt;br /&gt;&amp;nbsp;-D&amp;quot;CONFIG_DATE_CODE=\&amp;quot;$(shell date +%Y%m%d-%H%M)\&amp;quot;&amp;quot;&lt;br /&gt;&lt;br /&gt;.PHONY: ota&lt;br /&gt;ota:&lt;br /&gt;&amp;nbsp;$(if $(ZIGBEE_SIGNING_KEY),,$(error Please set $$ZIGBEE_SIGNING_KEY))&lt;br /&gt;&amp;nbsp;$(WEST_BUILD) --board raw_dongle -- $(OTA_ARGS)&lt;/pre&gt;
&lt;p&gt;There are no CONFIG_MCUBOOT options in prj.conf or overlay-fota.conf&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/373782?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 18:47:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2db1cbc5-43b0-423f-b524-04a7aa98b90f</guid><dc:creator>KRich</dc:creator><description>&lt;p&gt;Thanks &lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;, I have confirmed that this method works for my project and configuration. Since this is not my thread originally, I&amp;#39;ll leave marking as an accepted answer it to &lt;a href="https://devzone.nordicsemi.com/members/aleksa"&gt;Aleksa&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Some quick (I hope) follow-up questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Will a relative path ever be supported in a Kconfig fragment as indicated at &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_MCUBOOT_SIGNATURE_KEY_FILE?"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_MCUBOOT_SIGNATURE_KEY_FILE?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Per that link above it seems necessary to set both CONFIG_MCUBOOT_SIGNATURE_KEY_FILE and CONFIG_BOOT_SIGNATURE_KEY_FILE. Is that correct, or is it sufficient to set only CONFIG_BOOT_SIGNATURE_KEY_FILE?&lt;/li&gt;
&lt;li&gt;Why is it necessary to double escape (\\&amp;quot;) the quotation marks in the sample code you provided?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/373778?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 18:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a53f40b4-01b9-4d88-ae18-532622427e67</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I did not get a chance to test it myself today, but a colleague of me mentioned that it should be possible now (in 2.0.0). You can modify the application CMakeLists.txt as&amp;nbsp;indicated&amp;nbsp;here, where a relative path to the key file is used:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)

set(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE \\&amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/../burd.pem\\&amp;quot;)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)

target_sources(app PRIVATE src/main.c)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/373538?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 20:21:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1910da2-a05d-42d1-a7b7-95e6751edafe</guid><dc:creator>KRich</dc:creator><description>&lt;p&gt;Is there a plan to add/fix the relative path support soon? The documentation would seem to indicate that relative paths are supported. Is this a bug that will be fixed soon? As is already mentioned, expecting multiple developers to use a system that requires absolute paths is untenable.&lt;/p&gt;
&lt;p&gt;Also, based on &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_bootloader_adding.html?highlight=mcuboot_config_boot_signature_key_file#id2"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_bootloader_adding.html?highlight=mcuboot_config_boot_signature_key_file#id2&lt;/a&gt; it seems that even though I get the message about MCU boot using the default key, the actual generated code is using my new/private key (even when using the relative path to the key file). Is that possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/370755?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 18:17:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fc04c99-3514-4bd8-91b3-f29622c779fa</guid><dc:creator>mytzyiay</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/88416/mcuboot-sign-the-firmware/370586#370586"]With regard to relative paths that is a common request but there are no elegant ways to do this for now.[/quote]
&lt;p&gt;I second this request.&amp;nbsp; It&amp;#39;s very common in&amp;nbsp;our environment for multiple developers to clone the project into their respective home directories on MacOS/Linux, which will have different absolute paths.&amp;nbsp; Requiring them to fix up the .config options adds an unnecessary point of failure to the build process.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/370586?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 07:24:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21816c96-8081-4da6-925a-a7b4a79c3df5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you build an application and enable MCUboot, that will also be built as a child image (which is a build system concept). In recent nRF Connect SDK releases, you can add a configuration overlay under child_image/&amp;lt;child_image_name&amp;gt;.conf. This also works for other overlays. When you do this, it is automatically picked up by the build system and applied.&lt;/p&gt;
&lt;p&gt;With regard to relative paths that is a common request but there are no elegant ways to do this for now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/370474?ContentTypeID=1</link><pubDate>Wed, 01 Jun 2022 13:39:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63701655-34ce-4138-9cc5-be10446a4a61</guid><dc:creator>Aleksa</dc:creator><description>&lt;p&gt;I&amp;#39;m fine with ECDSA key. But it would be great to find something that works for setting a relative path towards the key, since the suggestions I&amp;#39;ve found didn&amp;#39;t work.&amp;nbsp;&lt;br /&gt;Also I&amp;#39;d like to understand what child_image/mcuboot.conf changes. Why I have to do it this way, and why it&amp;#39;s enough just to add this file without linking it anywhere.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/370451?ContentTypeID=1</link><pubDate>Wed, 01 Jun 2022 12:52:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:210dfe34-4dbf-4151-820d-f6d45accb4a4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;RSA should work and is the default key type. You can see for instance &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/83657/using-a-configuration-file-with-mcuboot/348008#348008"&gt;this post &lt;/a&gt;which&amp;nbsp;includes a sample project with a custom RSA key.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/370289?ContentTypeID=1</link><pubDate>Tue, 31 May 2022 16:29:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:771f5c4e-9013-4b97-ac2a-3ff514fdd1dc</guid><dc:creator>Aleksa</dc:creator><description>&lt;p&gt;I was able to sign with a full path. But the suggestion for the relative path doesn&amp;#39;t work, I get an error:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CMake Error at /home/aleksa/Desktop/01_POSAO/02_UPWORK/04_PENNY/01_MG105_NCS191/mg105-nrf9160-root/lib/nordic/ncs/nrf/cmake/multi_image.cmake:409 (message):
  CMake generation for mcuboot failed, aborting.  Command: 1
Call Stack (most recent call first):
  /home/aleksa/Desktop/01_POSAO/02_UPWORK/04_PENNY/01_MG105_NCS191/mg105-nrf9160-root/lib/nordic/ncs/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
  /home/aleksa/Desktop/01_POSAO/02_UPWORK/04_PENNY/01_MG105_NCS191/mg105-nrf9160-root/lib/nordic/ncs/nrf/modules/mcuboot/CMakeLists.txt:216 (add_child_image)
&lt;/pre&gt;&lt;br /&gt;Also, I don&amp;#39;t understand why I had to make child_image/mcuboot.conf file.&amp;nbsp;Signing works only&amp;nbsp;when I put&amp;nbsp;there the config below, but I see no logic behind it. Here is the config:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BOOT_SIGNATURE_TYPE_RSA=n
CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y
CONFIG_BOOT_SIGNATURE_KEY_FILE=&amp;quot;path/to/private.pem&amp;quot;
# CONFIG_BOOT_SIGNATURE_KEY_FILE=&amp;quot;private.pem&amp;quot;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, it doesn&amp;#39;t work when I try to use RSA instead of ECDSA (and fix their respective configs of course). Again, I see no&amp;nbsp;reason why it would behave this way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBOOT Sign the firmware</title><link>https://devzone.nordicsemi.com/thread/370187?ContentTypeID=1</link><pubDate>Tue, 31 May 2022 11:39:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:794dffcd-9d92-4a80-aa3a-29dcfced2bd8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Aleksa,&lt;/p&gt;
&lt;p&gt;You need to specify a full path to the key file. Alternatively, you can do as &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/80094/undefined-reference-to-rsa_pub_key-when-config_boot_signature_key_file-is-defined/335731#335731"&gt;described here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>