<?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>Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57675/buttonless-dfu-not-flashing-new-firmware-sdk-15-2-0</link><description>Hello, 
 We are trying to get DFU to work on our custom board running nrf52832. It has previously worked on the devkit. Our board does not have a crystal so we are using NRF_CLOCK_LF_SRC_RC both in the bootloader and application. Our bootloader is based</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Feb 2020 13:38:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57675/buttonless-dfu-not-flashing-new-firmware-sdk-15-2-0" /><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/235733?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2020 13:38:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ccaf198-83ae-4aed-b289-0b4b16109468</guid><dc:creator>nem22</dc:creator><description>&lt;p&gt;Thank you, DFU is working on our custom boards now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/235723?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2020 13:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5191da00-d8eb-4113-ad76-be6dbfad837f</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;&lt;span&gt;nrf_dfu_settings_write uses the&amp;nbsp;&lt;em&gt;m_dfu_settings_buffer&lt;/em&gt; location of the as the address,&amp;nbsp;&lt;em&gt;m_dfu_settings_buffer&lt;/em&gt;&amp;nbsp;is defined as&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint8_t m_dfu_settings_buffer[BOOTLOADER_SETTINGS_PAGE_SIZE]
    __attribute__((section(&amp;quot;.bootloader_settings_page&amp;quot;)))
    __attribute__((used));&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;in nrf_dfu_settings.c. The&amp;nbsp;.bootloader_settings_page section (and the .&amp;nbsp;mbr_params_page section)&amp;nbsp; is defined in the flash_placement.xml file as&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; &amp;lt;MemorySegment name=&amp;quot;bootloader_settings_page&amp;quot; start=&amp;quot;0x0007F000&amp;quot; size=&amp;quot;0x1000&amp;quot;&amp;gt;
    &amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; keep=&amp;quot;Yes&amp;quot; load=&amp;quot;No&amp;quot; name=&amp;quot;.bootloader_settings_page&amp;quot; address_symbol=&amp;quot;__start_bootloader_settings_page&amp;quot; end_symbol=&amp;quot;__stop_bootloader_settings_page&amp;quot; start = &amp;quot;0x0007F000&amp;quot; size=&amp;quot;0x1000&amp;quot; /&amp;gt;
  &amp;lt;/MemorySegment&amp;gt;
  &amp;lt;MemorySegment name=&amp;quot;mbr_params_page&amp;quot; start=&amp;quot;0x0007E000&amp;quot; size=&amp;quot;0x1000&amp;quot;&amp;gt;
    &amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; keep=&amp;quot;Yes&amp;quot; load=&amp;quot;No&amp;quot; name=&amp;quot;.mbr_params_page&amp;quot; address_symbol=&amp;quot;__start_mbr_params_page&amp;quot; end_symbol=&amp;quot;__stop_mbr_params_page&amp;quot; start = &amp;quot;0x0007E000&amp;quot; size=&amp;quot;0x1000&amp;quot; /&amp;gt;
  &amp;lt;/MemorySegment&amp;gt;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Change these to&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="xml"&gt; &amp;lt;MemorySegment name=&amp;quot;bootloader_settings_page&amp;quot; start=&amp;quot;0x0003F000&amp;quot; size=&amp;quot;0x1000&amp;quot;&amp;gt;
    &amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; keep=&amp;quot;Yes&amp;quot; load=&amp;quot;No&amp;quot; name=&amp;quot;.bootloader_settings_page&amp;quot; address_symbol=&amp;quot;__start_bootloader_settings_page&amp;quot; end_symbol=&amp;quot;__stop_bootloader_settings_page&amp;quot; start = &amp;quot;0x0003F000&amp;quot; size=&amp;quot;0x1000&amp;quot; /&amp;gt;
  &amp;lt;/MemorySegment&amp;gt;
  &amp;lt;MemorySegment name=&amp;quot;mbr_params_page&amp;quot; start=&amp;quot;0x0003E000&amp;quot; size=&amp;quot;0x1000&amp;quot;&amp;gt;
    &amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; keep=&amp;quot;Yes&amp;quot; load=&amp;quot;No&amp;quot; name=&amp;quot;.mbr_params_page&amp;quot; address_symbol=&amp;quot;__start_mbr_params_page&amp;quot; end_symbol=&amp;quot;__stop_mbr_params_page&amp;quot; start = &amp;quot;0x0003E000&amp;quot; size=&amp;quot;0x1000&amp;quot; /&amp;gt;
  &amp;lt;/MemorySegment&amp;gt;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;That should solve the issue I think.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/235707?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2020 12:29:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a277d9b-7c1e-41f9-8d4b-fc5fa153fdc9</guid><dc:creator>nem22</dc:creator><description>&lt;p&gt;Hi, thanks for explaining the size requirements,&lt;/p&gt;
