<?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>Serial DFU causing nrf_dfu_flash: Flash write failed (0x3)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64228/serial-dfu-causing-nrf_dfu_flash-flash-write-failed-0x3</link><description>Hi Nordic Team, 
 I am using SDK 16.0.0 with Softdevice S132 version 7.0.1 on the NRF52832 and using SES v4.52c on Linux. I have managed to run and sucessfully execute the DFU BLE example. But I need to be able to run the DFU over serial so have adapted</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Jul 2020 16:27:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64228/serial-dfu-causing-nrf_dfu_flash-flash-write-failed-0x3" /><item><title>RE: Serial DFU causing nrf_dfu_flash: Flash write failed (0x3)</title><link>https://devzone.nordicsemi.com/thread/262052?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2020 16:27:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f797447-5626-4797-bc4d-6e7975a2cc5f</guid><dc:creator>Galaxy88</dc:creator><description>&lt;p&gt;Thank you &lt;a href="https://devzone.nordicsemi.com/members/turboj"&gt;Turbo J&lt;/a&gt;, your answer made me discover that both the source and destination address to nrf_df_flash have to be 4 byte aligned. Works like a charm now.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial DFU causing nrf_dfu_flash: Flash write failed (0x3)</title><link>https://devzone.nordicsemi.com/thread/261849?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 19:19:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afdced5d-5c00-4c43-b8ff-4920503a6db0</guid><dc:creator>Galaxy88</dc:creator><description>&lt;p&gt;Thank your response, I have changed the packet size to 130 so I can get a data size of 128 as suggested but I still have the same error as logged below. Am I still missing something?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;EDIT: B&lt;span&gt;oth the source and destination address to nrf_df_flash have to be 4 byte aligned, problem solved. Removing SLIP has the side effect of misalignment of the source address in RAM caused by the OPCODE&lt;/span&gt;&lt;/p&gt;
&lt;p&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: Destination settings are identical to source, write not needed. Skipping.
&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0x7E000.
&amp;lt;debug&amp;gt; nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Writing valid init command to flash.
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;debug&amp;gt; nrf_dfu_serial: Sending Response: [0x4, 0x1]
&amp;lt;info&amp;gt; app:  Transfer completed. Received: 0 bytes
&amp;lt;info&amp;gt; app:  No command received start RX again
&amp;lt;info&amp;gt; app:  Transfer completed. Received: 6 bytes
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (data)
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x00026000, len=1 pages), queue usage: 0
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash erase success: addr=0x00026000, pending 0
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Creating object with size: 4096. Offset: 0x00000000, CRC: 0x00000000
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;debug&amp;gt; nrf_dfu_serial: Sending Response: [0x1, 0x1]
&amp;lt;info&amp;gt; app:  Transfer completed. Received: 0 bytes
&amp;lt;info&amp;gt; app:  No command received start RX again
&amp;lt;info&amp;gt; app:  Transfer completed. Received: 129 bytes
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x00026000, src=0x20007273, len=128 bytes), queue usage: 1
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write failed (0x3): addr=0x00026000, len=0x80 bytes, pending 0
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;info&amp;gt; app:  Transfer completed. Received: 129 bytes
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x00026080, src=0x20007273, len=128 bytes), queue usage: 1
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write failed (0x3): addr=0x00026080, len=0x80 bytes, pending 0
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;info&amp;gt; app:  Transfer completed. Received: 129 bytes
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x00026100, src=0x20007273, len=128 bytes), queue usage: 1
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write failed (0x3): addr=0x00026100, len=0x80 bytes, pending 0&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial DFU causing nrf_dfu_flash: Flash write failed (0x3)</title><link>https://devzone.nordicsemi.com/thread/261848?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 17:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a134fca4-d13f-42cb-b3e4-438738fd4ad6</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;You are trying to write to an odd flash address - this won&amp;#39;t work. Flash writes must be 4-byte aligned.&lt;/p&gt;
&lt;p&gt;In your case, write 128 bytes per DFU packet and not 127. Any yes, that means your raw packet will be a bit larger than 128 bytes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>