<?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>Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88931/using-ble-ota-dfu-to-update-the-bootloader-itself</link><description>Hi, 
 
 We develop in an OpenSuse VM so that we all have the benefit of only having to setup the tools once. Segger Embedded Studio was building our variant of the DFU Bootloader example. We use the debug version of the project since we have security</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Jun 2022 21:55:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88931/using-ble-ota-dfu-to-update-the-bootloader-itself" /><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/374417?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 21:55:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:020ffbf4-9847-4112-9ca1-929f02860b14</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;When I read with nrfjprog instead of J-flash I still get&amp;nbsp;&lt;span&gt;9B01601A at 0xFF8.&amp;nbsp; I didn&amp;#39;t think we were calling&amp;nbsp;err_code = sd_power_gpregret_clr(0, 0xffffffff); from an elevated interrupt&amp;nbsp;priority.&amp;nbsp; It appears to be from a normal thread within FreeRTOS using FreeRTOS task priority 1, which in FreeRTOS context is the lowest priority task.&amp;nbsp; I don&amp;#39;t know how to look up what hardware interrupt&amp;nbsp;priority this corresponds to.&lt;br /&gt;&lt;br /&gt;We will need to update the bootloader in our units in the field so we can use secure firmware updates going forward, so jumping to the bootloader from the application won&amp;#39;t solve for our long term need of security, just the short term desire to update the end application&amp;nbsp;firmware more than once.&amp;nbsp; Since the private key to do this is not available from Nordic, I think we will just have to call this issue as &amp;quot;closed, won&amp;#39;t fix&amp;quot; and we will need to send someone out to open up the cases on our thousand units in the field so we can erase the chip and start over.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/374291?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 08:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9778f256-890a-4236-b973-559467e47378</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="idavenport"]I get a hard fault in nrf_soc.h at line 621:&lt;br /&gt;SVCALL(SD_POWER_GPREGRET_CLR, uint32_t, sd_power_gpregret_clr(uint32_t gpregret_id, uint32_t gpregret_msk));&lt;br /&gt;&lt;br /&gt;which is an expansion from my new TestForDfuButtonReboot(void)&lt;br /&gt;line:&lt;br /&gt; err_code = sd_power_gpregret_clr(0, 0xffffffff);[/quote]
