<?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>Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107695/questions-about-sdfu-implentation-and-security</link><description>Hello and thanks for reading, 
 We are developing for the NRF5340 and one of the features we are very excited about is the OTA firmware updates via the SDFU. 
 I have followed the instructions here : and things seem to be working in that the correct services</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Jan 2024 21:53:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107695/questions-about-sdfu-implentation-and-security" /><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/467032?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2024 21:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93c63d23-265c-44e1-92a2-20d74b34f46c</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;And just like that its working! Thanks for all your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/467023?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2024 19:23:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43a27641-1f78-4f26-bc4f-e0e246cf7f82</guid><dc:creator>Amanda Hsieh</dc:creator><description>[quote user="i_4556"]And in the nrf mouse example that worked fine.[/quote]
&lt;p&gt;Good. Seems the&amp;nbsp;&lt;span&gt;CmakeList&amp;nbsp;works as expected.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="i_4556"]Instead, it reverts to the keys in the NRF folder.[/quote]
&lt;p&gt;That means it cannot find the key as the path in the&amp;nbsp;CmakeList.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please check if the key file exists or if the key path is correct.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/467014?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2024 18:37:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6384ce3-a584-434e-8f2e-7de30ff64028</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Interesting but mixed results.&lt;/p&gt;
&lt;p&gt;I started by making the changes in the sandbox, basically the nrf mouse example we have been playing around with. I change the CMakeLists to include&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;if&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; (&lt;/span&gt;&lt;span style="color:#569cd6;"&gt;EXISTS&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;K/path_to_key/key_priv.pem&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;set&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;\&amp;quot;K/path_to_key/key_priv.pem\&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;set&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(mcuboot_CONFIG_BOOT_ENCRYPTION_KEY_FILE &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;\&amp;quot;K/path_to_key/key_priv.pem\&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;else&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;add_compile_definitions(USING_DEV_KEY)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;set&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;\&amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/keys/dev_ec256_priv.pem\&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;set&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(mcuboot_CONFIG_BOOT_ENCRYPTION_KEY_FILE &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;\&amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/keys/dev_ec256_priv.pem\&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;endif&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And in the nrf mouse example that worked fine.&lt;/p&gt;
&lt;p&gt;I then tried moving everything to my main project with all the real code, and its not working.&lt;/p&gt;
&lt;p&gt;Here is my entire CmakeList from the main project:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(none)

#check for key file
if (EXISTS &amp;quot;K/release_key/key.pem&amp;quot;)
set(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE \&amp;quot;K/release_key/key.pem\&amp;quot;)
set(mcuboot_CONFIG_BOOT_ENCRYPTION_KEY_FILE \&amp;quot;K/release_key/key.pem\&amp;quot;)
else()
add_compile_definitions(USING_DEV_KEY)
set(mcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE \&amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/keys/dev_ec256_priv.pem\&amp;quot;)
set(mcuboot_CONFIG_BOOT_ENCRYPTION_KEY_FILE \&amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/keys/dev_ec256_priv.pem\&amp;quot;)
endif()

ADD_CUSTOM_COMMAND(TARGET app
   PRE_BUILD
   COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/version_control_hook.py
)

FILE(GLOB app_sources src/*.c*)

target_sources(app PRIVATE ${app_sources})&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Instead, it reverts to the keys in the NRF folder.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you have any suggestions for what im doing wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466966?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2024 14:32:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b703dd2-2cd5-42f0-a3b1-7409fde32b71</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Everything seems to now be working; I can successfully do an update with the correct key, and it rejects attempts to update with an incorrect key.&lt;/p&gt;
&lt;p&gt;Thank you so much for all your help.&lt;/p&gt;
&lt;p&gt;I have one last little question: right now in the mcuboot proj.config file I have&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;enc-ec256-priv.pem&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Could I instead define it in cmakelists.txt, that way I can make it easier to swap between the dev key and the release key? Something like:&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;set&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(CONFIG_BOOT_SIGNATURE_KEY_FILE &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;\&amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/child_image/mcuboot/enc-ec256-priv.pem\&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466847?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 21:38:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20cc4d15-527c-4790-9928-f361ebf1f028</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for all your support. Per your suggestion, I added the two Configs. This has resulted in some strange behaviour from the build in visual studio. Please take a look at the error message below, I have bolded the relevant portion, and then underlined the paths to the key files:&lt;/p&gt;
&lt;p&gt;FAILED: zephyr/app_update.bin &lt;br /&gt;cmd.exe /C &amp;quot;cd /D C:\Users\Isaac\Documents\peripheral_hids_mouse\build\modules\mcuboot &amp;amp;&amp;amp; C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-objcopy.exe --input-target=ihex --output-target=binary --gap-fill=0xff C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/mcuboot_primary_app.hex C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_to_sign.bin &amp;amp;&amp;amp; C:\ncs\toolchains\c57af46cb7\opt\bin\python.exe &lt;strong&gt;C:/ncs/v2.5.0/bootloader/mcuboot/scripts/imgtool.py sign --key &lt;span style="text-decoration:underline;"&gt;C:/ncs/v2.5.0/bootloader/mcuboot/mcubootenc-ec256-priv.pem&lt;/span&gt; --header-size 0x200 --align 4 --version 0.0.0+0 --pad-header --encrypt&lt;span style="text-decoration:underline;"&gt; mcubootenc-ec256-priv.pem&lt;/span&gt; --slot-size 0x74000 C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_to_sign.bin C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_update.bin&lt;/strong&gt;&amp;quot;&lt;br /&gt;Traceback (most recent call last):&lt;/p&gt;
&lt;p&gt;As you can see, the path to the key file is wrong, and has somehow set itself to the location of the default key files that come with NRF SDK.&lt;/p&gt;
&lt;p&gt;Where did it get this path from, and how do I correct it?&lt;/p&gt;
&lt;p&gt;Earlier in the build it correctly located the key files:&lt;/p&gt;
&lt;p&gt;MCUBoot bootloader key file: C:/Users/Isaac/Documents/peripheral_hids_mouse/child_image/mcuboot/enc-ec256-priv.pem&lt;br /&gt;MCUBoot bootloader encryption key file: C:/Users/Isaac/Documents/peripheral_hids_mouse/child_image/mcuboot/enc-ec256-priv.pem&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT: It seems to have worked, let me do a little more testing but somehow doing a second clean build seems to have worked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466846?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 21:14:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4add9894-8c19-4761-bd72-94fc8e07b287</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Not sure if this is what you ask for VS Code or not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You could add the following configs to&amp;nbsp;child_image/mcuboot/prj.conf to encrypt the image&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BOOT_ENCRYPT_IMAGE=y
CONFIG_BOOT_ENCRYPTION_KEY_FILE=&amp;quot;enc-ec256-priv.pem&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466844?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 20:51:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81ac91c0-3c18-4baf-8ab9-722e309e0e9c</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello, and thanks for your constant support.&lt;/p&gt;
&lt;p&gt;When I get it to work I manually invoke imgtool.py from windows command prompt with the command&lt;/p&gt;
&lt;p&gt;C:\ncs\v2.5.0\bootloader\mcuboot&amp;gt;python scripts/imgtool.py sign --key C:/Users/Isaac/Documents/peripheral_hids_mouse/enc-ec256-priv.pem --header-size 0x200 --align 4 --version 0.0.0+0 --pad-header --encrypt C:/Users/Isaac/Documents/peripheral_hids_mouse/enc-ec256-priv.pem --slot-size 0x74000 C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_to_sign.bin C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_update.bin&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466843?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 20:49:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2edfdefe-d8d4-4c33-9272-71ca2cdc435e</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am trying to reproduce it with&amp;nbsp;&lt;span&gt;the Visual Studio. Could you provide the details on how you encrypt?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466839?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 19:56:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f87442c-8504-4191-b63e-55fa0ca8293e</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for your reply. I dont think the issue is path length.&lt;/p&gt;
&lt;p&gt;I tried invoking the imgtool.py tool in the windows terminal, using the exact same command as the visual studio build, and the problem becomes evident:&lt;/p&gt;
&lt;p&gt;C:/ncs/v2.5.0/bootloader/mcuboot/scripts/imgtool.py sign --key C:/Users/Isaac/Documents/peripheral_hids_mouse/child_image/mcuboot/enc-ec256-priv.pem --header-size 0x200 --align 4 --version 0.0.0+0 --pad-header --encrypt C:/Users/Isaac/Documents/peripheral_hids_mouse/child_image/mcuboot/ --slot-size 0x74000 C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_to_sign.bin C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_update.bin&amp;quot;&lt;/p&gt;
&lt;p&gt;Notice that after the --encrypt it points to a directory and not a file.&lt;/p&gt;
&lt;p&gt;I dont know how to fix this in the Visual Studio configs, but I tried fixing it in the terminal by simply adding the location of the key file, making the command&lt;/p&gt;
&lt;p&gt;scripts/imgtool.py sign --key C:/Users/Isaac/Documents/peripheral_hids_mouse/enc-ec256-priv.pem --header-size 0x200 --align 4 --version 0.0.0+0 --pad-header --encrypt C:/Users/Isaac/Documents/peripheral_hids_mouse/enc-ec256-priv.pem --slot-size 0x74000 C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_to_sign.bin C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_update.bin&amp;quot;&lt;/p&gt;
&lt;p&gt;And now it seems to be working. How do I make that change in the config files for the project?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466836?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 19:27:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:855257e7-df5f-4183-b35f-c0680d71caa6</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Try to shorter the path, for example:&amp;nbsp;&amp;nbsp;&lt;em&gt;C:/Users/Isaac/Downloads/peripheral_hids_mouse/&lt;span style="text-decoration:line-through;"&gt;peripheral_hids_mouse/&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Windows has character limitations with the executed path, so too many characters in the path would cause unexpected errors.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466831?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 18:51:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ac4535a-e366-49f2-81b6-4c751e0fc415</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for your continued assistance. Per your suggestion, I tried starting with the base case (no security) with the NRF Connect Device Manager app, and that has worked with my iPhone, and every other phone I have tried.&lt;/p&gt;
&lt;p&gt;I am having a problem with the encryption however, in that it wont build. It fails during the signing/encrypting phase, with the following error:&lt;/p&gt;
&lt;p&gt;PermissionError: [Errno 13] Permission denied: &amp;#39;C:/Users/Isaac/Downloads/peripheral_hids_mouse/peripheral_hids_mouse/child_image/mcuboot/&amp;#39;&lt;/p&gt;
&lt;p&gt;The code embed tool has suddenly stopped working, but here is the relevant terminal message&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[3/12] Generating ../../zephyr/app_update.bin&lt;/em&gt;&lt;br /&gt;&lt;em&gt;FAILED: zephyr/app_update.bin &lt;/em&gt;&lt;br /&gt;&lt;em&gt;cmd.exe /C &amp;quot;cd /D C:\Users\Isaac\Downloads\peripheral_hids_mouse\peripheral_hids_mouse\build\modules\mcuboot &amp;amp;&amp;amp; C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-objcopy.exe --input-target=ihex --output-target=binary --gap-fill=0xff C:/Users/Isaac/Downloads/peripheral_hids_mouse/peripheral_hids_mouse/build/zephyr/mcuboot_primary_app.hex C:/Users/Isaac/Downloads/peripheral_hids_mouse/peripheral_hids_mouse/build/zephyr/app_to_sign.bin &amp;amp;&amp;amp; C:\ncs\toolchains\c57af46cb7\opt\bin\python.exe C:/ncs/v2.5.0/bootloader/mcuboot/scripts/imgtool.py sign --key C:/Users/Isaac/Downloads/peripheral_hids_mouse/peripheral_hids_mouse/child_image/mcuboot/enc-ec256-priv.pem --header-size 0x200 --align 4 --version 0.0.0+0 --pad-header --encrypt C:/Users/Isaac/Downloads/peripheral_hids_mouse/peripheral_hids_mouse/child_image/mcuboot/ --slot-size 0x74000 C:/Users/Isaac/Downloads/peripheral_hids_mouse/peripheral_hids_mouse/build/zephyr/app_to_sign.bin C:/Users/Isaac/Downloads/peripheral_hids_mouse/peripheral_hids_mouse/build/zephyr/app_update.bin&amp;quot;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Traceback (most recent call last):&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:/ncs/v2.5.0/bootloader/mcuboot/scripts/imgtool.py&amp;quot;, line 22, in &amp;lt;module&amp;gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; main.imgtool()&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:\ncs\toolchains\c57af46cb7\opt\bin\Lib\site-packages\click\core.py&amp;quot;, line 1128, in __call__&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.main(*args, **kwargs)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:\ncs\toolchains\c57af46cb7\opt\bin\Lib\site-packages\click\core.py&amp;quot;, line 1053, in main&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rv = self.invoke(ctx)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:\ncs\toolchains\c57af46cb7\opt\bin\Lib\site-packages\click\core.py&amp;quot;, line 1659, in invoke&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _process_result(sub_ctx.command.invoke(sub_ctx))&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:\ncs\toolchains\c57af46cb7\opt\bin\Lib\site-packages\click\core.py&amp;quot;, line 1395, in invoke&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ctx.invoke(self.callback, **ctx.params)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:\ncs\toolchains\c57af46cb7\opt\bin\Lib\site-packages\click\core.py&amp;quot;, line 754, in invoke&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return __callback(*args, **kwargs)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:\ncs\v2.5.0\bootloader\mcuboot\scripts\imgtool\main.py&amp;quot;, line 425, in sign&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; enckey = load_key(encrypt) if encrypt else None&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:\ncs\v2.5.0\bootloader\mcuboot\scripts\imgtool\main.py&amp;quot;, line 91, in load_key&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; key = keys.load(keyfile)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; File &amp;quot;C:\ncs\v2.5.0\bootloader\mcuboot\scripts\imgtool\keys\__init__.py&amp;quot;, line 49, in load&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with open(path, &amp;#39;rb&amp;#39;) as f:&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;PermissionError: [Errno 13] Permission denied: &amp;#39;C:/Users/Isaac/Downloads/peripheral_hids_mouse/peripheral_hids_mouse/child_image/mcuboot/&amp;#39;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The error seems related to a path issue, where instead of pointing to the key file it only points to the directory with the key file. I have the same problem with my code, where I have basically copied your work related to SDFU.&lt;/p&gt;
&lt;p&gt;I am using 2.5.0 if that matters in some way.&lt;/p&gt;
&lt;p&gt;Thanks again for all your help!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT: I tried invoking the tool in standalone mode, using the exact same command as the visual studio build, and the problem becomes evident:&lt;/p&gt;
&lt;p&gt;C:/ncs/v2.5.0/bootloader/mcuboot/scripts/imgtool.py sign --key C:/Users/Isaac/Documents/peripheral_hids_mouse/child_image/mcuboot/enc-ec256-priv.pem --header-size 0x200 --align 4 --version 0.0.0+0 --pad-header --encrypt C:/Users/Isaac/Documents/peripheral_hids_mouse/child_image/mcuboot/ --slot-size 0x74000 C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_to_sign.bin C:/Users/Isaac/Documents/peripheral_hids_mouse/build/zephyr/app_update.bin&amp;quot;&lt;/p&gt;
&lt;p&gt;Notice that after the --encrypt it points to a directory and not a file.&lt;/p&gt;
&lt;p&gt;I dont know how to fix this in the Visual Studio configs, but I tried fixing it in the terminal, and that led to another interesting error:&lt;/p&gt;
&lt;p&gt;TypeError: ECPrivateKey.sign() got an unexpected keyword argument &amp;#39;signature_algorithm&amp;#39;&lt;/p&gt;
&lt;p&gt;A quick google search shows this is a known issue from basically last week that has already been patched, so im going to apply the patch and report back. &lt;a href="https://github.com/pyca/cryptography/issues/10237"&gt;github.com/.../10237&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466602?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 17:24:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:769dc91d-159a-413c-9f35-518866e2550e</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Here is my example&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/peripheral_5F00_hids_5F00_mouse.7z"&gt;devzone.nordicsemi.com/.../peripheral_5F00_hids_5F00_mouse.7z&lt;/a&gt;. After uploading with the&amp;nbsp;update_image/nRF53_HID_app_update.bin, it would show &amp;quot;build time: Jan 29 2024 09:51:56&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1706548517528v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Beware that this code/configuration is not fully tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="i_4556"]EDIT: Tested the base case with no signature on my other coworker&amp;#39;s iphone 13 and that works fine. Not sure if its all Iphone12 or just mine it doesnt work on...[/quote]
&lt;p&gt;Could you try to use the nRF Connect Device Manager App &lt;a title="https://apps.apple.com/us/app/nrf-connect-device-manager/id1519423539" href="https://apps.apple.com/us/app/nrf-connect-device-manager/id1519423539" rel="noopener noreferrer" target="_blank"&gt;https://apps.apple.com/us/app/nrf-connect-device-manager/id1519423539&lt;/a&gt;? Please make sure it&amp;#39;s the latest version v1.5.3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The minimum required iOS version is 9.0, originally released in Fall of 2015.&lt;/span&gt;&lt;/p&gt;
[quote user="i_4556"]EDIT2: Tested with my old android phone running Android 7.0 and once again app crashes when trying to perform DFU. It doesnt crash on my Android 9.0 but also doesnt work, just flashes through the screens like above.[/quote]
&lt;p&gt;Please try to use the nRF Connect Device Manager app&amp;nbsp;&lt;a href="https://play.google.com/store/apps/details?id=no.nordicsemi.android.nrfconnectdevicemanager&amp;amp;hl=en_US"&gt;https://play.google.com/store/apps/details?id=no.nordicsemi.android.nrfconnectdevicemanager&amp;amp;hl=en_US&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The minimum required Android version is 5.0 (Android Lollipop) due to a requirement for high MTU.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466105?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 18:40:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71ff30fd-5c18-4df8-87b0-4e6505c7ae89</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello, thank you for your reply.&lt;/p&gt;
&lt;p&gt;I look forward to the IOS issues being fixed, as it would be nice to be able to update the firmware from my phone (and to return my coworker&amp;#39;s phone to him).&lt;/p&gt;
&lt;p&gt;In the meantime, I am still having issues with the DFU when I try to implement keys. In the app on android it seems to rapidly flash through the connecting/uploading/validating (too fast to actually see them), and on the firmware side I get the following message in the terminal &amp;quot;I: Image index: 0, Swap type: none&amp;quot; and then nothing has actually happened.&lt;/p&gt;
&lt;p&gt;Could the problem be as simple as the key being somehow wrong?&lt;/p&gt;
&lt;p&gt;Here is my prj.config file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_NCS_SAMPLES_DEFAULTS=y

CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_MAX_CONN=2
CONFIG_BT_MAX_PAIRED=2
CONFIG_BT_L2CAP_TX_BUF_COUNT=5
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME=&amp;quot;HIDS_mouse&amp;quot;
CONFIG_BT_DEVICE_APPEARANCE=962

CONFIG_BT_BAS=y
CONFIG_BT_HIDS=y
CONFIG_BT_HIDS_MAX_CLIENT_COUNT=2
CONFIG_BT_GATT_UUID16_POOL_SIZE=40
CONFIG_BT_GATT_CHRC_POOL_SIZE=20

CONFIG_BT_CONN_CTX=y

CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=y
CONFIG_BT_DIS_MANUF=&amp;quot;NordicSemiconductor&amp;quot;
CONFIG_BT_DIS_PNP_VID_SRC=2
CONFIG_BT_DIS_PNP_VID=0x1915
CONFIG_BT_DIS_PNP_PID=0xEEEE
CONFIG_BT_DIS_PNP_VER=0x0100

CONFIG_MAIN_STACK_SIZE=1536
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

CONFIG_DK_LIBRARY=y

#DFU settings
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR=y
#changed for BT instead of UART
CONFIG_MCUMGR_TRANSPORT_BT=y
#changed, dont want to require a passcode to send dfu image
CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n

CONFIG_MCUMGR_GRP_IMG=y
CONFIG_BASE64=y
CONFIG_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_STREAM_FLASH=y
CONFIG_NET_BUF=y
CONFIG_ZCBOR=y
CONFIG_FLASH_MAP=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And my CMakeLists&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
cmake_minimum_required(VERSION 3.20.0)

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

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

FILE(GLOB app_sources src/*.c)
# NORDIC SDK APP START
target_sources(app PRIVATE ${app_sources})
# NORDIC SDK APP END

zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And finally in my child_image folder I have an mcuboot file with CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y&lt;/p&gt;
&lt;p&gt;I followed the instructions exactly like here for the keyfile:&lt;/p&gt;
&lt;p&gt;${NCS_PATH}/bootloader/mcuboot/scripts/imgtool.py keygen -k custom_priv.pem -t ecdsa-p256&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you have any suggestions for what could be wrong, why I cant seem to use DFU in signed mode? Do I still upload the app_update.bin file like with the insecure mode?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT: Tested the base case with no signature on my other coworker&amp;#39;s iphone 13 and that works fine. Not sure if its all Iphone12 or just mine it doesnt work on...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT2: Tested with my old android phone running Android 7.0 and once again app crashes when trying to perform DFU. It doesnt crash on my Android 9.0 but also doesnt work, just flashes through the screens like above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/466097?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 16:50:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef688074-92d8-4201-949a-223e0cf19fe1</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;It&amp;#39;s good to know it works with the Android phone now. Please be aware that the mcuboot will not do anything if you upload an unmodified file.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can reproduce the issue with iOS and check with the team now. I will be back if I have any updates from the team.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/465880?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 20:54:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb556e37-ea33-4f3f-8e50-f92e00298dae</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello and thank you for your reply. I have made no real progress in trying to get this to work. As a workaround I have tried installing the DFU app on my iphone. That also doesnt work; when I try to select the .zip package, I get an &amp;quot;invalid manifest&amp;quot; error.&lt;/p&gt;
&lt;p&gt;I figured at this point I might as well try to advance the project on my own, and implemented the code from this example: &lt;a id="" href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/keys_and_signatures/mcuboot_smp_custom_key"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/keys_and_signatures/mcuboot_smp_custom_key&lt;/a&gt; this way only our company will be able to push new firmware to our device. I have added the example&amp;#39;s .config and CMakeLists changes, and the mcuboot.conf changes.&lt;/p&gt;
&lt;p&gt;I then tried using my coworker&amp;#39;s android phone. This also doesnt work; although it doesnt crash immediately like on my iphone, it also doesnt work. It tries to update and gets stuck on the &amp;quot;Connecting&amp;quot; stage.&lt;/p&gt;
&lt;p&gt;I cannot provide my entire project, but I can provide the .config files and other files like that if that helps.&lt;/p&gt;
&lt;p&gt;I will test with the LBS and report back.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;EDIT: tested with the LBS and just adding the two CONFIGs from the first example, and did not work with android or iphone, With iphone I still have the crash to the home-screen, and with android it looks like it worked but nothing actually happens on the device, the firmware is not updated.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;EDIT2: I re-tested with the peripheral hids mouse sample, as I have already gotten this working on my device, and the OTA update in the simplest case worked on android. I will re-test on IOS, and then we just need to get signed keys working, and figure out why it doesnt seem to want to work on my main app.&lt;/p&gt;
&lt;p&gt;EDIT3: Still broken with IOS, app crashes when I try to update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/465865?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 16:32:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:012e9975-6f56-4522-9f2c-19a05c035866</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user="i_4556"]Thank you for your reply. I am using an Iphone 12 running IOS 16.6. I am using the NRF connect app on the phone. I am using SDK 2.5.0, and per the example simply added[/quote]
&lt;p&gt;Does it work with your iPhone now? Could you test with&amp;nbsp;&lt;span&gt;peripheral_lbs? Does peripheral_lbs also make the app crash or does it only happen with your code? Could you provide the project?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="i_4556"]If the firmware just swaps the images, what is to stop a malicious actor uploading firmware that then dumps the old code out the serial port or otherwise bypasses readback protections? I assume the only solution is, as described in your second link, I need to add keys or something to block those uploads in the first place?[/quote]
&lt;p&gt;That&amp;#39;s true.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="i_4556"]Regarding the second link, is there anything special I need to know because I am using the nrf5340 with its seperate BLE processor, or will I still be able to use the code broadly as shown?[/quote]
&lt;p&gt;The setting is the same as other chips to set the configs in child_image/mcuboot.conf&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/bootloaders/bootloader_adding.html#adding-a-custom-signature-key-file"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/465685?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 20:29:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b665cd4e-796e-4b0a-bd41-419d03c678a0</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Thank you for your reply. I am using an Iphone 12 running IOS 16.6. I am using the NRF connect app on the phone. I am using SDK 2.5.0, and per the example simply added&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_BOOTLOADER_MCUBOOT&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;to my proj.config file for my existing codebase.&lt;/p&gt;
&lt;p&gt;If the firmware just swaps the images, what is to stop a malicious actor uploading firmware that then dumps the old code out the serial port or otherwise bypasses readback protections? I assume the only solution is, as described in your second link, I need to add keys or something to block those uploads in the first place?&lt;/p&gt;
&lt;p&gt;Regarding the second link, is there anything special I need to know because I am using the nrf5340 with its seperate BLE processor, or will I still be able to use the code broadly as shown?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SDFU implentation and security</title><link>https://devzone.nordicsemi.com/thread/465684?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 20:00:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7215bfc4-8e51-47ff-93b1-6df9ed1f43c5</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I have not yet been able to fully test DFU, because every time I try the app crashes to the homescreen. This is unfortunate; it looks to me like a problem with the mobile app, hopefully it gets fixed soon.[/quote]
&lt;p&gt;Which phone are you using?&lt;/p&gt;
&lt;p&gt;Are you using&amp;nbsp;&lt;span&gt;the&amp;nbsp;&lt;/span&gt;&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-connect-device-manager"&gt;nRF Connect Device Manager app&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Which NCS version and sample are you using?&lt;/p&gt;
&lt;p&gt;In NCS v2.5.1, you could enable the DFU function with &amp;quot;CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y&amp;quot; in the peripheral_lbs sample.&lt;/p&gt;
[quote user=""]Firstly, does the bootloader perform a full chip erase when new firmware is loaded?[/quote]
&lt;p&gt;No, it would swap the image with the current and new image. See my colleague&amp;#39;s explanation in&amp;nbsp;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp#firmware-update"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp#firmware-update&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Secondly, is there any way to tell the NRF to only accept firmware images that are signed or otherwise authenticated?[/quote]
&lt;p&gt;&lt;span&gt;See my colleague&amp;#39;s explanation in&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/keys_and_signatures"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/keys_and_signatures&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>