<?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>Changing the Serial DFU bootloader to OTA DFU bootloader.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20109/changing-the-serial-dfu-bootloader-to-ota-dfu-bootloader</link><description>I have bootloader that supports Serial(HCI) DFU on the nrf52832 device which I have to update to Bootloader that supports OTA DFU and also a new application firmware. I tried following things: 
 
 generated a combined zip of new bootloader and new application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Mar 2017 12:37:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20109/changing-the-serial-dfu-bootloader-to-ota-dfu-bootloader" /><item><title>RE: Changing the Serial DFU bootloader to OTA DFU bootloader.</title><link>https://devzone.nordicsemi.com/thread/78296?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2017 12:37:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d258edee-add8-439d-966d-bb9033301fdf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sourabh,&lt;/p&gt;
&lt;p&gt;I just checked the bootloader in SDK v11 again, seems that the combination bootloader+application is not supported in this bootloader.&lt;/p&gt;
&lt;p&gt;In the new secure bootloader from SDK v12 we do support all combinations.&lt;/p&gt;
&lt;p&gt;If I recall correctly, when the bootloader is updated, it automatically mark the application as invalid and wait for an update.&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s OK for you to do two step, first update the bootloader, 2nd update the application via OTA. Then you don&amp;#39;t need to modify anything.&lt;/p&gt;
&lt;p&gt;If you really need to have application+bootloader, we can think of modifying the bootloader so it won&amp;#39;t check for application valid in the bootloader setting on the first time it starts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing the Serial DFU bootloader to OTA DFU bootloader.</title><link>https://devzone.nordicsemi.com/thread/78295?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2017 11:45:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f675e145-675b-4f09-9019-a3e3ab9145c3</guid><dc:creator>Sourabh Barve</dc:creator><description>&lt;p&gt;Hi Hung,
I tried both things as you mentioned and in both cases the new OTA bl worked as expected.&lt;/p&gt;
&lt;p&gt;I read out the code from flash and I found out that the one line in bootloader region at address 0x7F000 as this:
:10F00000&lt;strong&gt;FF&lt;/strong&gt;000000FF000000000000000000000002&lt;/p&gt;
&lt;p&gt;which needs to be as this for normal working: (This I got from the hex dump of a working OTA bl case)
:10F00000&lt;strong&gt;01&lt;/strong&gt;000000FF0000004CD1030000000000E0&lt;/p&gt;
&lt;p&gt;And this is the patch that needs to be applied to the application hex when flashing through nrfjprog to make the bootloader think that APP is Valid.&lt;/p&gt;
&lt;p&gt;So after the serial DFU the OTA bl thinks that the APP is not Valid.&lt;/p&gt;
&lt;p&gt;So I tried changing this in OTA bl:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (bootloader_app_is_valid(DFU_BANK_0_REGION_START) &amp;amp;&amp;amp; !bootloader_dfu_sd_in_progress())
{
    // Select a bank region to use as application region.
    // @note: Only applications running from DFU_BANK_0_REGION_START is supported.
	bootloader_app_start(DFU_BANK_0_REGION_START);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    if (1)
{
    // Select a bank region to use as application region.
    // @note: Only applications running from DFU_BANK_0_REGION_START is supported.
    bootloader_app_start(DFU_BANK_0_REGION_START);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But still the application doesn&amp;#39;t start/device hangs. And even the bootloader is not running as I can&amp;#39;t see the device as &amp;quot;DfuTarg&amp;quot; through bluetooth scan using my mobile phone which I usually see when a OTA bootloader is running.&lt;/p&gt;
&lt;p&gt;So now the application start address is not available to the new bootloader.&lt;/p&gt;
&lt;p&gt;I would like to attach the hex dumps I got from the working and not working scenarios, but I don&amp;#39;t know how to attach files here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing the Serial DFU bootloader to OTA DFU bootloader.</title><link>https://devzone.nordicsemi.com/thread/78294?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 14:10:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04003cae-a0c2-46d1-bc61-a78ea22143df</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sourabh,&lt;/p&gt;
&lt;p&gt;I would suggest you verify first:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If the new OTA bootloader work properly (when flashing using a programmer)&lt;/li&gt;
&lt;li&gt;If any bootloader setting are conflict between the Serial and the BLE bootloader&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You should try to update only the OTA bootloader first and then try to do OTA DFU the application. Just to make sure all of them work together.&lt;/p&gt;
&lt;p&gt;Then you can start to debug the bootloader and check why it doesn&amp;#39;t jump to the application. You can also read out the flash (nrfjprog.exe --readcode ) and compare the hex to see what could be the difference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>