<?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>Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29858/transfer-speed-secure-dfu-sdk14</link><description>Hi, 
 I wonder what transfer speed can be expected on a BLE DFU update on a nRF52832 based device in the following condition? 
 -SDK14.0 Secure DFU, nRF52832, Android tablet (Oreo, Bluetooth 5.0), nRF Connect 
 We are currently facing a transfer speed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Feb 2018 15:06:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29858/transfer-speed-secure-dfu-sdk14" /><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/119977?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2018 15:06:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85f761a3-2f97-476e-8086-1a3a9b8d3195</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have now managed to improve speed of the secure DFU bootloader in SDK14. &lt;br /&gt;Speed has improved from about 1 kbyte/sec to 3.5 kbyte sec on a Samsung tablet with bluetooth 4.2, and about 5.5 kbyte/sec on a Samsung Galaxy S8 phone with bluetooth 5.&lt;br /&gt;The only change to bootloader is reducing connection interval. This is now reduced from 48.75ms to between 10 and 12ms.&lt;br /&gt;There were no functionality in the SDK14 secure DFU bootloader for doing this (no negotiation were done regarding connection interval), so tablet could set whatever connection interval it wanted.&lt;br /&gt;In SDK11, (which has much faster flashing) the negotiation was implemented using the ble_conn_params module.&lt;br /&gt;Enabling the NRF_BLE_CONN_PARAMS in SDK14, setting min/max connection interval to 10/12, and call the ble_conn_params_init() did the trick.&lt;/p&gt;
