<?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>Uart DFU failed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81960/uart-dfu-failed</link><description>Hi 
 I have a project as the follow 
 
 What I have done: 
 1. Compiled app.hex ( Configured with my board), works fine. 
 2. Compiled bootloader.hex ( Configured with my board) 
 3. Generate app_setting with nrfUtil 
 4. Merge app, app_setting, bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Dec 2021 05:00:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81960/uart-dfu-failed" /><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/344044?ContentTypeID=1</link><pubDate>Fri, 17 Dec 2021 05:00:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f014511a-f4b6-406e-ad9e-0cd66f66606c</guid><dc:creator>ClarkChu</dc:creator><description>&lt;p&gt;Thanks! I will check that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/342928?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 13:21:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afe3c5f1-f766-462d-93c0-9a7c7b007468</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="ClarkChu"]As far as I know, My app size should have 60K - 8K(reserved app data size) = 52K space available. Am I right?[/quote]
&lt;p&gt;We need to look at your memory layout to know this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;What is the start address of the application (that will be the same as the size of the SoftDevice)?&lt;/li&gt;
&lt;li&gt;And what is the start address of the bootloader?&lt;/li&gt;
&lt;li&gt;How many reserved bytes do you have in the bootloader, configured with&amp;nbsp;NRF_DFU_APP_DATA_AREA_SIZE in the bootloader&amp;#39;s sdk_config.h? This typically should match whatever is configured for persistent data in the application.&lt;/li&gt;
&lt;/ol&gt;
[quote user="ClarkChu"]How can I know exactly how many bytes space for my application? Or there is other reason that I don&amp;#39;t know?[/quote]
&lt;p&gt;By finding the numbers I listed above we can know exactly how much space there is for the application, and can visualize the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader.html?cp=8_1_3_5_0_7#lib_bootloader_memory"&gt;memory layout as is done in the bootloader documentation&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/342893?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 10:58:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:571ce66f-28ad-4ada-a7c8-058692cd064a</guid><dc:creator>ClarkChu</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;I am afraid I have to re-open this ticket.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I reduce the dfu.bin file size to 43K, it can upgrade successfully. But when I did some development for couple weeks, the dfu.bin file size become as 45K. Then the upgrade failed.&lt;/p&gt;
&lt;p&gt;I am confused.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If the dfu.bin file size is 54K or larger, bootloader will return 0x0B0D error code. which means&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;NRF_DFU_EXT_ERROR_INSUFFICIENT_SPACE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 0x0D, /**&amp;lt; The available space on the device is insufficient to hold the firmware. */&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can know clearly that the file size if too big.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But if the dfu.bin file size is 45K, it doesn&amp;#39;t return any error code, just start to DFU, and when the firmware packets are sent&amp;nbsp;&lt;/p&gt;
&lt;p&gt;about 35K, it time out. i.e. DFU host can not receive response from nrf52810 any more.&lt;/p&gt;
&lt;p&gt;When I reduce the dfu.bin file to 43K. It can upgrade successfully.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As far as I know, My app size should have 60K - 8K(reserved app data size) = 52K space available. Am I right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How can I know exactly how many bytes space for my application? Or there is other reason that I don&amp;#39;t know?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you very much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/340461?ContentTypeID=1</link><pubDate>Wed, 24 Nov 2021 07:35:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:718e7a5f-7c79-4834-b9bd-d2756e68c4b4</guid><dc:creator>ClarkChu</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Thank you very much for your support. I have resolved this issue.&lt;/p&gt;
&lt;p&gt;The root cause is my app size is two big.&lt;/p&gt;
&lt;p&gt;But why 52810 don&amp;#39;t response the error code 0x04 which means that memory is not enough.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/340440?ContentTypeID=1</link><pubDate>Wed, 24 Nov 2021 02:11:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ee36924-a143-4513-98d7-38193ca8621c</guid><dc:creator>ClarkChu</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I looked into the bootloader source code, find that when create new data object, the flash should be erased. But actually, the flash keep unchanged even target response with 01 01 (create object success) and 04 01(execute success).&lt;/p&gt;
&lt;p&gt;How do I know that the flash page is not erased?&lt;/p&gt;
&lt;p&gt;I restart the system by power off power on, I can still find the BLE and connect it and do some operations. If the application page is erased, how the application can work normal?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Further more, I switch on the single bank dfu feature in sdk_config, it return 04 04 error code, mean that there is no enough memory. I don&amp;#39;t understand, if single bank dfu feature is enabled , it should replace the current application, why it says not enough memory?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1280x960/__key/communityserver-discussions-components-files/4/3060.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/340307?ContentTypeID=1</link><pubDate>Tue, 23 Nov 2021 11:08:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:152d5d5f-9ce7-4f60-a058-eca2d822e6b2</guid><dc:creator>ClarkChu</dc:creator><description>&lt;p&gt;It&amp;#39;s a good idea to enable logging in bootloader. But I encounter a problem. When I enable log by &amp;quot;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;NRF_LOG_ENABLED 1&lt;/span&gt;&amp;quot; in &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;sdk_config.h&lt;/span&gt; I got error &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;quot;section .mbr_params_page VMA [000000000002e000,000000000002efff] overlaps section .text VMA [00000000000283d4,000000000002e03f]&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Seems that the image size is too big when enable log. How can I only enable minimum necessary so that image size is not so big?&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;While in my previous post, I think I make an unclear statement.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;dfu.bin file size is 54K. Selecting Object&amp;nbsp;size is 4096. So the file is divided into (54K/4096) objects.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;the first 4096bytes was sent successfully. Then request to create 2nd object, there is no response.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;span&gt;And finally I can send data to 52810 with 10 ms delay for every packet.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;means that the 4096 bytes is divided into (mtu-1)/2-1 packets. (here mtu is 131). So there are 64 packets. These 64 packets were sent successfully. Not mean the whole file sent successfully.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;When the first 4096 bytes is sent dfu master receive &amp;quot;60 03 01 xx xx ....&amp;quot; means CRC is OK. Then dfu master send object select and again target response &amp;quot;60 04 01&amp;quot;, it&amp;#39;s OK. Then dfu master send object create, there is no response any more.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;I add the dfu master code for your reference. Thank you very much!&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/91_5F00_cross_5F00_dfu.zip"&gt;devzone.nordicsemi.com/.../91_5F00_cross_5F00_dfu.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;182.92.8.154/yy_app_0012_dfu.bin is valid. you can use it directly for test.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/340281?ContentTypeID=1</link><pubDate>Tue, 23 Nov 2021 09:38:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:509f2cf3-45dc-4354-9c58-abd7e7025344</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="ClarkChu"]And finally I can send data to 52810 with 10 ms delay for every packet. I think HWFC should do this job. But seems that HWFC didn&amp;#39;t work. But anyway, with 10 ms delay, data can be sent.[/quote]
&lt;p&gt;So the DFU process is successful if you use a 10 ms delay for every packet? If so, this looks like a known issue if data is provided too fast. Adjusting the packet receipt notification (PRN) is one way of handling that, where the DFU target can limit the pace of the incoming data (this is at a higher level in the protocol than simply using UART flow control). I suggest try setting PRN to 1.&lt;/p&gt;
&lt;p&gt;If setting PRN to 1 does not work, perhaps it is worth testing a debug bootloader with RTT logging and see if that provides some useful information.&lt;/p&gt;
&lt;p&gt;I have not seen this DFU master implementation myself, perhaps you can share it or send me a PM with who in Nordic you got it from?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/340249?ContentTypeID=1</link><pubDate>Tue, 23 Nov 2021 08:00:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2ac545a-8b54-4c40-9125-47f5ba94e834</guid><dc:creator>ClarkChu</dc:creator><description>&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;I am using nRF5SDK160098a08e2\examples\dfu\secure_bootloader\pca10040e_uart as the code base, and modified the UART pin config&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;//UART&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define RX_PIN_NUMBER &amp;nbsp; &amp;nbsp; &amp;nbsp; 16&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define TX_PIN_NUMBER &amp;nbsp; &amp;nbsp; &amp;nbsp; 18&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define CTS_PIN_NUMBER &amp;nbsp; &amp;nbsp; &amp;nbsp;17&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define RTS_PIN_NUMBER &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define HWFC &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;true&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;And finally I can send data to 52810 with 10 ms delay for every packet. I think HWFC should do this job. But seems that HWFC didn&amp;#39;t work. But anyway, with 10 ms delay, data can be sent.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/1280x960/__key/communityserver-discussions-components-files/4/pastedimage1637653988661v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I searched devzone several days ago, it says that bootloader write flash has error. But I try to search again, and can not find it any more. ( I think I forget the search key word)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I will look into the bootloader&amp;#39;s flash part.&amp;nbsp;If you can provide some guide or information where should I begin, it will help me a lot.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The DFU master implementation (9160 side) is provide by Nordic China support team, and it just download the file and send the bin to 52810 according to DFU payload.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart DFU failed</title><link>https://devzone.nordicsemi.com/thread/340072?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 13:06:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca0f9206-29ff-480d-942c-5f487456a5d3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Nordic does not provide any DFU master implementation for running on a nRF device, so I am not sure what you are using here.&lt;/p&gt;
&lt;p&gt;Can you elaborate on which bootloader you use on the nRF52 device (based on what you write I assume it is a nRF5 SDK based)? And then, can you share details about your DFU master implementation and how you test it?&amp;nbsp; Please elaborate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>