<?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>DFU (no bonding) getting stuck</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64861/dfu-no-bonding-getting-stuck</link><description>I&amp;#39;m attempting to perform DFU with the secure bootloader (bonding not required) and it is hanging after starting the update. Here&amp;#39;s the log from the firmware (SDK 16.0.0): 
 
 
 Here&amp;#39;s the log from the App (using nordic iOS DFU library, master branch</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Aug 2020 14:01:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64861/dfu-no-bonding-getting-stuck" /><item><title>RE: DFU (no bonding) getting stuck</title><link>https://devzone.nordicsemi.com/thread/265141?ContentTypeID=1</link><pubDate>Tue, 18 Aug 2020 14:01:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fa4ec6a-8800-4bf2-b533-08b8ff32226b</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;It is getting the bank1 offset, which is bank 0 start address + bank 0 size. But how is that defined? Here is the output when generating the bootloader DFU settings:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Bootloader DFU Settings:
* File:                     ...DevKit_bootloader_setting.hex
* Family:                   nRF52
* Start Address:            0x0007F000
* CRC:                      0x21811082
* Settings Version:         0x00000002 (2)
* App Version:              0x0000271B (10011)
* Bootloader Version:       0x00000001 (1)
* Bank Layout:              0x00000000
* Current Bank:             0x00000000
* Application Size:         0x0004C000 (311296 bytes)
* Application CRC:          0x4D0DA3C7
* Bank0 Bank Code:          0x00000001
* Softdevice Size:          0x000248C0 (149696 bytes)
* Boot Validation CRC:      0xACDA1BA2
* SD Boot Validation Type:  0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I noticed that nrfutil settings generate says that the settings get backed up to (settings address - 0x1000) which in my case is 0x7E000, which is the MBR params, is this correct?&lt;/p&gt;
&lt;p&gt;After a bit more debugging I can see cache address = 0x72000, bootloader_start_addr = 0x72000 (correct), DFU_REGION_END(bootloader_start_addr) = 0x6E000 (correct: 0x72000 - 3 FDS pages (0x3000) - 0x1000 for the reserved flash).&lt;/p&gt;
&lt;p&gt;However, for some reason the assert isn&amp;#39;t triggering:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ASSERT(cache_address &amp;lt;= DFU_REGION_END(bootloader_start_addr));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And then this ends up being false (incorrect):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cache_too_small = required_size &amp;gt; (DFU_REGION_END(bootloader_start_addr) - cache_address);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I think under the assert should be something like this in case assert is disabled:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(cache_address &amp;gt; DFU_REGION_END(bootloader_start_addr)) {
    cache_too_small = true;
    break;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However that doesn&amp;#39;t explain why cache_address is incorrect. For some reason the bootloader settings indicates the application size is 0x4C000 which is the size of all the available application space (but the firmware itself is only 271609 = 0x424F8). How is the bank0/application size calculated when generating the dfu settings?&lt;/p&gt;
&lt;p&gt;...it seems it converts to .bin and uses the size of the file. So why is the .hex converted to .bin 0x4C000? I confirmed it is that size using hex2bin.&lt;/p&gt;
&lt;p&gt;...ah because of my provisioning block, need to remove the symbol. After modifying the arm-none-eabi-objcopy command to remove the symbol, it&amp;#39;s working now!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU (no bonding) getting stuck</title><link>https://devzone.nordicsemi.com/thread/265086?ContentTypeID=1</link><pubDate>Tue, 18 Aug 2020 12:03:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a278a9ff-72ad-4e31-95a9-8d57bd08f51b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I agree this must be a different issue. The question is why the bootloader attempts to erase the flash page at 0x72000 as the log says. It should have been a page in bank 0 or bank 1. I would suggest that you step through the nrf_dfu_cache_prepare() to try find out why it&amp;#39;s returning the wrong address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU (no bonding) getting stuck</title><link>https://devzone.nordicsemi.com/thread/264913?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 14:31:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc85a2d2-118d-4e84-9342-7d653bc4c3e6</guid><dc:creator>nrbrook</dc:creator><description>&lt;p&gt;I don&amp;#39;t think this is the issue. I&amp;#39;m using armgcc. My App linker file looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;MEMORY
{
    /* MBR_FLASH (rx)        : ORIGIN = 0x00000000, LENGTH = 0x00001000 */
    /* SOFTDEVICE_FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 0x00025000 */

    FLASH (rx)               : ORIGIN = 0x00026000, LENGTH = 0x0004b000
    RAM (rwx)                : ORIGIN = 0x20003320, LENGTH = 0x0000cce0

    provisioning_data (rwx)  : ORIGIN = 0x00071000, LENGTH = 0x00001000

    /* BOOTLOADER_FLASH (rx) : ORIGIN 0x00072000, LENGTH = 0x0000c000 */
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;% arm-none-eabi-size FirmwareProject_DevKit.elf
   text    data     bss     dec     hex filename
 271608    7360   26880  305848   4aab8 FirmwareProject_DevKit.elf
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Bootloader looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x72000, LENGTH = 0xc000
  RAM (rwx) :  ORIGIN = 0x20003320, LENGTH = 0xcce0
  uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
  bootloader_settings_page (r) : ORIGIN = 0x0007F000, LENGTH = 0x1000
  uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
  mbr_params_page (r) : ORIGIN = 0x0007E000, LENGTH = 0x1000
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;% arm-none-eabi-size bootloader.out
   text    data     bss     dec     hex filename
  44660    1400   22436   68496   10b90 bootloader.out
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So addresses are&lt;/p&gt;
&lt;p&gt;0x26000-0x71000 Firmware&lt;/p&gt;
&lt;p&gt;0x71000-0x72000 Reserved flash storage&lt;/p&gt;
&lt;p&gt;0x72000-0x7E000 Bootloader&lt;/p&gt;
&lt;p&gt;0x7E000-0x7F000 mbr params&lt;/p&gt;
&lt;p&gt;0x7F000-0x80000 bootloader settings&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;firmware size 271608 &amp;lt; flash space 0x4b000 = 307200&lt;/p&gt;
&lt;p&gt;bootloader size 44660 &amp;lt; flash space 0xc000 = 49152&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve just tried 17.0.0 and it has the same issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU (no bonding) getting stuck</title><link>https://devzone.nordicsemi.com/thread/264836?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 11:15:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90fb6626-9115-43ca-9951-947f799e7bc1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;In case you are using Segger embedded studio and have made changes to the bootloader that may have increased the code size, please try to re-compile the bootloader with the updated flash_placement.xml file from SDK 17.0.0 as I recommend here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/64730/micro-ecc-a-file-not-included/264581#264581"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/64730/micro-ecc-a-file-not-included/264581#264581.&lt;/a&gt;The original one will not give you a linker warning even if the bootloader starts to overlap with the MBR params page, which may result in the behavior you described.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>