&lt;p&gt;Regards, Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118692?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2018 13:15:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c471658b-dffb-49ec-9ffa-c13087f9ce3b</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Those traces seem to confirm my suspicions. When you use the PCA10040, the two devices agree on a connection interval of 7.5ms from the get go and leave it at that. The Tablet starts off with 7.5ms, but after 40.86 seconds it sends a Connection Update Indication packet and adjusts the connection interval to 48ms.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118691?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 10:45:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71dfa26e-1630-4531-861f-2664608788f5</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Hi, and thanks for the info. I will check it up.&lt;/p&gt;
&lt;p&gt;Here are the traces (Ellisys Bluetooth Analyzer)
&lt;a href="https://www.dropbox.com/s/0764vqltmk0gz90/PCA10040DFUuptate.btt?dl=0"&gt;link text&lt;/a&gt;
&lt;a href="https://www.dropbox.com/s/yj5z6xygqbdbaeq/TabletDFUuptate.btt?dl=0"&gt;link text&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118689?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 08:48:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:484c4b50-76ab-48e5-b063-878554d2a136</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Here is a slightly more advanced blog with more thurough calculations by the way: &lt;a href="https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt;Bluetooth 5 speed: How to achieve maximum throughput for your BLE application&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118688?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 08:46:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7445104f-7b0d-4d43-8c3d-18334b7ec775</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Could you upload the traces?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118690?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 08:46:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7deb4a9-9cd6-4eb8-9d8d-8cc4f7429fb0</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think this blog post might help clarify what is going on: &lt;a href="https://punchthrough.com/blog/posts/maximizing-ble-throughput-on-ios-and-android"&gt;Maximizing BLE Throughput on iOS and Android&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Your tablet probably has an outdated BLE stack and/or chipset which simply can&amp;#39;t handle more than 4 packet per connection interval. With the PCA10040 and the Softdevice there isn&amp;#39;t really a limit for how many packets you can send per CI, as long as you stay within the borders of each connection event.&lt;/p&gt;
&lt;p&gt;What is happening with your tablet is probably an attempt of power optimization. It starts off with a high interval to get the connection process and database discovery done as fast as possible, but afterwards it throttles the parameters back a little to a more power friendly setting. This is a pretty common procedure in a lot of devices (at least for Samsung devices I believe).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118687?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 14:43:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be8b4b44-fb33-4235-9ed4-95242e8ca4c5</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Now I have looked at the communication between the devices with a BLE sniffer.&lt;/p&gt;
&lt;p&gt;I have traced a DFU update with tablet running nRF Connect, and a DFU update with PCA10040 with nRF Connect - Bluetooth Low Energy.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tablet running nRF Connect: 1Kbytes/sec transfer speed, connection interval 48.75ms, 27 bytes/packet.&lt;/li&gt;
&lt;li&gt;PCA10040 with nRF Connect - Bluetooth Low Energy: 4Kbytes/sec transfer speed, connection interval 7.5ms, 27 bytes/packet.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It seems like the connection interval is the big difference, 48.75ms versus 7.5ms.
In addition, when the tablet does the update, it sends 4 packets/connection interval constant. The PCA10040 seems to send various number of packets, I have seen up to 7 packets/connection interval.&lt;/p&gt;
&lt;p&gt;The tablet (or the PCA10040) does not seem to take the 250 bytes MTU configuration into consideration anywhere.&lt;/p&gt;
&lt;p&gt;When I look at the sniffer trace, it seems like the tablet initially decides a connection interval at 7.5ms (the tablet sends a LL_CONNECTION_UPDATE_IND), but after a short while (about 500ms) change it&amp;#39;s mind, and decides 48.75ms (it sends a new LL_CONNECTION_UPDATE_IND). It then uses this interval through the entire update. This does not happen with the PCA10040.&lt;/p&gt;
&lt;p&gt;The max and min connection interval is set to 7.5ms in the bootloader, but I am not sure if these settings are used? The 48.75ms (or 7.5ms on PCA10040) is kept unchanged regardless of what the max and min connection interval is set to.&lt;/p&gt;
&lt;p&gt;Anyway it seems like the worst problem is the tablet, not the bootloader.&lt;/p&gt;
&lt;p&gt;Any idea how to come around this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118686?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 13:27:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3640353b-34f3-4976-adf7-2c38ef3abbd5</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Difficult to say what is going on then. Some sniffer traces could help clarify what kind of parameters are actually being used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118685?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 10:40:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5f17acd-654f-47ed-958d-00e6c4667bcd</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Got it to run. I had to change this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = sd_ble_gap_adv_start(&amp;amp;adv_params, BLE_CONN_CFG_TAG_DEFAULT);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = sd_ble_gap_adv_start(&amp;amp;adv_params, CONN_CFG_TAG);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unforunately, the transfer speed stays at the same, about 1Kbytes/sec&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118684?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 10:25:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b9be721-e7f7-4166-aab2-2cb553e71035</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;&lt;code&gt;#define CONN_CFG_TAG 1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I tried to set the tag to several values (1,2,3 and 4), but the bootloader will still not start. If I comment out the above code, the bootloader runs fine.&lt;/p&gt;
&lt;p&gt;There is two more sd_ble_cfg_set():&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Configure the maximum number of connections.
memset(&amp;amp;ble_cfg, 0, sizeof(ble_cfg));
ble_cfg.gap_cfg.role_count_cfg.periph_role_count  = 1;
ble_cfg.gap_cfg.role_count_cfg.central_role_count = 0;
ble_cfg.gap_cfg.role_count_cfg.central_sec_count  = 0;
err_code = sd_ble_cfg_set(BLE_GAP_CFG_ROLE_COUNT, &amp;amp;ble_cfg, ram_start);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_gatts_cfg_service_changed.gatts_cfg.service_changed.service_changed = 1;
err_code = sd_ble_cfg_set(BLE_GATTS_CFG_SERVICE_CHANGED, &amp;amp;ble_gatts_cfg_service_changed, ram_start);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These are in the original function, and not changed.
Shouldn&amp;#39;t these have a unique tag?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118683?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 09:02:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8be7e2f1-3fdf-469a-b3c8-e956636f4a06</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;What is the value of CONN_CFG_TAG? Note the description of ble_conn_cfg_t in ble.h:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[conn_cfg_tag field] ... Must be different for all connection configurations added &lt;strong&gt;and not @ref BLE_CONN_CFG_TAG_DEFAULT&lt;/strong&gt;. */&lt;/p&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118693?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2018 15:56:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af191eb4-7a3b-43b7-be4e-a440ba305dde</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Hi, and thanks,&lt;/p&gt;
&lt;p&gt;I tried to increase the data length like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//Set data length
memset(&amp;amp;ble_cfg, 0x00, sizeof(ble_cfg));
ble_cfg.conn_cfg.conn_cfg_tag                 = CONN_CFG_TAG;
ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = NRF_SDH_BLE_GATT_MAX_MTU_SIZE;
err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &amp;amp;ble_cfg, ram_start);
APP_ERROR_CHECK(err_code);

