<?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>Override MCUBoot build directory</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86748/override-mcuboot-build-directory</link><description>Hello, 
 
 It appears as though nRF Connect does not currently support building encrypted images, so I am trying to implement it myself. 
 Part of creating encrypted images is providing the encryption key in mcuboot/boot/zephyr/keys.c 
 To that end, I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Apr 2022 19:13:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86748/override-mcuboot-build-directory" /><item><title>RE: Override MCUBoot build directory</title><link>https://devzone.nordicsemi.com/thread/364541?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 19:13:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82d9403a-0dba-4f19-85d4-7424e80bd7c1</guid><dc:creator>sachrmed</dc:creator><description>&lt;p&gt;Sorry to hear it&amp;#39;s not supported.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for looking into that though! I appreciate it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Override MCUBoot build directory</title><link>https://devzone.nordicsemi.com/thread/363897?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 12:05:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43200026-a98c-4898-a12d-4460ba1581fc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sachrmed,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I got the response from the team. I don&amp;#39;t have the solution on how you can configure to choose your own mcuboot but the explanation why encrypted image is not fully supported in our solution.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The main reason is the security concern. We don&amp;#39;t want to provide a solution that you would use a single master key for all of your devices.&amp;nbsp; Since there isn&amp;#39;t a way to secure store the key on nRF52 flash, when one of the device is hacked and the master key is extracted you have the risk that all your device can be hacked using the same master key.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Override MCUBoot build directory</title><link>https://devzone.nordicsemi.com/thread/363675?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 15:42:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fad441e-d60e-4f98-bbc4-c8e28876d133</guid><dc:creator>sachrmed</dc:creator><description>&lt;p&gt;No problem! Thanks for looking into that.&lt;br /&gt;I&amp;#39;m looking forward to seeing if you can come up with a solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Override MCUBoot build directory</title><link>https://devzone.nordicsemi.com/thread/363557?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 12:00:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd96bede-cd16-42f5-b676-e39222614596</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sachrmed,&amp;nbsp;&lt;br /&gt;I&amp;#39;m sorry for late response. It was Easter vacation in Norway last week.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will check with the developers to see if there is any solution to do &amp;quot;--encrypt&amp;quot; without modify the SDK and let&amp;nbsp; you know what I find.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Override MCUBoot build directory</title><link>https://devzone.nordicsemi.com/thread/362655?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2022 16:26:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26304933-ba9a-4f9d-a11f-c648c0113358</guid><dc:creator>sachrmed</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;Thanks for the reply!&lt;/p&gt;
&lt;p&gt;Sorry, it&amp;#39;s not that encrypted images cannot be used, but that I&amp;#39;m having trouble generating the encrypted image without editing files within the NCS installation.&lt;/p&gt;
&lt;p&gt;One limitation I&amp;#39;ve noticed is that the NCS build scripts do not pass the &amp;quot;--encrypt&amp;quot; argument when invoking imgtool.py. It also seems that even for signed images, the signature .pem file needs to be placed in the mcuboot directory inside the NCS installation. Ideally I wouldn&amp;#39;t have to edit anything in the NCS installation directories.&lt;/p&gt;
&lt;p&gt;In nrf/modules/mcuboot/CMakeLists.txt you can see where the &amp;quot;sign_cmd&amp;quot; is created to invoke imgtool. Here, it calls the &amp;quot;sign&amp;quot; subcommand to create a signed image. If I edit this file to also pass the &amp;quot;--encrypt&amp;quot; flag, I am able to successfully create encrypted images.&lt;/p&gt;
&lt;p&gt;However, to make encrypted images work, I need to edit the &amp;quot;keys.c&amp;quot; file found in the mcuboot sources.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to copy the mcuboot source files out of the NCS installation and into my project repository where I can edit &amp;quot;keys.c&amp;quot; as well as place the signature and encryption .pem files.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m then able to build this fork of mcuboot separately from my application, but I&amp;#39;m unable to get it to boot the application itself.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The problem comes with putting this all together with the NCS build scripts.&lt;/p&gt;
&lt;p&gt;As you&amp;#39;ve said, once you set CONFIG_BOOTLOADER_MCUBOOT to build a bootable image, NCS includes mcuboot.cmake and goes and builds it&amp;#39;s own mcuboot. My guess right now is that the resulting application image is placed according to where NCS&amp;#39;s mcuboot will find it, but not where my forked mcuboot will find it. I&amp;#39;m not sure if this is necessarily the case since the build scripts are rather complicated and I&amp;#39;m still trying to wrap my head around it all.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ultimately, I&amp;#39;m trying to create encrypted images that boot with mcuboot and can be updated over SMP.&lt;/p&gt;
&lt;p&gt;So far, I&amp;#39;ve proven that it&amp;#39;s possible, but I have to edit files in the NCS installation which will cause problems for other projects we are working on.&lt;/p&gt;
&lt;p&gt;If we can find a way to build mcuboot from a directory outside of the NCS installation, and get the &amp;quot;--encrypt&amp;quot; flag passed to imgtool.py, I think that will create bootable encrypted images.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hopefully that all make sense &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, thanks for the info about multi_image.cmake and partition manager. I&amp;#39;ll have a look at those today.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Override MCUBoot build directory</title><link>https://devzone.nordicsemi.com/thread/362620?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2022 13:09:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f19a6dd4-410a-4121-a796-8bd803b74456</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sachrmed,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I haven&amp;#39;t tried to build MCUBoot with&amp;nbsp;encrypted&amp;nbsp;image myself, but could you give me more information on the limitation you found in NCS that encrypted image can&amp;#39;t be use ?&amp;nbsp;&lt;br /&gt;As far as I know it&amp;#39;s at least supported by MCUBoot ?&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/encrypted_images.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/encrypted_images.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regarding your question, if you have a look at&amp;nbsp;CMakeLists.txt in zephyr.txt folder you can find this:&amp;nbsp;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1649422446196v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So mcuboot.cmake is included when you enable CONFIG_BOOTLOADER_MCUBOOT. If you have a look inside mcuboot.cmake you can see&amp;nbsp;the build system used to include the child image.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In addition in multi_image.cmake you can find&amp;nbsp;CONFIG_NCS_MCUBOOT_IN_BUILD is added when&amp;nbsp;CONFIG_BOOTLOADER_MCUBOOT. You may want to include it in your application configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you use partition manager, then you need to look into pm.yml.tfm as well.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>