&lt;p&gt;After setting&amp;nbsp;&lt;span&gt;NRF_DFU_APP_DATA_AREA_SIZE to 0 I get this from the debug bootloader while sending zip to dfutarg:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; nrf_dfu_validation: Write address set to 0x00026000
&amp;lt;debug&amp;gt; nrf_dfu_settings: Writing settings...
&amp;lt;debug&amp;gt; nrf_dfu_settings: Erasing old settings at: 0x0007F000
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 0
&amp;lt;error&amp;gt; app: Received a fault! id: 0x00004002, pc: 0x00000000, info: 0x2000FF10&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand why it&amp;#39;s trying to erase settings at that address when I set&amp;nbsp;BOOTLOADER_SETTINGS_ADDRESS to 0x0003F000&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/235577?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 19:51:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e1549a0-9445-4387-8ad1-117fb9bbe9a8</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;The debug bootloader takes up 0xC000 bytes( 49152 bytes, 48kB) in addition to the two last flash pages for the bootloader settings and the MBR params page which is 8kB in total&amp;nbsp; , the SoftDevie needs 0x26000 bytes, so&amp;nbsp;the&amp;nbsp;total flash usage will be 0x34000, i.e. 208kB, i.e. there is 48 kB left. The bootloader also reserves 3 flash pages(4kB each), i.e. 12kB for the Peer Manager and FDS below the bootloader, this is set by&amp;nbsp;NRF_DFU_APP_DATA_AREA_SIZE in the sdk_config.h file of the bootloader.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the linker settings and screenshot you posted it seems like the application needs 0xB860 bytes( 46kB). So if you set the&amp;nbsp;&lt;span&gt;NRF_DFU_APP_DATA_AREA_SIZE&amp;nbsp; to 0 then I think the update should go through with the debug bootloader.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/235533?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 15:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43315c84-d967-4f06-9331-1acf9ef5d07f</guid><dc:creator>nem22</dc:creator><description>[quote userid="7571" url="~/f/nordic-q-a/57675/buttonless-dfu-not-flashing-new-firmware-sdk-15-2-0/235497"]Ok, and you&amp;#39;re not able to perform a application DFU? Or did you want the device to boot to the application and not stay in the bootloader?[/quote]
&lt;p&gt;Indeed, when I flash app+settings, sd and bootloader the app is supposed to load. I am also not able to perform a dfu through dfutarg.&lt;/p&gt;
&lt;p&gt;I have tried the debug bootloader(with logs) and normal bootloader and the behavior is different.&lt;/p&gt;
&lt;p&gt;Debug bootloader returns this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;warning&amp;gt; app: Aborting. Cannot fit new firmware on device
&amp;lt;error&amp;gt; nrf_dfu_validation: Can&amp;#39;t find room for update
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x4
&amp;lt;warning&amp;gt; nrf_dfu_ble: DFU request 4 failed with error: 0x4&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Non-debug bootloader accepts the zip (so it&amp;#39;s not error 0x4 because the data is transfered), disconnects and then the board is not advertising anything&lt;/p&gt;
&lt;p&gt;I can even reproduce all this on the devkit, presumably something is wrong in my linker section placement macros.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/235497?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 14:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dd9d300-cffc-4273-842e-70c263acbe9d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Aha, that explains everything! If you are using the&amp;nbsp;&lt;/p&gt;
&lt;p&gt;then you need to modify some defines in the bootloader source code as the QFAB variant is not &amp;quot;officially&amp;quot; supported in the SDK. Here is the diff for the necessary changes:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;diff -Nurb nRF5_SDK_15.3.0_59ac345/components/libraries/bootloader/dfu/nrf_dfu_types.h nRF5_SDK_15.3.0_59ac345-mod/components/libraries/bootloader/dfu/nrf_dfu_types.h
--- nRF5_SDK_15.3.0_59ac345/components/libraries/bootloader/dfu/nrf_dfu_types.h	2019-02-14 17:24:58.000000000 +0000
+++ nRF5_SDK_15.3.0_59ac345-mod/components/libraries/bootloader/dfu/nrf_dfu_types.h	2019-04-23 15:54:10.523901768 +0100
@@ -65,7 +65,6 @@
 extern &amp;quot;C&amp;quot; {
 #endif
 
-
 #define INIT_COMMAND_MAX_SIZE      512 /**&amp;lt; Maximum size of the init command stored in dfu_settings. */
 #define INIT_COMMAND_MAX_SIZE_v1   256 /**&amp;lt; Maximum size of the init command in settings version 1. */
 
@@ -99,6 +98,8 @@
     #define BOOTLOADER_SETTINGS_ADDRESS     (0x0002F000UL)
 #elif defined( NRF52832_XXAA )
     #define BOOTLOADER_SETTINGS_ADDRESS     (0x0007F000UL)
+#elif defined( NRF52832_XXAB )
+    #define BOOTLOADER_SETTINGS_ADDRESS     (0x0003F000UL)
 #elif defined(NRF52840_XXAA)
     #define BOOTLOADER_SETTINGS_ADDRESS     (0x000FF000UL)
 #else
@@ -121,6 +122,8 @@
     #define NRF_MBR_PARAMS_PAGE_ADDRESS         (0x000FE000UL)
 #elif defined(NRF52832_XXAA)
     #define NRF_MBR_PARAMS_PAGE_ADDRESS         (0x0007E000UL)
+#elif defined(NRF52832_XXAB)
+    #define NRF_MBR_PARAMS_PAGE_ADDRESS         (0x0003E000UL)
 #elif defined(NRF52810_XXAA)
     #define NRF_MBR_PARAMS_PAGE_ADDRESS         (0x0002E000UL)
 #elif defined(NRF52811_XXAA)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But it seems that you have done these changes already so that seems good.&amp;nbsp;&lt;/p&gt;
[quote user="nem22"]Unfortunately now the device is stuck in bootloader advertising as dfutarg.[/quote]
&lt;p&gt;Ok, and you&amp;#39;re not able to perform a application DFU? Or did you want the device to boot to the application and not stay in the bootloader?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/235458?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 13:07:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:978f2d76-aab7-45e1-9962-c7c7f188fabe</guid><dc:creator>nem22</dc:creator><description>&lt;p&gt;Hello, sorry for not pointing this out earlier but I just realized we use the QFAB version of nrf52832 with only 256kb flash. I was using an older version of nrfjprog and it would let me flash the full 512kb. After updating to latest command line tools it printed errors about&amp;nbsp;&lt;span&gt;data outside valid areas&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;I updated linker macros in segger to fit everything below 0x40000 address. Below is an image of everything bootloader, app and SD.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x0/__key/communityserver-discussions-components-files/4/3817.hex.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a list of things I&amp;#39;ve done, have I missed something?&lt;/p&gt;
&lt;p&gt;bootloader section placement macros:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;FLASH_PH_START=0x0
FLASH_PH_SIZE=0x40000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x10000
FLASH_START=0x32000
FLASH_SIZE=0xc000
RAM_START=0x200057b8
RAM_SIZE=0xa848&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;bootloader memory segments:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;FLASH RX 0x0 0x40000;RAM RWX 0x20000000 0x8000;mbr_params_page RX 0x0003E000 0x1000;bootloader_settings_page RX 0x0003F000 0x1000;uicr_mbr_params_page RX 0x10001018 0x4;uicr_bootloader_start_address RX 0x10001014 0x4&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;app section placement macros:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;FLASH_PH_START=0x0 
FLASH_PH_SIZE=0x40000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x10000
FLASH_START=0x26000
FLASH_SIZE=0x1a000
RAM_START=0x20003398
RAM_SIZE=0x4c68&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;changes in nrf_dfu_types.h&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define BOOTLOADER_SETTINGS_ADDRESS     (0x0003F000UL)
#define NRF_MBR_PARAMS_PAGE_ADDRESS         (0x0003E000UL)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I generated settings with&amp;nbsp;--family NRF52QFAB&lt;/p&gt;
&lt;p&gt;Unfortunately now the device is stuck in bootloader advertising as dfutarg.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/235353?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 08:41:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf4ec9e1-ed55-46ad-b68a-b57c3964b0f6</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hmm, I cant really see any reason for the flash operations on the bootloader settings page to fail on custom boards with nRF52832, but not on nRF52 DKs. Its the same compile bootloader binary that is flashed to both boards right?&lt;/p&gt;
&lt;p&gt;When you&amp;#39;re using fstorage, you&amp;#39;re not writing to the two last flash pages right, i.e. pages with start address 0x7E000 or 0x7F000?&lt;/p&gt;
&lt;p&gt;Does all the nRF52832s on the custom boards have the same build code? Its unlikely that this is a HW issue, but I&amp;#39;ll just run the build code by QA to check if there are any issues with that particular batch.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/234643?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 12:47:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5d03255-1663-47c5-b126-5504a769c701</guid><dc:creator>nem22</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Yes, the issue happens on every custom board we have.&lt;/p&gt;
&lt;p&gt;We use fstorage in the application and it is working on custom boards. DFU also does not work if we only flash bootloader+SD on the device and update through the bootloader only (no buttonless).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/234435?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 13:57:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9110ceb5-4d8f-4164-b660-9d69b6e4ace2</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ah, my bad. I now see that the log messages does not fit and it makes sense as&amp;nbsp;nrf_fstorage_write/erase will only queue the flash operations which are asynchronous. So the queuing of the flash operations are ok, but the operation it self( which occurs afterwards) fails with&amp;nbsp;NRF_ERROR_INTERNAL.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The question is then why would the erase and write operations fail with&amp;nbsp;&lt;span&gt;NRF_ERROR_INTERNAL.&lt;br /&gt;&lt;br /&gt;Do you see this issue on multiple custom boards or just one?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/234390?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 12:09:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9f249c1-4b99-496a-b07f-392c4f5027cd</guid><dc:creator>nem22</dc:creator><description>&lt;p&gt;Hello Bjorn,&lt;/p&gt;
&lt;p&gt;I added a breakpoint&amp;nbsp;before nrf_fstorage_erase() in nrf_dfu_flash, using&amp;nbsp;if(page_addr==0x0007F000) to catch the problematic call. The moment&amp;nbsp;nrf_fstorage_erase() returns, rc is set to 0.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrf_fstorage_erase() and&amp;nbsp;nrf_fstorage_write() both return 0, the error is printed by&amp;nbsp;dfu_fstorage_evt_handler()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t nrf_dfu_flash_erase(uint32_t                 page_addr,
                               uint32_t                 num_pages,
                               nrf_dfu_flash_callback_t callback)
{
    ret_code_t rc;

    NRF_LOG_DEBUG(&amp;quot;nrf_fstorage_erase(addr=0x%p, len=%d pages), queue usage: %d&amp;quot;,
                  page_addr, num_pages, m_flash_operations_pending);

    if(page_addr==0x0007F000)
      NRF_LOG_INFO(&amp;quot;0x0007F000&amp;quot;);

    //lint -save -e611 (Suspicious cast)
    rc = nrf_fstorage_erase(&amp;amp;m_fs, page_addr, num_pages, (void *)callback);
    //lint -restore
    NRF_LOG_INFO(&amp;quot;nrf_fstorage_erase() returned %d in nrf_dfu_flash&amp;quot;, rc);


    if ((NRF_LOG_ENABLED) &amp;amp;&amp;amp; (rc == NRF_SUCCESS))
    {
        m_flash_operations_pending++;
    }
    else
    {
        NRF_LOG_WARNING(&amp;quot;nrf_fstorage_erase() failed with error 0x%x.&amp;quot;, rc);
    }

    return rc;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/234357?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 10:15:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f10c01f-128e-4720-85b3-4d5652f864da</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi nem22,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;to me that makes no sense. How can&amp;nbsp;nrf_fstorage_write() and&amp;nbsp;nrf_fstorage_erase() return return code 0x03, which in turn is returned by&amp;nbsp;nrf_dfu_flash_erase() and&amp;nbsp;nrf_dfu_flash_store()&amp;nbsp;as err_code in&amp;nbsp;&amp;nbsp;settings_write()? A non-zero( i.e. not NRF_SUCCESS) should be caught by the&amp;nbsp;if (err_code != NRF_SUCCESS) check. Can you double check that rc in&amp;nbsp;nrf_dfu_flash_store/erase is not modified between the&amp;nbsp;nrf_fstorage_write/erase call and the return rc statment?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t nrf_dfu_flash_store(uint32_t                   dest,
                               void               const * p_src,
                               uint32_t                   len,
                               nrf_dfu_flash_callback_t   callback)
{
    ret_code_t rc;

    NRF_LOG_DEBUG(&amp;quot;nrf_fstorage_write(addr=%p, src=%p, len=%d bytes), queue usage: %d&amp;quot;,
                  dest, p_src, len, m_flash_operations_pending);

    //lint -save -e611 (Suspicious cast)
    rc = nrf_fstorage_write(&amp;amp;m_fs, dest, p_src, len, (void *)callback);
    //lint -restore

    if ((NRF_LOG_ENABLED) &amp;amp;&amp;amp; (rc == NRF_SUCCESS))
    {
        m_flash_operations_pending++;
    }
    else
    {
        NRF_LOG_WARNING(&amp;quot;nrf_fstorage_write() failed with error 0x%x.&amp;quot;, rc);
    }

    return rc;
}

ret_code_t nrf_dfu_flash_erase(uint32_t                 page_addr,
                               uint32_t                 num_pages,
                               nrf_dfu_flash_callback_t callback)
{
    ret_code_t rc;

    NRF_LOG_DEBUG(&amp;quot;nrf_fstorage_erase(addr=0x%p, len=%d pages), queue usage: %d&amp;quot;,
                  page_addr, num_pages, m_flash_operations_pending);

    //lint -save -e611 (Suspicious cast)
    rc = nrf_fstorage_erase(&amp;amp;m_fs, page_addr, num_pages, (void *)callback);
    //lint -restore

    if ((NRF_LOG_ENABLED) &amp;amp;&amp;amp; (rc == NRF_SUCCESS))
    {
        m_flash_operations_pending++;
    }
    else
    {
        NRF_LOG_WARNING(&amp;quot;nrf_fstorage_erase() failed with error 0x%x.&amp;quot;, rc);
    }

    return rc;
}

static ret_code_t settings_write(void                   * p_dst,
                                 void const             * p_src,
                                 nrf_dfu_flash_callback_t callback,
                                 nrf_dfu_settings_t     * p_dfu_settings_buffer)
{
    ret_code_t err_code;

    if (memcmp(p_dst, p_src, sizeof(nrf_dfu_settings_t)) == 0)
    {
        NRF_LOG_DEBUG(&amp;quot;Destination settings are identical to source, write not needed. Skipping.&amp;quot;);
        if (callback != NULL)
        {
            callback(NULL);
        }
        return NRF_SUCCESS;
    }

    if (NRF_DFU_SETTINGS_IN_APP &amp;amp;&amp;amp; !settings_forbidden_parts_equal_to_backup((uint8_t *)&amp;amp;s_dfu_settings))
    {
        NRF_LOG_WARNING(&amp;quot;Settings write aborted since it tries writing to forbidden settings.&amp;quot;);
        // Assuming NRF_DFU_SETTINGS_ALLOW_UPDATE_FROM_APP is configured the same as in bootloader.
        return NRF_ERROR_FORBIDDEN;
    }

    NRF_LOG_DEBUG(&amp;quot;Writing settings...&amp;quot;);
    NRF_LOG_DEBUG(&amp;quot;Erasing old settings at: 0x%08x&amp;quot;, p_dst);

    // Not setting the callback function because ERASE is required before STORE
    // Only report completion on successful STORE.
    err_code = nrf_dfu_flash_erase((uint32_t)p_dst, 1, NULL);

    if (err_code != NRF_SUCCESS)
    {
        NRF_LOG_ERROR(&amp;quot;Could not erase the settings page!&amp;quot;);
        return NRF_ERROR_INTERNAL;
    }

    ASSERT(p_dfu_settings_buffer != NULL);
    memcpy(p_dfu_settings_buffer, p_src, sizeof(nrf_dfu_settings_t));

    err_code = nrf_dfu_flash_store((uint32_t)p_dst,
                                   p_dfu_settings_buffer,
                                   sizeof(nrf_dfu_settings_t),
                                   callback);

    if (err_code != NRF_SUCCESS)
    {
        NRF_LOG_ERROR(&amp;quot;Could not write the DFU settings page!&amp;quot;);
        return NRF_ERROR_INTERNAL;
    }

    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/p&gt;
[quote user="nem22"]Is there a&amp;nbsp;SB or jumper on the DK I can use to confirm it&amp;#39;s not using the crystal?[/quote]
&lt;p&gt;&amp;nbsp;No, the 32kHz crystal is connected directly to the nRF52832 on the nRF52DK. There are no jumpers or solder bridges in between.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/234041?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2020 15:59:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdc099e6-422b-4db3-9029-67cd12815c08</guid><dc:creator>nem22</dc:creator><description>&lt;p&gt;Hello Bjorn,&lt;/p&gt;
&lt;p&gt;I have not been able to reproduce the issue on nRF52 DK, dfu works perfectly, no errors when flashing settings page.&lt;/p&gt;
&lt;p&gt;I added log_infos after&amp;nbsp;nrf_dfu_flash_erase and&amp;nbsp;nrf_dfu_flash_store and they are both returning 0 - NRF_SUCCESS&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; nrf_dfu_settings: Writing settings...
&amp;lt;debug&amp;gt; nrf_dfu_settings: Erasing old settings at: 0x0007F000
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash erase failed (0x3): addr=0x0007F000, len=0x1 bytes, pending 0
&amp;lt;info&amp;gt; nrf_dfu_settings: flash erase err code: 0
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, src=0x200074D0, len=440 bytes), queue usage: 1
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write failed (0x3): addr=0x0007F000, len=0x1B8 bytes, pending 0
&amp;lt;info&amp;gt; nrf_dfu_settings: flash store err code: 0
&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0x7E000.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Writing settings...
&amp;lt;debug&amp;gt; nrf_dfu_settings: Erasing old settings at: 0x0007E000
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007E000, len=1 pages), queue usage: 1
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash erase failed (0x3): addr=0x0007E000, len=0x1 bytes, pending 0
&amp;lt;info&amp;gt; nrf_dfu_settings: flash erase err code: 0
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x0007E000, src=0x20007688, len=440 bytes), queue usage: 1
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write failed (0x3): addr=0x0007E000, len=0x1B8 bytes, pending 0
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: All flash operations have completed. DFU completed.
&amp;lt;debug&amp;gt; app: Shutting down transports (found: 1)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Is there a&amp;nbsp;SB or jumper on the DK I can use to confirm it&amp;#39;s not using the crystal?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU not flashing new firmware SDK 15.2.0</title><link>https://devzone.nordicsemi.com/thread/233930?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2020 10:43:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95c9c24f-47d0-4ac5-a41a-84b06237c7f0</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Nem22,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;are you able to reproduce this on a nRF52 DK? If so then I would be great if you could share the project&amp;nbsp; + dfu images so that I could debug it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am not seeing any&amp;nbsp;&amp;quot;Could not erase the settings page!&amp;quot; or&amp;nbsp;&amp;quot;Could not write the DFU settings page!&amp;quot; statements in the log output, which I would expect when&amp;nbsp;nrf_fstorage_write() and&amp;nbsp;nrf_fstorage_erase() are returning&amp;nbsp;NRF_ERROR_INTERNAL. Could you setup breakpoints in settings_write() in nrf_dfu_settings.c and see why this is not caught?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static ret_code_t settings_write(void                   * p_dst,
                                 void const             * p_src,
                                 nrf_dfu_flash_callback_t callback,
                                 nrf_dfu_settings_t     * p_dfu_settings_buffer)
{
    ret_code_t err_code;

    if (memcmp(p_dst, p_src, sizeof(nrf_dfu_settings_t)) == 0)
    {
        NRF_LOG_DEBUG(&amp;quot;Destination settings are identical to source, write not needed. Skipping.&amp;quot;);
        if (callback != NULL)
        {
            callback(NULL);
        }
        return NRF_SUCCESS;
    }

    if (NRF_DFU_SETTINGS_IN_APP &amp;amp;&amp;amp; !settings_forbidden_parts_equal_to_backup((uint8_t *)&amp;amp;s_dfu_settings))
    {
        NRF_LOG_WARNING(&amp;quot;Settings write aborted since it tries writing to forbidden settings.&amp;quot;);
        // Assuming NRF_DFU_SETTINGS_ALLOW_UPDATE_FROM_APP is configured the same as in bootloader.
        return NRF_ERROR_FORBIDDEN;
    }

    NRF_LOG_DEBUG(&amp;quot;Writing settings...&amp;quot;);
    NRF_LOG_DEBUG(&amp;quot;Erasing old settings at: 0x%08x&amp;quot;, p_dst);

    // Not setting the callback function because ERASE is required before STORE
    // Only report completion on successful STORE.
    err_code = nrf_dfu_flash_erase((uint32_t)p_dst, 1, NULL);

    if (err_code != NRF_SUCCESS)
    {
        NRF_LOG_ERROR(&amp;quot;Could not erase the settings page!&amp;quot;);
        return NRF_ERROR_INTERNAL;
    }

    ASSERT(p_dfu_settings_buffer != NULL);
    memcpy(p_dfu_settings_buffer, p_src, sizeof(nrf_dfu_settings_t));

    err_code = nrf_dfu_flash_store((uint32_t)p_dst,
                                   p_dfu_settings_buffer,
                                   sizeof(nrf_dfu_settings_t),
                                   callback);

    if (err_code != NRF_SUCCESS)
    {
        NRF_LOG_ERROR(&amp;quot;Could not write the DFU settings page!&amp;quot;);
        return NRF_ERROR_INTERNAL;
    }

    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>