<?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>NRF52840 BLE throughput improvement</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75804/nrf52840-ble-throughput-improvement</link><description>Hi everyone, I’m using an NRF52840 device with an external 32MB flash memory. I need to send memory content to a mobile app through BLE when the user asks for. For now I send 240 bytes indications one after another, the next packet is sent when I receive</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Jun 2021 13:31:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75804/nrf52840-ble-throughput-improvement" /><item><title>RE: NRF52840 BLE throughput improvement</title><link>https://devzone.nordicsemi.com/thread/312901?ContentTypeID=1</link><pubDate>Tue, 01 Jun 2021 13:31:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2de95375-4055-47c1-af3a-c876443e136f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you testing with nRF connect on Windows? If so, please try with nRF connect on iOS or Android instead. The Windows version will have pretty limited transfer rate on most systems due to some non-optimized USB configuration parameters (ref. &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/pull/264"&gt;https://github.com/NordicSemiconductor/pc-ble-driver/pull/264&lt;/a&gt;).&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><item><title>RE: NRF52840 BLE throughput improvement</title><link>https://devzone.nordicsemi.com/thread/312775?ContentTypeID=1</link><pubDate>Tue, 01 Jun 2021 08:14:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8b7f876-3b89-4809-93c4-c0cbe5098cdf</guid><dc:creator>julienh</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;br /&gt;&lt;br /&gt;Thank you for your message. Following you recommandation, we have implemented the notification and the queue system. By doing this change, we have increased the&amp;nbsp;&lt;span&gt;throughput by 6 which is big improvement. It&amp;#39;s good but still not the maximum&amp;nbsp;throughput regarding SoftDevice S140 specification. To retrieve the whole flash (32Mo) we need 17 minutes which is really too long.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What are the other parameters&amp;nbsp;that we can adjust ( connection interval / maximum number of packets&amp;nbsp;per connection interval ...)?&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thank you&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 BLE throughput improvement</title><link>https://devzone.nordicsemi.com/thread/312661?ContentTypeID=1</link><pubDate>Mon, 31 May 2021 13:41:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22e14f33-5645-46b4-80ff-ab2ac72000ed</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Notifications are multiple times faster than indications when you try to send data like this and generally equally reliable (acking and re-transmits&amp;nbsp; are handled at the lower protocol layers). And as required by spec., the connection will be terminated if a notification packet was not received after x number of failed re-transmit attempts (exact number depends on negotiated connection paramaters)&lt;/p&gt;
[quote user=""]&lt;span&gt;&lt;/span&gt;For now I send 240 bytes indications one after another, the next packet is sent when I receive the indication confirmation of the previous.[/quote]
&lt;p&gt;&lt;span&gt;&lt;a title="sd_ble_gatts_hvx" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html?cp=4_7_4_1_2_4_2_4#ga313fe43c2e93267da668572e885945db"&gt;sd_ble_gatts_hvx&lt;/a&gt;&lt;/span&gt;() only returns NRF_SUCCESS if a notification is successfully added to the Softdevice TX output queue and you are allowed to queue up multiple notifications packet, which is something you should do if you want to optimize for max. throughput. The Softdevice will signal the application with the BLE_GATTS_EVT_HVN_TX_COMPLETE event (&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_t_t_s___h_v_n___m_s_c.html"&gt;GATTS Handle Value Notification&lt;/a&gt;) after the queued notification(s) have been received by the client.&lt;/p&gt;
[quote user=""]I know notifications data rate is obviously better than indications, but how can I use it to transfer a lot of data ? I mean, how can the packets be triggered one after the other in an efficient way ? I[/quote]
&lt;p&gt;&amp;nbsp;You can queue up packets until &lt;span&gt;&lt;a title="sd_ble_gatts_hvx" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html?cp=4_7_4_1_2_4_2_4#ga313fe43c2e93267da668572e885945db"&gt;sd_ble_gatts_hvx&lt;/a&gt;&lt;/span&gt;() starts returning &lt;a title="Not enough resources for operation." href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group__nrf__error.html#gac94383171545e604e8347a044e8be13f"&gt;NRF_ERROR_RESOURCES&lt;/a&gt; indicating that the output buffer is full, and then you can &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_t_t_s___e_n_u_m_e_r_a_t_i_o_n_s.html#ggae537647902af1b05c1e32f12d6b401c7afab96bfa9918017082235f7664919f9d"&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE&lt;/a&gt; before attempting to queue up more packets.&lt;/p&gt;
&lt;p&gt;I made a throughput test example based on the ble_app_uart example earlier. I&amp;#39;m including it here in case you want test how fast your phone can receive notifications:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3823.nrf5_5F00_sdk_5F00_17.0.2-_2D00_-ble_5F00_app_5F00_uart_5F00_throughput.zip"&gt;devzone.nordicsemi.com/.../3823.nrf5_5F00_sdk_5F00_17.0.2-_2D00_-ble_5F00_app_5F00_uart_5F00_throughput.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>