<?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>Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56993/not-able-to-update-firmware-using-bootloader-sdk15-3-0</link><description>Hi, 
 
 I am using bootloader and application based on SDK15.3.0 and SD s140_nrf52_6.1.1_softdevice.hex. 
 I am also using our own BLE transport layer in application to receive new firmware file. 
 My process is a below. 
 1. Receive whole firmware image</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Jan 2020 13:20:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56993/not-able-to-update-firmware-using-bootloader-sdk15-3-0" /><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/231661?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 13:20:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba944762-5c21-43ab-b145-19d8db4c6f59</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="khodidas"]Is it correct way to do this?[/quote]
&lt;p&gt;It doesn&amp;#39;t seem to be&amp;nbsp;exactly what was intended by those who implemented the background DFU support, but that doesn&amp;#39;t mean it&amp;#39;s wrong. I don&amp;#39;t foresee any problems with the approach you describe, just make sure to test it well.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/231645?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 12:42:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7c0cf90-7f52-4f0a-b77b-3420f0ee9f6f</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Thanks Vidar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I process DFU as per below:&lt;/p&gt;
&lt;p&gt;1. Convert application HEX to BIN.&lt;/p&gt;
&lt;p&gt;2. Send w&lt;span&gt;hole firmware image over BLE and store in flash (Bank1) in application code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. Update bootloader setting and reset the device and let bootloader to control the image update process.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you said&amp;nbsp;NRF_DFU_IN_APP must be enabled. But by doing this I am getting&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;ERROR MESSAGE: &amp;quot;&amp;lt;warning&amp;gt; nrf_dfu_settings: Settings write aborted since it tries writing to forbidden settings.&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So,I disabled &lt;span&gt;NRF_DFU_IN_APP&amp;nbsp;in application and&lt;/span&gt;&amp;nbsp;made changes in bootloader setting after new firmware image received as mentioned below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void update_bl_setting(uint32_t startAddress, uint32_t fwSize)
{
    s_dfu_settings.bank_1.bank_code = NRF_DFU_BANK_VALID_APP;
    s_dfu_settings.bank_0.bank_code = NRF_DFU_BANK_INVALID;
    s_dfu_settings.app_version = 0;
    s_dfu_settings.bank_1.image_crc = crc32_compute((uint8_t *)startAddress, fwSize, NULL);
    s_dfu_settings.bank_1.image_size = fwSize;
    s_dfu_settings.bank_current = NRF_DFU_CURRENT_BANK_1;
    s_dfu_settings.bank_layout = NRF_DFU_BANK_LAYOUT_DUAL;
    
    /* Set the progress to zero and remove the last command */
    memset(&amp;amp;s_dfu_settings.progress, 0, sizeof(dfu_progress_t));
    memset(s_dfu_settings.init_command, 0xFF, DFU_SIGNED_COMMAND_SIZE);
    s_dfu_settings.write_offset = 0;
    s_dfu_settings.progress.update_start_address = startAddress;

    /*******************New setting added**********************************************/
    // Initialize with defaults.
	s_dfu_settings.boot_validation_softdevice.type = NO_VALIDATION;
	s_dfu_settings.boot_validation_app.type        = VALIDATE_CRC;
	s_dfu_settings.boot_validation_bootloader.type = NO_VALIDATION;
	memcpy(s_dfu_settings.boot_validation_app.bytes, &amp;amp;s_dfu_settings.bank_1.image_crc, sizeof(uint32_t));

	s_dfu_settings.settings_version = NRF_DFU_SETTINGS_VERSION;
    /*******************New setting End**********************************************/
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now I am able to update firmware after setting parameter of &amp;quot;s_dfu_settings.boot_validation_app&amp;quot; while updating bootloader setting.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is it correct way to do this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Nirav Patel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/231486?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 16:36:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32b466be-0b75-426d-babb-dd725a3dddd6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Nirav,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The bootloader will only let the app modify the bootloader settings required to permit a dual-banked update of itself. So you will get this error if you, for instance, try to change the bank 0 settings directly. It is the bootloader that is responsible&amp;nbsp;for the final validation and activation of the new application image stored in bank 1.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You may take a look at the project I posted here if you have not already:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46994/background-dfu-application-source-code/187534#187534"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/46994/background-dfu-application-source-code/187534#187534&lt;/a&gt;. It demonstrates background DFU, but with the UART transport.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/231300?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 06:42:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c7ca228-df83-41f1-9f1a-f3915722b73d</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Getting error message when try to update setting (&amp;quot;nrf_dfu_settings_write_and_backup&amp;quot;) when &amp;quot;NRF_DFU_IN_APP&amp;quot; is enabled in application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;ERROR MESSAGE:&lt;/p&gt;
&lt;p&gt;&amp;quot;&amp;lt;warning&amp;gt; nrf_dfu_settings: Settings write aborted since it tries writing to forbidden settings.&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/SDK_5F00_15_5F00_3_5F00_0_5F00_Setting_5F00_Error_5F00_Code.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Nirav Patel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/231209?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 14:50:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59af85c5-0c59-4447-bacb-b464f0868487</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Nirav,&lt;/p&gt;
[quote userid="8105" url="~/f/nordic-q-a/56993/not-able-to-update-firmware-using-bootloader-sdk15-3-0/231192"]Do I need to enable&amp;nbsp;NRF_BL_DFU_ALLOW_UPDATE_FROM_APP option in application also?[/quote]
&lt;p&gt;&lt;span&gt;No, but NRF_DFU_IN_APP must be enabled.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/231192?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 14:27:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9b281c9-757c-4d27-b06f-e05cc854b996</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;&lt;span&gt;Thanks Vidar,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_DFU_IN_APP is disabled in application.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_BL_DFU_ALLOW_UPDATE_FROM_APP option is enabled in bootloader.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do I need to enable&amp;nbsp;NRF_BL_DFU_ALLOW_UPDATE_FROM_APP option in application also?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Nirav Patel&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/231179?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 13:59:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0db69cc0-2ed8-4425-af59-9008adfc41bf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is the&amp;nbsp;NRF_DFU_IN_APP option enabled in your application project, and&amp;nbsp;is the NRF_BL_DFU_ALLOW_UPDATE_FROM_APP option enabled in your bootloader project? The settings page will not be updated if either of these are disabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/230976?ContentTypeID=1</link><pubDate>Sat, 25 Jan 2020 13:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca28e1ca-a154-4255-b12d-edde739d0e43</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Thanks Turbo J,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I used below function to update setting and its take care of backup page also.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ret_code_t nrf_dfu_settings_write_and_backup(nrf_dfu_flash_callback_t callback)
{
#if NRF_DFU_IN_APP
    ret_code_t err_code = nrf_dfu_settings_write(callback);
#else
    ret_code_t err_code = nrf_dfu_settings_write(NULL);
    if (err_code == NRF_SUCCESS)
    {
        settings_backup(callback, &amp;amp;s_dfu_settings);
    }
#endif
    return err_code;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to update firmware using bootloader (SDK15.3.0)</title><link>https://devzone.nordicsemi.com/thread/230971?ContentTypeID=1</link><pubDate>Sat, 25 Jan 2020 12:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c570609d-b5bf-4ca5-bd36-63307ae153c6</guid><dc:creator>Turbo J</dc:creator><description>[quote userid="8105" url="~/f/nordic-q-a/56993/not-able-to-update-firmware-using-bootloader-sdk15-3-0"]Why it is working in SDK 15.2.0 but not in SDK15.3.0?[/quote]
&lt;p&gt;SDK15.3 changed handling of the &lt;em&gt;backup&lt;/em&gt; settings page. &lt;/p&gt;
&lt;p&gt;The app won&amp;#39;t boot if the backup page was not written to properly, and you might missed that in the source code upgrade.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>