<?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 Transfer speed issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71974/nrf52840-ble-transfer-speed-issues</link><description>Hi all, 
 I have a custom nRF52840 board that transmits 32-byte packets to mobile device and I want to achieve maximum transfer speed. 
 The code is based on the ble_app_uart project 
 The BLE settings in my project are as follow: 
 
 The transmission</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Mar 2021 15:17:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71974/nrf52840-ble-transfer-speed-issues" /><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297576?ContentTypeID=1</link><pubDate>Wed, 03 Mar 2021 15:17:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:264db53f-0d47-451c-898c-79a59066c16d</guid><dc:creator>Sigurd</dc:creator><description>[quote user="masterLee"]Good News at&amp;nbsp; last[/quote]
&lt;p&gt;&amp;nbsp;Great! Happy to help &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297414?ContentTypeID=1</link><pubDate>Wed, 03 Mar 2021 09:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e97008e-5620-4c6f-a7f9-262cac578e9d</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Good News at&amp;nbsp; last!! ! I reached 100kBps +/- 20kBps for a single connection between one peripheral device and the tablet. &lt;/p&gt;
&lt;p&gt;To sum up, In order to reach maximum throughput with BLE 5 PHY_2Mbps I performed the following changes (Slave Device = Custom nRF52840 Board &amp;amp; Master Device = Samsung Tab S6 with BLE 5)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the ble_nus_data_send function() I use most of the length of the ATT package (244)&lt;/li&gt;
&lt;li&gt;Set the GAP_EVENT_LENGTH = 10&lt;/li&gt;
&lt;li&gt;Set both connection interval MIN and MAX = 10&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sigurt, thank you for your valuable time and help on this issue!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297308?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 18:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:700fdf13-f339-44c3-b2ae-292ad2be0372</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Yes I set both at 2Mpbs in the EVT_CONNECTED event. &lt;/p&gt;
&lt;p&gt;Ok, I will check it out tomorrow morning first thing. &lt;/p&gt;
&lt;p&gt;Any suggestions, on how to add more 244-byte packets in one connection interval? Because as you can see in the sniffer log, for the duration of the connection interval only one 244-byte package is being sent to the peer and the rest of the interval is idle...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297304?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 18:10:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09734599-628e-4b91-a9a7-e57d487f9c1e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Regarding 2MPHY, did you e.g. add something like this to the BLE_GAP_EVT_CONNECTED event ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_2MBPS,
                .tx_phys = BLE_GAP_PHY_2MBPS,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If yes, then you should be able to see a&amp;nbsp;LL_PHY_REQ packet from the slave, and a&amp;nbsp;LL_PHY_UPDATE_IND packet sent from the master in the sniffer log, indicating if it accepts the 2MPHY request or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297289?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 16:51:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52bc9d4b-4dd8-4123-8a4f-ba14436b4766</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;No the peripheral is connected to a single central device (tablet). The tablet app is configured such a way that it can connect up to 5 peripherals. The good thing is that the speed is increasedto 50kBps by changing&amp;nbsp; the GAP_EVENT_LENGTH from 5 to 10. Further increments did not increase the speed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, I noticed that although I set the PHY to 2M (inside&amp;nbsp;ble_evt_handler) the tablet keeps it at 1M all the time.&lt;/p&gt;