&lt;p&gt;Are you calling it from a interrupt handler? Note that you&amp;nbsp;&lt;span&gt;can only call the SoftDevice API from application interrupt priority 5 and lower:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sds_s113/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html"&gt;https://infocenter.nordicsemi.com/topic/sds_s113/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="idavenport"]the address in the MBR at 0FF8 appears to be 9B01601A which doesn&amp;#39;t seem to be a valid address.[/quote]
&lt;p&gt;Do you seem the same if you do read it out using nrfjprog ?&lt;/p&gt;
&lt;p&gt;nrfjprog --memrd 0xFF8&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/374233?ContentTypeID=1</link><pubDate>Sat, 25 Jun 2022 22:02:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c622c1ff-ce55-47cb-846a-13f6c67c8504</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;I get a hard fault in nrf_soc.h at line 621:&lt;br /&gt;SVCALL(SD_POWER_GPREGRET_CLR, uint32_t, sd_power_gpregret_clr(uint32_t gpregret_id, uint32_t gpregret_msk));&lt;br /&gt;&lt;br /&gt;which is an expansion from my new TestForDfuButtonReboot(void)&lt;br /&gt;line:&lt;br /&gt; err_code = sd_power_gpregret_clr(0, 0xffffffff);&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Although in the hex readout of the device I am debugging, the address in the MBR at 0FF8 appears to be 9B01601A which doesn&amp;#39;t seem to be a valid address.&lt;br /&gt;&lt;br /&gt;:200FE00004FB00B583B00190019B002B0ED0019B00225A60019B00221A60019B0022DA602C&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/374225?ContentTypeID=1</link><pubDate>Sat, 25 Jun 2022 02:46:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1712cbe8-143e-4ce0-aa57-003f02e6a7da</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;We updated that in the bootloader thinking we could update the bootloader.&amp;nbsp; The sdk_config.h used to create the bootloader that is in the field is here since I can&amp;#39;t seem to upload more files after opening a ticket:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://drive.google.com/file/d/1LAJF5M8yc1o6fy4crkdhJFt7QhvUOlP1/view?usp=sharing"&gt;drive.google.com/.../view&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That sdk_config.h had:&lt;/p&gt;
&lt;p&gt;//==========================================================&lt;br /&gt;// &amp;lt;e&amp;gt; NRF_BL_DFU_ENTER_METHOD_BUTTON - Enter DFU mode on button press.&lt;br /&gt;//==========================================================&lt;br /&gt;#ifndef NRF_BL_DFU_ENTER_METHOD_BUTTON&lt;br /&gt;#define NRF_BL_DFU_ENTER_METHOD_BUTTON 1&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;...and...&lt;br /&gt;#ifndef NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN&lt;br /&gt;#define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN 25&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;We did have:&lt;/p&gt;
&lt;p&gt;// &amp;lt;q&amp;gt; NRF_BL_DFU_ENTER_METHOD_GPREGRET - Enter DFU mode when bit 0 is set in the NRF_POWER_GPREGRET register.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;#ifndef NRF_BL_DFU_ENTER_METHOD_GPREGRET&lt;br /&gt;#define NRF_BL_DFU_ENTER_METHOD_GPREGRET 1&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;// &amp;lt;q&amp;gt; NRF_BL_DFU_ENTER_METHOD_BUTTONLESS - Enter DFU mode when the Boolean enter_buttonless_dfu in DFU settings is true.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;#ifndef NRF_BL_DFU_ENTER_METHOD_BUTTONLESS&lt;br /&gt;#define NRF_BL_DFU_ENTER_METHOD_BUTTONLESS 0&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;I tried adding your suggested code.&amp;nbsp; It build and runs, I have to look up how to debug into a bootloader plus application again without the settings flash sectors getting out of synch.&amp;nbsp; It seems to go right back into the application and I fear that the old bootloader is being vectored to from inside the app and then that the bootloader may just be jumping right back into the app.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;void&lt;br /&gt;TestForDfuButtonReboot(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; uint32_t err_code;&lt;br /&gt;&amp;nbsp; if ((nrf_gpio_pin_read(8) == 0)) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; err_code = sd_power_gpregret_clr(0, 0xffffffff);&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START);&lt;br /&gt;&amp;nbsp; &amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&amp;nbsp; &amp;nbsp; //now reboot to send the CPU into the bootloader which is a &lt;br /&gt;&amp;nbsp; &amp;nbsp; //separately compiled application&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; sd_nvic_SystemReset();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/374178?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 13:32:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10b6f370-b3c2-4609-9529-a1dbf05c410a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I have attached a link to our zipped repo of the modified DFU example. &lt;br /&gt;The modified DFU example code is here:&amp;nbsp;[/quote]
&lt;p&gt;&lt;span&gt;Looking at your code, you seem to have changed&amp;nbsp;NRF_DFU_REQUIRE_SIGNED_APP_UPDATES&amp;nbsp;from default 1, to 0,&amp;nbsp;this means that&amp;nbsp;Application update may come from an unsigned package. Bootloader update must come from signed packages.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="idavenport"]Is the private key available for experimentation with the default example?&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;As far as I can see, this key is not provided.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user=""]Our issue is that we have a thousand units in the field with just the bootloader and no app in them.&amp;nbsp; We can add the app once, but then we can never update it again because the DFU will always jump to the app after that.&amp;nbsp;[/quote]
&lt;p&gt;How does the bootloader&amp;#39;s sdk_config.h file look like for the devices you have in field? You might not need to update the bootloader to do this. You seem to have&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_BUTTON set to 1, with button 8 being used to enter DFU mode. Snippet:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
#ifndef NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN
// Original pin for the dev kit:
// #define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN 25
//
// This is the &amp;#39;PANIC&amp;#39; switch on HDT_NG, P0.08. It is active low when button
// pressed.
//
// We have not implemented the full-on multi-platform support here as we did
// in the HDT_NG code.
#define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN 8
#else
#warning &amp;quot;NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN already defined!&amp;quot;
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So that is one method.&lt;/p&gt;
&lt;p&gt;You also have:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;q&amp;gt; NRF_BL_DFU_ENTER_METHOD_GPREGRET  - Enter DFU mode when bit 0 is set in the NRF_POWER_GPREGRET register.
#ifndef NRF_BL_DFU_ENTER_METHOD_GPREGRET
#define NRF_BL_DFU_ENTER_METHOD_GPREGRET 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So you can call this in the application code:&lt;br /&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;    uint32_t err_code;

    err_code = sd_power_gpregret_clr(0, 0xffffffff);
    APP_ERROR_CHECK(err_code);

    err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START);
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And call&amp;nbsp;sd_nvic_SystemReset(), and on reset it will then enter DFU mode. This is&amp;nbsp;the same mechanism that the Butonless DFU service uses.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/373815?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 06:09:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da7d1309-d60e-4315-a8e5-e8e2aca675b5</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;Where can I find the documentation on the difference between using --application vs. --bootloader in nrfutil?&amp;nbsp; The user&amp;#39;s guide for nrfutil&amp;nbsp;&lt;a id="" href="https://infocenter.nordicsemi.com/pdf/nrfutil_v6.1.0.pdf"&gt;https://infocenter.nordicsemi.com/pdf/nrfutil_v6.1.0.pdf&lt;/a&gt;&amp;nbsp;only mentions the switch in the context of generating bootloader settings pages.&amp;nbsp; I do see a sentence here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_bootloader.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_bootloader.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;Note that bootloaders are always checked when they are updated.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;That suggests even if I have signature check turned off for the application the bootloader will still be checked.&lt;br /&gt;&lt;br /&gt;Or perhaps you just have to dive into the code for nrfutil in&amp;nbsp;&lt;a id="" href="https://github.com/NordicSemiconductor/pc-nrfutil"&gt;https://github.com/NordicSemiconductor/pc-nrfutil&lt;/a&gt;&amp;nbsp;to know how -bootloader and --application are different?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The only documentation I can find on --bootloader for nrfutil is the paragraph that says it exists in:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_bootloader.html"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can add the following firmware images in binary or hexadecimal format to the zip file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--application&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;image:&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;an image of an application&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--bootloader&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;image:&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;an image of a bootloader&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--softdevice&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;image:&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;an image of a SoftDevice&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Is it correct to assume that in sdk_config.h #define NRF_BL_APP_SIGNATURE_CHECK_REQUIRED 0 does not apply when updating the bootloader itself?&lt;/p&gt;
&lt;p&gt;We used the default public key in our bootloader because we thought we had signing turned off.&amp;nbsp; It sounds like we do for the application, which is why --application allows us to upload (albeit to the wrong memory location) and --bootloader does not.&amp;nbsp; In order for us to try --key-file key.pem signing, it sounds like we would need the key.pem that Nordic used to generate the dfu_public_key.c that is compiled into our bootloader that we thought had signing turned off for applications and bootloader images.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The public key in the example dfu_public+_key.c we used starts with:&amp;nbsp;&amp;nbsp;&amp;nbsp;0x35, 0x7f, 0x66, 0xa3, 0x96, 0xf2,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see that &amp;quot;throwaway key&amp;quot; as it is called in the sdk.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;/* This file was generated with a throwaway private key, that is only inteded for a debug version of the DFU project.&lt;br /&gt; Please see &lt;a href="https://github.com/NordicSemiconductor/pc-nrfutil/blob/master/README.md"&gt;github.com/.../README.md&lt;/a&gt; to generate a valid public key. */&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Is the private key available for experimentation with the default example?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/373812?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 05:50:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e6084d9-ad85-4a71-b1f4-0e001e2ad543</guid><dc:creator>mrono</dc:creator><description>[quote userid="46136" url="~/f/nordic-q-a/88931/using-ble-ota-dfu-to-update-the-bootloader-itself/373792"]Is there a separate setting for removing the encryption requirement from --application updates vs. --bootloader updates?[/quote]
&lt;p&gt;I had to check this. The function signature_required() looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Function determines if init command signature is obligatory.
static bool signature_required(dfu_fw_type_t fw_type_to_be_updated)
{
    bool result = true;

    // DFU_FW_TYPE_EXTERNAL_APPLICATION and bootloader updates always require
    // signature check
    if ((!DFU_REQUIRES_SOFTDEVICE &amp;amp;&amp;amp; (fw_type_to_be_updated == DFU_FW_TYPE_SOFTDEVICE)) ||
            (fw_type_to_be_updated == DFU_FW_TYPE_APPLICATION))
    {
        result = NRF_DFU_REQUIRE_SIGNED_APP_UPDATE;
    }
    return result;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So it looks like bootloader updates always require signing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/373792?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 21:23:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7237114c-feab-4514-822a-bfa0eb4c1fca</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;We were able to update/upload our main application without having to use a key file.&amp;nbsp; Is there a separate setting for removing the encryption requirement from --application updates vs. --bootloader updates?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/373716?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 13:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9db62595-fe50-454b-a6eb-0eda248d4498</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="idavenport"]When I use SES to flash the new bootloader 0.0.01, and then try to load the bootloader package I built with the --application flag, the debug output shows this loop:[/quote]
