<?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>Dual Bank DFU and bootloader settings page</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42946/dual-bank-dfu-and-bootloader-settings-page</link><description>Hi, 
 I want to build a DFU mechanism with our own protocol, which means I build up two BLE services &amp;#39;read&amp;#39; and &amp;#39;write&amp;#39; where I can transmit the new application firmware, store it in flash and then begin to update the device. I want to use dual bank layout</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Jan 2019 10:06:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42946/dual-bank-dfu-and-bootloader-settings-page" /><item><title>RE: Dual Bank DFU and bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/168411?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 10:06:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6881731d-5f95-4b58-9f07-a08471aeeee4</guid><dc:creator>Sascha Schmidt</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;just to inform you. I&amp;#39;ve changed the Bootloader settings as you suggested in your first reply. That didn&amp;#39;t fully work. What was missing was the size of the firmware image for bank 1. When I then do a system reset the bootloader begins to update bank 0.&lt;/p&gt;
&lt;p&gt;That was what I wanted to achive!! :) So thank you very much for your help, I appreciate it very much!!&lt;/p&gt;
&lt;p&gt;Thanks and the case can be closed now &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;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dual Bank DFU and bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/167951?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 13:50:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe16114b-d091-4717-8739-e075fe8f2db8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sascha,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Good to hear. Yes please just leave the case like this. Don&amp;#39;t mark it as Verified Answer. When you update the case I will receive it in our stack.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dual Bank DFU and bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/167862?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 10:20:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88ae4e57-6ce9-4178-b335-d54ee81e78b2</guid><dc:creator>Sascha Schmidt</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I found the failure. I hadn&amp;#39;t set the section for the bootloader settings page in the linker script and I think when my application wanted to read this page from flash, it read somewhere in the flash but not the correct address. So there was nothing in the settings page structure. I will now go on and try your first sugestion with the bank codes.&lt;/p&gt;
&lt;p&gt;Thanks for your help and support again!!&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Sascha&lt;/p&gt;
&lt;p&gt;P.S. is it possible to not close this issue, so I can come back to this, if I have more problems or do I have to generate a new entry?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dual Bank DFU and bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/167843?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 09:42:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2938fd05-7231-47d5-bcc3-15f46d078232</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sascha,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If&amp;nbsp;there is no bootloader setting ,&amp;nbsp;s_dfu_settings.bank_0.image_size will return 0.&lt;/p&gt;
&lt;p&gt;But you mentioned you generated the bootloader setting with nrfutil and flash with nrfjprog, it should be there in the flash. The bootloader should load that into RAM when it&amp;#39;s booting up using nrf_dfu_settings_init() as you mentioned.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure why you came to&amp;nbsp;&lt;span&gt;nrf_fstorage_erase() if you are just loading the bootloader setting, I don&amp;#39;t think an erase needed. Please make sure the nrf_dfu_flash_init() uses&amp;nbsp;nrf_fstorage_sd instead of&amp;nbsp;nrf_fstorage_nvmc if you are using the softdevice.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;(If you are using SDK v15.2 there is a backup bootloader setting page that should be identical to the bootloader setting. Have you double checked ? )&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you have the mechanism to receive image on your application, you can reduce the size of the bootloader largely as you only use the swapping part (with some CRC check and bootloader setting storage) of the bootloader. But of course&amp;nbsp;there&amp;#39;s&amp;nbsp;also an option to keep the original bootloader features as a backup, just in case something happens to your application.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dual Bank DFU and bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/167689?ContentTypeID=1</link><pubDate>Thu, 24 Jan 2019 14:56:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02e51c45-0f94-4a18-9e9a-69b4ba1d66b0</guid><dc:creator>Sascha Schmidt</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First of all I have to tell that I&amp;#39;m using GCC compiler with makefile and linkerscript and Eclipse as a &amp;#39;TextEditor&amp;#39;, SDK 15.2.0 and nrf52832.&lt;/p&gt;
&lt;p&gt;I have the softdevice (S132 v6.0) programmed at the beginning of memory and the bootloader from Nordics Secure bootloader example at address 0x73000 (I know that the bootloader code can be smaller, but I have switched the optimization level so I can debug the bootloader). Next to the SoftDevice is the application located (around 70kB by now).&lt;/p&gt;
&lt;p&gt;Transmitting and storing the firmware to the proper memory region shall be done from the application. In the application I want to set the bootloader settings in a way that the bootloader only &amp;quot;swaps&amp;quot; the memory regions (actually it shall check if&amp;nbsp; the new firmware image is correct and then overwrite the old firmware).&lt;/p&gt;
&lt;p&gt;Short explanation of where my first question came from:&lt;/p&gt;
&lt;p&gt;I used the function nrf_dfu_bank1_start_addr() and it returns the same value as nrf_dfu_bank0_start_addr(), so my thought was, that I did something wrong at configuring the memory layout. I made some tests and by now I think that I haven&amp;#39;t loaded the bootloader settings page, which is stored in memory (the settings page for the &amp;quot;old&amp;quot; firmware I&amp;#39;m generating with nrfutil and programm it with nrfjprog). Now I tried using nrf_dfu_settings_init() to load the settingspage to&amp;nbsp;s_dfu_settings variable, but I get an error from&amp;nbsp; nrf_fstorage_erase() (error 0x10). I looked up the error code and it says NRF_ERROR_INVALID_FLAGS. I&amp;#39;m now searching for the flags that I have to set to get it to work.&lt;/p&gt;
&lt;p&gt;Perhaps you can help me with that? After I&amp;#39;ve got that, I can try to set the bank codes and see if the bootloader does what I want &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;Thanks in advance for your help!!! Hope my explanation is understandable &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;Kind regards&lt;/p&gt;
&lt;p&gt;Sascha&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dual Bank DFU and bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/167677?ContentTypeID=1</link><pubDate>Thu, 24 Jan 2019 14:24:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85676b5d-e66e-450f-a7ec-af8cc65339af</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sascha,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you explain a little bit more on the&amp;nbsp;firmware on the chip ? How do you plan to use the bootloader ? I assume you will have to modify the bootloader since the image receiving will be done by the application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The memory bank configuration in our bootloader is&amp;nbsp;pretty simple. You can have a look at nrf_dfu_bank1_start_addr() . Bank 1 starts from the last address of the original image. You can have a look &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/lib_bootloader_dfu_banks"&gt;here &lt;/a&gt;as well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want the bootloader to swap image, you would need to set bank1.bank_code =&amp;nbsp;NRF_DFU_BANK_VALID_APP and&amp;nbsp;bank_0.bank_code = NRF_DFU_BANK_INVALID&lt;/p&gt;
&lt;p&gt;Please refer to&amp;nbsp;postvalidate_app() function in the bootloader.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>