<?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>BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66388/ble-data-transfer-speed-issues-with-nrf52840</link><description>Hi, I want to measure the data transfer speed of BLE. I use the nRF52840 DK with the ble_app_uart example 
 I created a dummy string of 20 bytes (default length of one packet) and I send the string again and again in an endless loop. 
 Every time the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Oct 2020 07:25:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66388/ble-data-transfer-speed-issues-with-nrf52840" /><item><title>RE: BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/thread/273639?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 07:25:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdc85d33-f9e1-413a-8a29-e1af7582639e</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes it makes sense. I will give it a try.&lt;/p&gt;
&lt;p&gt;Thank you for your time!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/thread/272356?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 14:35:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e5707cf-b3e9-4b5b-9af4-56dffd9a7c2e</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;The gap event length is used by the scheduler. So I think this is limiting the length of the event in this case. This is also used to calculate the number of buffers the sd will allocate up to a maximum of 7. As en alternative you can use &lt;span&gt;&lt;a title="sd_ble_opt_set" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html?cp=4_7_4_1_2_0_2_2_4#ga511d431bc3d9ccf9bef09ad20cbf855a"&gt;sd_ble_opt_set&lt;/a&gt;&lt;/span&gt; and enable &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/structble__common__opt__conn__evt__ext__t.html"&gt;ble_common_opt_conn_evt_ext_t&lt;/a&gt;. This will allow the&amp;nbsp; connection event to extend past the allocated time. But I still think you need to increase the length a little to allocate the maximum number of tx buffers.&lt;/p&gt;
&lt;p&gt;I the central device can handle a maximum of 6 packets per event the only way to increase the throughput is by using shorter intervals. In addition to the long MTU&amp;#39;s and 2mbits. But I don&amp;#39;t think that is limited by Android. But might be an issue with certain (older?) chipsets.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/thread/272345?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 13:45:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0804c42-63e8-4b2c-aed3-bb5dda9ce4b2</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;If I get it right the problem here is that&amp;nbsp; there are no available TX buffers.&lt;/p&gt;
&lt;p&gt;So how is this related to the gap event length?&lt;/p&gt;
&lt;p&gt;No I have not changed ot, because it is already set to 6 which is the max number I can setsince I use an android central device(smartphone). Right?&lt;/p&gt;
&lt;p&gt;But since you mention it again I will try it.&lt;/p&gt;
&lt;p&gt;The NRF_SDH_BLE_GATT_MAX_MTU_SIZE is set already to 247&lt;/p&gt;
&lt;p&gt;Is there any way that I can make the do{}(while) much faster? I mean the Tx Buffer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/thread/272337?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 13:30:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:781a9afb-7650-45f9-856e-51fd4a8cdcb8</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Did you try to increase the gap event length?&lt;/p&gt;
&lt;p&gt;You could possibly test at the &lt;span&gt;&lt;a title="Experimental: ATT_MTU Throughput Example" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_att_mtu.html?cp=7_1_4_2_1_0"&gt;Experimental: ATT_MTU Throughput Example&lt;/a&gt;&lt;/span&gt; to see how changing various parameters affect the throughput you get.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/thread/272019?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 10:42:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6a7fa2f-a19d-440f-bb27-e29a3b9df43d</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Ok so what can I do to fix it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/thread/272015?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 10:14:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45317add-89c6-4ab3-9f75-c6878ea17561</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;NRF_ERROR_RESOURCES means there are no available TX buffers. As long as you get that error message, data is not placed in the buffers and transmitted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/thread/271786?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 12:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a57a2a6-8ac6-40aa-8166-b18ffa224f01</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;In image 1 as you can see, the time that data are being transferred, occupy a very small portion of the entire connection interval(each small pulse represents a transfer). The rest of the connection interval is not used for data transfer as I would expect until the buffer is free again and a new connection interval begins. This takes 90% of the connection interval so the way I see it, it is impossible to achieve higher transfer speed without removing the ( do{}while (err_code == NRF_ERROR_RESOURCES)&amp;nbsp; check.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE data transfer speed issues with nRF52840</title><link>https://devzone.nordicsemi.com/thread/271780?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 12:35:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5d42d77-8ddb-4541-b4f4-63ea1d1788b1</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;1. There is a limitation to connection event length, set in the sdk_config.h Try increasing NRF_SDH_BLE_GAP_EVENT_LENGTH&lt;/p&gt;
&lt;p&gt;2. The NRF_ERROR_RESOURCES error means there are no available tx buffers. If you don&amp;#39;t wait for the buffer to be freed before you move on to the next data bulk you will not transfer all the data.&lt;/p&gt;
&lt;p&gt;3. You need to optimize the connection settings. More on that in other devzone cases e.g.&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/62363/nrf52832-throughput-test-with-nordic-uart-service"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/62363/nrf52832-throughput-test-with-nordic-uart-service&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;4. This seems to be enabled by default in sdk 17.0.2. but look at sdk_config.h NRF_SDH_BLE_GATT_MAX_MTU_SIZE and also the defines in ble_nus.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BLE_NUS_MAX_RX_CHAR_LEN        BLE_NUS_MAX_DATA_LEN /**&amp;lt; Maximum length of the RX Characteristic (in bytes). */
#define BLE_NUS_MAX_TX_CHAR_LEN        BLE_NUS_MAX_DATA_LEN /**&amp;lt; Maximum length of the TX Characteristic (in bytes). *&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;5. 250 kBytes is not possible. Due to protocol timing restrictions and packet overhead the max is about 1.3 mbps. See SD guide on throughput: &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/ble_data_throughput/ble_data_throughput.html?cp=4_7_4_0_16"&gt;infocenter.nordicsemi.com/.../ble_data_throughput.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>