&lt;p&gt;I&amp;#39;m not sure if this makes sense. Are you trying to update the bootloader like it was an app?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="idavenport"]&lt;p&gt;When I use SES to flash the new bootloader 0.0.01, and then try to load the bootloader package I built with the --bootloader nrfutil flag instead of the --application flag, the debug output shows:&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; nrf_dfu_validation: Signature required. Checking signature.&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_dfu_validation: No signature found.&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_dfu_validation: Prevalidation failed.&lt;/p&gt;[/quote]
&lt;p&gt;Seems like you are missing the private (signing) key when generating the DFU&amp;nbsp;&lt;span&gt;package. Try adding this to your &amp;quot;nrfutil pkg generate&amp;quot; command:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;--key-file key.pem&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/373583?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 07:13:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4195208-1345-4e52-909a-1ee257d11ddc</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;When I use SES to flash the new bootloader 0.0.01, and then try to load the bootloader package I built with the --bootloader nrfutil flag instead of the --application flag, the debug output shows:&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; nrf_dfu_validation: Signature required. Checking signature.&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_dfu_validation: No signature found.&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_dfu_validation: Prevalidation failed.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;When I use SES to flash the new bootloader 0.0.01, and then try to load the bootloader package I built with the --application flag, the debug output shows this loop:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: main(): BLE DFU Version 0.0.01&lt;br /&gt;&amp;lt;debug&amp;gt; app: In nrf_bootloader_init&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_settings: Calling nrf_dfu_settings_init()...&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_settings: Using settings page.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_settings: Copying forbidden parts from backup page.&lt;br /&gt;&amp;lt;info&amp;gt; app: main(): BLE DFU Version 0.0.01&lt;br /&gt;&amp;lt;debug&amp;gt; app: In nrf_bootloader_init&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_settings: Calling nrf_dfu_settings_init()...&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_settings: Using settings page.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_settings: Copying forbidden parts from backup page.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.&lt;br /&gt;&amp;lt;info&amp;gt; nrf_dfu_settings: Bac&lt;br /&gt;&amp;lt;info&amp;gt; app: main(): BLE DFU Version 0.0.01&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/373337?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 04:54:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad13e3ce-0c57-4edb-8b7a-38e3f34e86ee</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;From the attached hex file In_The_Field-Production_Unit_Readback.hex.&amp;nbsp; I assume that the bytes for a 32 bit absolute address are in reverse order and that the address at 0X0FF8 in hex below is our intended address of 0x00071000.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;:200FE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0010070000E007000B&lt;/p&gt;
&lt;p&gt;Looking at&amp;nbsp;&lt;span&gt;NRF_UICR-&amp;gt;NRFFW[0] (0x10001014) from the same in the field readback of hex file the address appears to be unwritten and all 0xFFs.&amp;nbsp; I assume this doesn&amp;#39;t matter as I saw in the documentation that the MBR jumps first to the address specified at 0x0FF8 and ignores the address in the NRFFW[0] slot if an address is held in the MBR at 0x0FF8.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;:020000041000EA&lt;br /&gt;:20100000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;We lowered the bootloader start address from 0x78000 to 0x71000 to make room for uECC.&lt;/p&gt;
&lt;p&gt;When I try to update the bootloader only, packaging using nrfutil with the following syntax&lt;/p&gt;
&lt;p&gt;nrfutil pkg generate --debug-mode --hw-version 52 --application-version 1 --application $DFU_DBG_EXE $DFU_DBG_APP_FILE&lt;br /&gt;&lt;br /&gt;The hex that I read out from the device, which no longer will advertise, has what I believe to be the original bootloader in its original location of 0x71000 and the new bootloader written at 0x1C000 instead of at 0x71000 as is specified in the hex file that nrfutil zipped up.&amp;nbsp; The unit no longer advertises as it would if I had written the new bootloader with SES instead of doing an OTA update.&amp;nbsp; The&amp;nbsp;&lt;span&gt;NRF_UICR-&amp;gt;NRFFW[0] (0x10001014) location is still all 0xFFs.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When I take a unit that has the old production bootloader in it at 0x71000 and try to do an OTA DFU with&amp;nbsp;the nrfutil syntax changed to use --bootloader&amp;nbsp;&lt;span&gt;$DFU_DBG_EXE instead of&amp;nbsp;&amp;nbsp;--application $DFU_DBG_EXE, the failure mode is different.&amp;nbsp; T&lt;/span&gt;he unit still advertises the BLE advertising name of the old bootloader (DfuTarg) and the hex that I read out is unchanged.&amp;nbsp; I also see no progress bar in nrf connect for android so I assume some kind of validation on upload of the new bootloader failed.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have not brought back the old commit for the Bootloader that is in the field, so I can debug into it to get an RTT log.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We are using SDK version 17.0.2.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/373162?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 08:01:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e2a2e29-57e2-4cd0-9dcd-b927ac6e5a3e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1) What values do you read from 0x0FF8 and NRF_UICR-&amp;gt;NRFFW[0] (0x10001014). These should hold the start address of the bootloader and never change.&lt;/p&gt;
&lt;p&gt;2) Since you are using the debug version of the bootloader, which has RTT logging enabled by default. Could you get the RTT log and upload it here?&lt;/p&gt;
&lt;p&gt;3) Which SDK version are you using?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="46136" url="~/f/nordic-q-a/88931/using-ble-ota-dfu-to-update-the-bootloader-itself/372461"]I would assume we could leave the MBR and Softdevice in there, and just update the bootloader itself.&amp;nbsp; Is that not possible?[/quote]
&lt;p&gt;That is possible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/373111?ContentTypeID=1</link><pubDate>Sat, 18 Jun 2022 00:53:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37894dc3-1193-4b0c-97de-953792eecf5e</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;I see that back in version 14 of the sdk, you needed to specify if the hex file you were packagin into a DFU .zip was a --bootloader or --application or --softdevice.&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Fble_sdk_app_dfu_bootloader.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Fble_sdk_app_dfu_bootloader.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It seems that more modern examples always use --application and I can not find documentation on how to use the --bootloader command/option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/372465?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 04:35:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8fd0cd0-f63a-4a10-83b0-54dad195d2af</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;We also have the same version for our custom bootloader.&amp;nbsp; Do I need to roll the version number somewhere to get past a no-downgrade test?&amp;nbsp; I don&amp;#39;t think we have downgrade prevention turned on, but I don&amp;#39;t know where to look to find out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/372464?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 04:33:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e637c76-398f-46a7-8806-8ae76f1402d1</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;I don&amp;#39;t think we can use buttonless Secure DFU without updating the bootloader.&amp;nbsp; I assume that if we just detect the button is down as we boot into our HDT app and jump to the bootloader on that condition, the bootloader will just jump right back into our HDT app because it knows there is a valid app at the prescribed address.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/372462?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 04:29:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae055029-fb53-4e37-8f88-a01ecf52f5aa</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;The app works as expected when the bootloader is present and when the bootloader is not present.&amp;nbsp; Our issues are just with getting the bootloader to update the bootloader itself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/372461?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 04:23:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d356675-13df-4d76-ad6a-640c40ff3033</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;We actually have the larger bootloader expanded and using uECC in the units in the field.&amp;nbsp; That bootloader works.&amp;nbsp; Well it will work once and then forever jump to the installed app.&amp;nbsp; So we are not trying to change the size of the bootloader from what is already in the target hardware.&amp;nbsp; I would assume we could leave the MBR and Softdevice in there, and just update the bootloader itself.&amp;nbsp; Is that not possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/372327?ContentTypeID=1</link><pubDate>Tue, 14 Jun 2022 09:07:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e9e0043-1e95-4cd2-8334-c170ac31ef23</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]the update appears to work, but the new advertising name does not show up,[/quote]
&lt;p&gt;Does the app work as expected when the bootloader is not present?&lt;/p&gt;
[quote user=""]Our issue is that we have a thousand units in the field with just the bootloader and no app in them.&amp;nbsp; We can add the app once, but then we can never update it again because the DFU will always jump to the app after that.&amp;nbsp; So we want to update the custom bootloader we put in there to our new custom bootloader that will jump to DFU if a button is held down at boot.&amp;nbsp; We can make this work when programmed with a J-link, but we can&amp;#39;t do it over the air which means we would need to open the cases of the 1000 units in the field that contain just the bootloader and use a Jlink and a cable to update the bootloader.&lt;br /&gt;[/quote]
&lt;p&gt;We have support for buttonless DFU as well. You can use the&amp;nbsp;Buttonless Secure DFU Service to jump from the app to the bootloader. See this example:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_buttonless_dfu.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_buttonless_dfu.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using BLE OTA DFU to update the Bootloader itself</title><link>https://devzone.nordicsemi.com/thread/372296?ContentTypeID=1</link><pubDate>Tue, 14 Jun 2022 07:53:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58b09d70-8254-488f-9edc-0f6211976a00</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;You don&amp;#39;t need to include the bootloader settings page to the DFU package. The settings page is only needed if you flash the binary to the target with a programmer.&lt;/p&gt;
&lt;p&gt;The other issue is the bootloader start address. The one thing you can&amp;#39;t do using DFU is to change the size of the bootloader. I&amp;#39;m not sure if there are workarounds to this, but I believe it is not supported.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>