NRF_LOG_DEBUG(&amp;quot;Enabling SoftDevice.&amp;quot;);

// Enable BLE stack.
err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;This is done in ble_stack_init(), after Service Changed config, and before enabling the BLE stack&lt;/p&gt;
&lt;p&gt;However, it seems to assert when executing sd_ble_cfg_set().
IAR EWB will not debug the code, so I can&amp;#39;t see the error code.&lt;/p&gt;
&lt;p&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE was set to 250. Am I doing it the wrong way?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118682?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2018 14:33:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4359f31-1aa2-41c2-8db9-7c970a2103fd</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Here are some thoughts from one of the DFU gurus:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are no hidden tricks,
unfortunately. I think SDK version
12.3.0 went as fast as 3.5kb/s, but this was degraded to 1.5kb/s after
some changes in SDK 13 and improved
again in SDK 14 up to 4.5kb/s.&lt;/p&gt;
&lt;p&gt;There are many variables to take into
account and the unfortunate thing is
that the transfer might fail if only
one of the variables is updated and
the rest is not. This is because the
current DFU protocol does not
implement any kind of flow control.&lt;/p&gt;
&lt;p&gt;The variables that can be tweaked are
NRF_FSTORAGE_SD_MAX_WRITE_SIZE
(smaller), connection interval
(smaller is faster), and event length
might help too. I think the latter
depends on which SDK version you are
running, since increasing the event
length basically steals time from
flash access, which is the real
bottleneck when we approach higher
speeds. It might however help on
crippled implementations running as
low as 1.5kb/s.&lt;/p&gt;
&lt;p&gt;Connection interval is the obvious
thing to tweak here because I reckon
most Android phones will request a
higher interval and the bootloader
does not request it by itself. It just
accepts whatever the peer requests.
That would explain why some phones run
faster than others against the same fw
implementation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;@janR, can you try to increase the data length as suggested &lt;a href="https://devzone.nordicsemi.com/question/169403/dfu-transfer-speed-reduced-to-half-s132_v31035kbs-vs-s132_v40418kbs/"&gt;here&lt;/a&gt;, but set the data length in ble_stack_init() in addition to setting the value in sdk_config.h? I was made aware that increasing the value in sdk_config.h alone doesn&amp;#39;t configure the Softdevice with long lengths from the get-go.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118680?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2018 11:27:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65ba9ff8-da96-4d44-af6c-7725ad1c24f5</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;Hm, I have only tested with iOS and nrf5832, and there I see 1kbps. If you look at a sniffer trace, and keep the DFU protocol in the back of your head, you can see whether its the transport or DFU target being the bottleneck. The DFU target will ask for more bytes when it is ready to receive it (in some way described in the DFU documentation).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118681?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2018 11:11:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbfb3c3a-7484-438d-b8f5-aebfb658100f</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Hi,
If I use nRF Connect (v2.2.1) - Bluetooth Low Energy for Windows, and evaluation kit PCA10040, I see a speed of about 4Kbytes/sec), 4 times the speed of the Android tablet. Why is there a difference?&lt;/p&gt;
&lt;p&gt;Regards, Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfer speed secure DFU SDK14</title><link>https://devzone.nordicsemi.com/thread/118679?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2018 10:58:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53b78b0c-5f6c-4441-b842-1e7ff55e5d73</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;What you see is as expected. As far as I know, the bottleneck is the process of storing the received data to flash on the DFU target side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>