<?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>Receiving MTU errors when trying to conduct OTA DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79012/receiving-mtu-errors-when-trying-to-conduct-ota-dfu</link><description>I&amp;#39;m currently working on a program that automates the Legacy DFU procedure and I&amp;#39;m running into some strange issues with writing to the DFU characteristics. 
 On the nRF Connect Mobile app, it is possible to write to the DFU characteristic &amp;quot;DFU Packet</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Aug 2021 18:44:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79012/receiving-mtu-errors-when-trying-to-conduct-ota-dfu" /><item><title>RE: Receiving MTU errors when trying to conduct OTA DFU</title><link>https://devzone.nordicsemi.com/thread/327045?ContentTypeID=1</link><pubDate>Fri, 27 Aug 2021 18:44:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05f45834-c811-4d54-99fa-3478fc4e0157</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="tjhasan"]But how do I tell the GATT server that the first 20 bytes is NOT the end of the data I want to write?[/quote]
&lt;p&gt;You don&amp;#39;t have to, the packets will be re-assembled by DFU target as they are received. And the bootloader knows how many bytes/packets to expect because of the DFU protocol (DFU Protocol: &lt;span&gt;&lt;a title="BLE DFU Profile" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/bledfu_transport_bleprofile.html?cp=8_5_12_4_3_1_4_0"&gt;BL&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;a title="BLE DFU Profile" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/bledfu_transport_bleprofile.html?cp=8_5_12_4_3_1_4_0"&gt;E DFU Profile&lt;/a&gt;&lt;/span&gt;). &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving MTU errors when trying to conduct OTA DFU</title><link>https://devzone.nordicsemi.com/thread/327042?ContentTypeID=1</link><pubDate>Fri, 27 Aug 2021 17:43:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:591102b9-bd72-4042-9711-54cd997c879b</guid><dc:creator>tjhasan</dc:creator><description>&lt;p&gt;I see. I don&amp;#39;t really have access to the source code for the nRF Connect Mobile app so I can&amp;#39;t comment on why I didn&amp;#39;t receive the error on my phone. I did indeed use the same packet length.&lt;/p&gt;
&lt;p&gt;I guess my follow-up question would be how would I send write commands 20 bytes at a time? For example, if I had a 40 byte packet I wanted to send, I would have to send it as 2 separate 20 byte write commands. But how do I tell the GATT server that the first 20 bytes is NOT the end of the data I want to write? How does the GATT server know how much data to expect from a given write command?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving MTU errors when trying to conduct OTA DFU</title><link>https://devzone.nordicsemi.com/thread/327004?ContentTypeID=1</link><pubDate>Fri, 27 Aug 2021 13:11:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2411fdeb-8014-45a5-a52d-581a9ba937a3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Legacy DFU did not have support for long ATT MTUs, so the payload was effectively limited to 20 bytes per write (23 byte MTU - 3 Byte header). In other words, the PC client app will have to split the data into 20 bytes packets before sending.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure why you didn&amp;#39;t see error when you sent the DFU packet from your phone though. Did you use the same packet length? If so, I guess the phone must have split the packet across multiple on-air BLE packets (i.e. performed what&amp;#39;s known as a long write - &lt;span&gt;&lt;a title="GATTC Characteristic or Descriptor Value Long Write" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.3.0/group___b_l_e___g_a_t_t_c___v_a_l_u_e___l_o_n_g___w_r_i_t_e___m_s_c.html?cp=4_7_3_1_2_2_3_3"&gt;GATTC Characteristic or Descriptor Value Long Write&lt;/a&gt;&lt;/span&gt;). But that is an inefficient way to transfer data and is something you should avoid if you care about throughput performance. It&amp;#39;s faster to send GATT write commands 20 bytes at a time.&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>