&lt;p&gt;Any suggestions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297278?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 16:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5de34314-38c1-4921-8c2f-ac67fe8370f0</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The slave sets the MD(MoreData) bit to 1 when it sends the first packet, so it has more data to send. The master continues the connection event by sending a new empty packet, but the slave is not sending the packet in reply to that, and the connection event ends. In a 1-to-1 connection setup, I would have expected the slave to send another packet.&lt;/p&gt;
&lt;p&gt;Is the peripheral connected to several master devices when you tested this ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297183?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 12:58:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c9ec48d-0bd1-40b2-86b6-c930c17dca76</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0488.log.pcapng"&gt;devzone.nordicsemi.com/.../0488.log.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297181?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 12:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0c687ac-ce9a-4e8b-84b8-3c548efd5201</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Could you save and upload the log here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297178?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 12:48:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81f072e5-9fee-430c-8bf1-66652ab864fe</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;This is the nRF sniffer output while peripheral device was streaming to the tablet device&lt;/p&gt;
&lt;p&gt;(The Connection Interval is set to 10msec and DLE is ON). The 244-bytes packet is transfered in 150usec and then the connection is idle for the remaining part of the interval...&lt;/p&gt;
&lt;p&gt;So the issue remains how do I include more BLE packets in one connection interval instead of one(current)?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1614689052165v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What am I doing wrong and the speed is&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297018?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 20:27:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9951cd18-cb94-4be9-b9ff-6b1e35c77880</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;I know what limits the throughput. Check my last message explaining the steps I take to check it. I will test the sniffer but I dont think it will show something different. And by the way , since the max size for one packet is 244 bytes why the ble_nus_data send () size argument is of type uint16_t and not uint8_t? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297015?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 20:22:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc2ec145-3d6d-48a2-93d0-d4c49eca6d34</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;The tablet has the latest android version and Android supports up to 6 packets per connection interval.&lt;/p&gt;
&lt;p&gt;Also, before and after calling the ble_nus_data_send() I turned on and off&amp;nbsp; an output pin and I measured the time with the oscilloscope for the function to complete and it matches exactly the connection interval I have set. This means that even if I call the ble_nus_data_send() 6 times for example, it will take 10msec for each one. This means that I send one 244-bytes packet every 10msec and not six 244-bytes packets in 10msec (one connection interval).That is why the data rate stays the same.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What I want is to transfer more than 244 bytes&lt;strong&gt; in one&lt;/strong&gt; ble_nus_data_send() and this cannot be done as long as the function cannot accept more than 244 bytes in one call. Is there some other function that can send more than 244 bytes in one call ? Or can I modify the existing function to do that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297014?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 20:04:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb350dd9-617e-4d19-9e0b-82307a34d3e1</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Correct, not directly at least, this config decides the&amp;nbsp;time set aside for the connection on every connection interval in 1.25 ms units. Most likely you would need to do a sniffer trace to see what&amp;#39;s happening on-air, and see what is limiting the&amp;nbsp;throughput.&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE"&gt;https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297012?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:58:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:463a2d1d-03a5-4649-91aa-3a013d11f1b4</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Yes I am using SES but now I am not at the office. I will do it first thing tomorrow. &lt;/p&gt;
&lt;p&gt;But even if I increase the GAP_EVENT_LENGTH the one packet per connection interval will still remain the same. This does not change the number of packets in one connection interval. Correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297011?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:52:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:433076a4-c64b-4073-ae5c-2ff3d788fc6e</guid><dc:creator>Sigurd</dc:creator><description>[quote userid="74601" url="~/f/nordic-q-a/71974/nrf52840-ble-transfer-speed-issues/297005#297005"]NRF_SDH_BLE_GAP_EVENT_LENGTH is set to 6 by default and when I try to increase it the whole system freezes[/quote]
&lt;p&gt;As mentioned, you need to increase the allocated RAM to the SoftDevice.&lt;/p&gt;
&lt;p&gt;Are you using SES ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here you can see how to increase it:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1614628199566v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Also, for debugging in SES, set these config&amp;#39;s in sdk_config.h to get logging in the debug terminal window&lt;/p&gt;
&lt;p&gt;NRF_LOG_BACKEND_RTT_ENABLED 1&lt;/p&gt;
&lt;p&gt;NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297009?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:46:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5c2154c-e263-4382-a5cc-13c727dc9dfb</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1614627998565v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297005?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:24:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5486cd6-3c41-481b-89a0-3082dbd616b1</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;I can verify that because the kBps at the tablet side where I send the data, will not increase and remain the same. The app where I receive the data displays the kBps while receiving them. The NRF_SDH_BLE_GAP_EVENT_LENGTH is set to 6 by default and when I try to increase it the whole system freezes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297004?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:22:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bcbadf2-4598-4045-8c94-e4fb5789364a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Did you increase&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH to a higher value?&lt;/p&gt;
&lt;p&gt;How are you verifying the number of packets per connection interval?&lt;/p&gt;
&lt;p&gt;Also, could be that the phone is limiting the packets per connection interval. You should get a sniffer log of the behavior:&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE"&gt;https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297002?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:19:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab8d9b46-529d-4c95-bb92-fe3182434b1b</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;I mean that if I call the ble_nus_data_send() 4 times this will not include 4 packets in one connection interval but it will create 4 connection intervals with one packet in each &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/297001?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b953d3bd-eff8-4049-a65e-21839eafd44f</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;It does not include 2 packets in a connection interval. Initially that was what I thought too but it doesnt. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/296999?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:16:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71afad81-9e39-4657-adee-cf522d708c45</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;I tried that but the data rate does not increase because the ble_nus_data_send() waits for the connection interval to complete. I mean that it sends every time one packet per connection interval&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/296998?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 19:10:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4db6f090-ba3b-4d46-b9bd-b0304db953e5</guid><dc:creator>Sigurd</dc:creator><description>[quote user="masterLee"]error 7 [/quote]
&lt;p&gt;&amp;nbsp;That is&amp;nbsp;NRF_ERROR_INVALID_PARAM, if you take a look at the implementation of&amp;nbsp;ble_nus_data_send(), you will see that you will get this error when you try to send a packet with length larger than NRF_SDH_BLE_GATT_MAX_MTU_SIZE - OPCODE_LENGTH(1) - HANDLE_LENGTH(2)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="masterLee"]For example, if I try to send an array of 488 bytes ( 2 packets of 244 bytes) and I set the length = 488&amp;nbsp; the function throws an error 7[/quote]
&lt;p&gt;&amp;nbsp;You need to call&amp;nbsp;ble_nus_data_send() 2 times instead then.(if NRF_SDH_BLE_GATT_MAX_MTU_SIZE == 247)&lt;/p&gt;
&lt;p&gt;One time with the first 244 bytes of the array, and then a second time with the last 244 bytes of the array.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/296987?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 18:27:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a7fad19-ae23-4a0c-9444-c90a5340048a</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;my main problem is that I cannot send more than one packet in one connection interval. This heavily reduces throughput. If I solve this issue I will be ok.&lt;/p&gt;
&lt;p&gt;When I try to send an array of data larger than 244 bytes with&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;do
{
    uint16_t length = (uint16_t)index;
    err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);
    if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
        (err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;
        (err_code != NRF_ERROR_NOT_FOUND))
    {
        APP_ERROR_CHECK(err_code);
    }
} while (err_code == NRF_ERROR_RESOURCES);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the transmission stops and an error 7 pops up.&lt;/p&gt;
&lt;p&gt;Since I have set the connection Interval at 10msec,&amp;nbsp; theoretically, I can include 7-8 packets of 244 bytes each.&lt;/p&gt;
&lt;p&gt;But the ble_nus_data_send() function returns an error 7 and the system freezes. How is this possible since the variable that holds the size of the data array is uint16_t ?&lt;/p&gt;
&lt;p&gt;For example, if I try to send an array of 488 bytes ( 2 packets of 244 bytes) and I set the length = 488&amp;nbsp; the function throws an error 7&lt;/p&gt;
&lt;p&gt;What am I doing wrong here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/296715?ContentTypeID=1</link><pubDate>Sun, 28 Feb 2021 22:22:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:923156f0-0390-4049-a89d-5cf2ac582588</guid><dc:creator>Sigurd</dc:creator><description>[quote user="masterLee"]&lt;p&gt;Now, regarding the max packets per connection interval,I read in post that the S140 has a maximum of 6 packets.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;There was such a limit in the older versions of the SoftDevice(several years ago), but&amp;nbsp;now the SoftDevice may transfer as many packets as can fit within the connection event as specified by the event length for the connection. This is mentioned in the SDS&amp;nbsp;throughput chapter: &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/ble_data_throughput/ble_data_throughput.html"&gt;https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/ble_data_throughput/ble_data_throughput.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/296713?ContentTypeID=1</link><pubDate>Sun, 28 Feb 2021 21:03:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f7548b9-2ea9-4545-9655-4b957f46ce09</guid><dc:creator>masterLee</dc:creator><description>&lt;p&gt;Hi, I will try what you suggest.&lt;/p&gt;
&lt;p&gt;Now, regarding the max packets per connection interval,I read in post that the S140 has a maximum of 6 packets.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Does it mean that&amp;nbsp; 6 packets are transferred to one direction such as from the peripheral (nRF52840) to mobile or, 3 packets from each direction meaning three packets from the peripheral side and three packets from the central side?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I am confused with the concept of data packets because if I get it right the data packets for one connection interval increase if I increase the connection interval. But from comparison tables and the fact that android devices can handle up to 6 packets per interval I understand that this is not true.&lt;/p&gt;
&lt;p&gt;Also I haven&amp;#39;t found some definition in the softdevice documentation that specifies the exact number of maximum packets that it can handle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Transfer speed issues</title><link>https://devzone.nordicsemi.com/thread/296381?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 18:25:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba9d5965-6374-45c5-8a0e-d414400edff6</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]1. How can I increase NRF_SDH_BLE_GATT_MAX_MTU_SIZE from 247 to 512? Because it is a 1-byte value and 512 needs 2-bytes&amp;nbsp; will need to mess with the SD libraries[/quote]
&lt;p&gt;&amp;nbsp;It should be enough to just set it to 512. But,&amp;nbsp;&lt;span&gt;247 will give you the max&amp;nbsp;throughput.&amp;nbsp;By setting&amp;nbsp;NRF_SDH_BLE_GAP_DATA_LENGTH = 251 (this is max for this setting), and&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE = 247, we avoid fragmentation of the ATT packet into several on-air data packets.&lt;/span&gt;&lt;/p&gt;
[quote user=""]&lt;p&gt;2. Is it possible to increase the NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp; higher than 6? Because when I set it to 7 or 8 the whole system stops.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Yes, but you would likely need to allocate more RAM to the SoftDevice. How this is done depends on what toolchain/IDE you are using.&lt;/p&gt;
&lt;p&gt;Also, as long as the phone does not limit the amount of BLE packets per connection interval, you might be able to get slightly higher throughput with a higher connection interval.&lt;/p&gt;
&lt;p&gt;Also, I recommend&amp;nbsp;&lt;span&gt;enabling connection event length extension.&amp;nbsp;You can enable Connection Event Length Extension with a function like this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;void conn_evt_len_ext_set(bool status)
{
    ret_code_t err_code;
    ble_opt_t  opt;

    memset(&amp;amp;opt, 0x00, sizeof(opt));
    opt.common_opt.conn_evt_ext.enable = status ? 1 : 0;

    err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &amp;amp;opt);
    APP_ERROR_CHECK(err_code);

}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then call conn_evt_len_ext_set(true) after you have enabled the SoftDevice.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you still are having issues with&amp;nbsp;throughput, please do a sniffer trace with&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE"&gt;nRF Sniffer&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>