<?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>Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62368/increase-data-transfer-rate-for-nrf52840-for-queued-write</link><description>Hi 
 I am using the provided example ble_app_queued_writes to send 256 bytes in each call. 
 It is taking around 13 seconds to transfer 3136 bytes: 
 12 calls of 256 and one for 64. Around 1 second per transfer. This seems very slow to me. 
 
 I checked</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Jul 2020 07:55:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62368/increase-data-transfer-rate-for-nrf52840-for-queued-write" /><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/257725?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 07:55:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e6148c8-eb0b-4a6b-b1b3-fce208528e5c</guid><dc:creator>Raja</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for all the help.&lt;/p&gt;
&lt;p&gt;My issue is resolved. The queued write was the bootle neck.&lt;/p&gt;
&lt;p&gt;I created a normal service and with that i was able to get speed of 500 Kbps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/256319?ContentTypeID=1</link><pubDate>Tue, 23 Jun 2020 07:47:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c235249c-81f9-46bb-9fd9-f87e4cd9fc25</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;What is the variable &amp;quot;data&amp;quot; when you call this? And do you do this in a loop? How often is it called?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Have you tried capturing a sniffer trace of the connection? Perhaps that can show how often one of these packets are captured, what connection interval you are actually using, the MTU size that your connection is using and so on. Please be aware that it is the central/master in the connection that decides what connection parameters that will be used, so even if you set MIN and MAX CONN_INTERVAL in your peripheral, it doesn&amp;#39;t mean that these are necessarily used. When you see the connection parameters that you have, you can compare this to what you get if you use the same parameters in the example:&lt;/p&gt;
&lt;p&gt;SDK\examples\ble_central_and_peripheral\experimental\ble_app_att_mtu_throughput.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/256163?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2020 11:42:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a46cbb09-1c18-4edf-800b-ac8b598dfd88</guid><dc:creator>Raja</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for the reply Edvin.&lt;/p&gt;
&lt;p&gt;I followed the iOS example from Nordc github &lt;a href="https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library/blob/master/iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUPacket.swift"&gt;IOS-Pods-DFU-Library-master&lt;/a&gt;&amp;nbsp;and&amp;nbsp;IOS-nRF-Toolbox-master. I am sending data immediately without any delay from iPhone:&lt;/p&gt;
&lt;p&gt;Following statement is executed in loop until the data (153600 bytes) is&amp;nbsp;fully transferred, i have not added any wait or delay:&lt;/p&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;peripheral.writeValue(data,&amp;#160;for:&amp;#160;characteristic,&amp;#160;type:&amp;#160;.withoutResponse)&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes i am passing &lt;span&gt;153600 bytes&lt;/span&gt;&amp;nbsp;of data from iPhone to nRF52840-DK&lt;/p&gt;
&lt;p&gt;These are the sample code i followed on iOS side:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/IOS-Nordic-Thingy/blob/develop/IOSThingyLibrary/Classes/Services/SoundService/ThingySoundService.swift"&gt;https://github.com/NordicSemiconductor/IOS-Nordic-Thingy/blob/develop/IOSThingyLibrary/Classes/Services/SoundService/ThingySoundService.swift&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library/blob/master/iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUPacket.swift"&gt;https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library/blob/master/iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUPacket.swift&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Do you have any expert on the iOS side, i mean who wrote the above nordic libraries to kindly confirm if this is not correct?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/256137?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2020 09:08:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83b70eba-8b5f-4ad4-a818-fc69898907bf</guid><dc:creator>Edvin</dc:creator><description>[quote user="RahulNRF"] &lt;strong&gt;Do you have any sample program where nRF52840 can receive data fast atleast 20-30KBPS&lt;/strong&gt;?[/quote]
&lt;p&gt;&amp;nbsp;Yes, I do. Please check my reply in the link from my very first reply. Without any changes the devices will have approximately 7-800 KBPS (bit not byte).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suspect that your bottleneck is how you send your packets from the phone. If you send one packet every second, it doesnt help that your link supports 700KBPS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you trying to send 20-30 KBPS from your phone?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/256029?ContentTypeID=1</link><pubDate>Sat, 20 Jun 2020 11:09:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e650cbd4-1c55-4601-b85d-dae43f96a0fc</guid><dc:creator>Raja</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;As per your advice i have updated the&amp;nbsp;&lt;span&gt;event length as:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;in main.c&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;#define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS)&amp;nbsp;&lt;br /&gt;#define MAX_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS)&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;in sdk_config.h&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH&lt;br /&gt;#define NRF_SDH_BLE_GAP_EVENT_LENGTH 30&lt;br /&gt;#endif&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But i was&amp;nbsp;able to see the slight difference in the speed, now instead of 2 mins and 30 seconds it is taking 2 min and 20 seconds to transfer the data. But still the performance is very poor.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;For the&amp;nbsp;ACK, do you mean i need to send data without response&lt;/strong&gt;&lt;/span&gt;? For this i have been going through&amp;nbsp;the blogs and and articled on this site and found a &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial" rel="noopener noreferrer" target="_blank"&gt;tutorial&amp;nbsp;&lt;/a&gt;&amp;nbsp;but it does not show how to implement it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;So i changed&lt;/span&gt;&amp;nbsp;char&lt;span&gt;&amp;nbsp;&lt;/span&gt;to &lt;strong&gt;write without response&lt;/strong&gt; as, i hope this is the correct way?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;add_char_params.char_props.write_wo_resp = true;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In another post i found was &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50193/queued-write-without-response-questions"&gt;this &lt;/a&gt;and i implemented the following:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ble_cfg.conn_cfg.params.gattc_conn_cfg.write_cmd_tx_queue_size = 25;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_stack_init(void)
{
    ret_code_t err_code;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

//---- UPDATE START

    ble_cfg_t ble_cfg;

    memset(&amp;amp;ble_cfg, 0, sizeof(ble_cfg));
    ble_cfg.conn_cfg.conn_cfg_tag = APP_BLE_CONN_CFG_TAG;
    ble_cfg.conn_cfg.params.gattc_conn_cfg.write_cmd_tx_queue_size = 25;

    err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTC, &amp;amp;ble_cfg, ram_start);
    APP_ERROR_CHECK(err_code);

//---- UPDATE END

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Register a handler for BLE events.
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I even disabled the logs&amp;nbsp;#define NRF_LOG_ENABLED 0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This gave me no performance change at all. I am bit stuck on this. Please can you help me on this? &lt;strong&gt;Do you have any sample program where nRF52840 can receive data fast atleast 20-30KBPS&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;On the iOS side i checked we are ok we are getting&amp;nbsp;&lt;span&gt;maximumWriteValueLength as 512,&amp;nbsp;&lt;/span&gt;&lt;span&gt;Also iPhone is&amp;nbsp;writing data without response so i think the problem is in firmware side.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;I look forward for your reply.&amp;nbsp;I am really stuck here with speed issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/255873?ContentTypeID=1</link><pubDate>Fri, 19 Jun 2020 06:38:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3328e3e4-743e-47b8-9c66-08e39652a2f1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;ok,&lt;/p&gt;
&lt;p&gt;Then the only remaining thing you need to check is that the event length is set to the maximum (equal to your connection interval) in order to maximize the efficiency. If you still see that it takes long to send, it is because of the phone application. You need to send the packets faster. If you are waiting for some sort of ACK before you send the next packet, skip that. Just queueu them up as fast as you can. I don&amp;#39;t know how this is done on the phone side, so you probably know this better than me.&lt;/p&gt;
&lt;p&gt;If you were sending from the nRF, that then you should keep sending until it returns NRF_ERROR_RESOURCES. Perhaps it works similar on the phone side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/255827?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 15:00:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae655379-26a9-4220-a1b5-cb3a1ccd7606</guid><dc:creator>Raja</dc:creator><description>&lt;p&gt;Hi Edvin, thanks for your reply.&amp;nbsp;I will look at the&amp;nbsp;&lt;span&gt;ble_app_uart.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;I&amp;nbsp;am not sending data from nRF52840&lt;/strong&gt; i am just receiving data in nRF52840-DK&amp;nbsp;from iPhone app.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am storing the received data in buffer i.e.&amp;nbsp;screen_buffer in function queued_write_service_evt_handler please see the code i posted in previous reply.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/255813?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 14:13:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea8b31dd-63d8-47b4-a99d-94ce37c63fd1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Look at the implementation of gatt_init() in the ble_app_uart example and add a callback like it is done there. Then look at what the callback says.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You still failed to show me how you send data. Perhaps you can just upload the main.c file if you are not sure what I am asking for.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What i am interrested in is how you queue up the data that you are sending. Where do you feed the&amp;nbsp;&amp;nbsp;&lt;span&gt;{0x40,&lt;/span&gt;&lt;span&gt;0x&lt;/span&gt;&lt;span&gt;14,0x40,&lt;/span&gt;&lt;span&gt;0x&lt;/span&gt;&lt;span&gt;14,0x40&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;0x&lt;/span&gt;&lt;span&gt;14,0xc0&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;0x&lt;/span&gt;&lt;span&gt;0b,0xc0&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;0x&lt;/span&gt;&lt;span&gt;0b.......} data into to transmit it to the phone?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/255777?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 12:53:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a66b4019-2418-4b5f-b309-2997ab80d92c</guid><dc:creator>Raja</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I am sending an Image data as bytes from my app in iOS (using iPhone 8 Plus):&lt;/p&gt;
&lt;p&gt;e.g. snipit&lt;/p&gt;
&lt;p&gt;{0x40,&lt;span&gt;0x&lt;/span&gt;14,0x40,&lt;span&gt;0x&lt;/span&gt;14,0x40&lt;span&gt;,&lt;/span&gt;&lt;span&gt;0x&lt;/span&gt;14,0xc0&lt;span&gt;,&lt;/span&gt;&lt;span&gt;0x&lt;/span&gt;0b,0xc0&lt;span&gt;,&lt;/span&gt;&lt;span&gt;0x&lt;/span&gt;0b.......}&lt;/p&gt;
&lt;p&gt;Data is sent in&amp;nbsp;batch&amp;nbsp;with 256 bytes per transmission. Taking around 2.5 mins for all data transfer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My gatt_init is the same as the example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for initializing the GATT module.
 */
static void gatt_init(void)
{
    ret_code_t err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, NULL);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please see the handler code below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint16_t queued_write_service_evt_handler(nrf_ble_qwrs_t     * p_qwrs,
                                                         nrf_ble_qwrs_evt_t * p_evt)
{
    uint16_t ret_val = BLE_GATT_STATUS_SUCCESS;
    switch (p_evt-&amp;gt;evt_type)
    {
        case BLE_QWRS_CHECK_RCVD_DATA:
                ret_val =  BLE_GATT_STATUS_SUCCESS;
            break;//BLE_QWRS_CHECK_RCVD_DATA

        case BLE_QWRS_NEW_DATA_RCVD:
            // This is where the data is actually received and has been accepted.
            if(BUFFER_INDEX &amp;lt; 153600) {
              memcpy(&amp;amp;screen_buffer[BUFFER_INDEX], &amp;amp;p_evt-&amp;gt;rcvd_data[0], p_evt-&amp;gt;rcv_length * sizeof(uint8_t));
              BUFFER_INDEX = BUFFER_INDEX + p_evt-&amp;gt;rcv_length;
            }
            
            if(BUFFER_INDEX == 153600) {
              NRF_LOG_INFO(&amp;quot;153600&amp;quot;);
              show_full_screen_image();
              BUFFER_INDEX = 0;
            }
            break;//BLE_QWRS_NEW_DATA_RCVD
        default:
            // No implementation needed.
            break;
    }
	NRF_LOG_FINAL_FLUSH();
    return ret_val;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am not sure about your question:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What is your&amp;nbsp;m_ble_nus_max_data_len (or equivalent) after this callback?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But i have set the max data length (251) in main as:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;data_len_set(251);
advertising_start(erase_bonds);
&lt;/pre&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;The functions definition is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void data_len_set(uint8_t value)
{
    ret_code_t err_code;
    err_code = nrf_ble_gatt_data_length_set(&amp;amp;m_gatt, BLE_CONN_HANDLE_INVALID, value);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/255767?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 12:32:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f268b83a-d90b-404d-98b0-628cf11d312d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, you are half the way there. What are you sending to/from? nRF in both ends?&lt;/p&gt;
&lt;p&gt;How do you actually send the 19kB of data? Can you show me a snippet of where the data is being sent? And what do you get in the callback&amp;nbsp;gatt_evt_handler()? (or whatever you set as the callback function in&amp;nbsp;nrf_ble_gatt_init().&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for handling events from the GATT library. */
void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
{
    if ((m_conn_handle == p_evt-&amp;gt;conn_handle) &amp;amp;&amp;amp; (p_evt-&amp;gt;evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED))
    {
        m_ble_nus_max_data_len = p_evt-&amp;gt;params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;
        NRF_LOG_INFO(&amp;quot;Data len is set to 0x%X(%d)&amp;quot;, m_ble_nus_max_data_len, m_ble_nus_max_data_len);
    }
    NRF_LOG_DEBUG(&amp;quot;ATT MTU exchange completed. central 0x%x peripheral 0x%x&amp;quot;,
                  p_gatt-&amp;gt;att_mtu_desired_central,
                  p_gatt-&amp;gt;att_mtu_desired_periph);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What is your&amp;nbsp;m_ble_nus_max_data_len (or equivalent) after this callback?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/255722?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 09:58:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7750787-2957-45c3-be4d-12530f67c85b</guid><dc:creator>Raja</dc:creator><description>&lt;p&gt;Thanks Edvin,&lt;/p&gt;
&lt;p&gt;It is working now i can transfer the data bit faster, but still it is taking 2.5 mins to pass 19KB of data. I was hoping to get at least 20-40&amp;nbsp;KBPS.&lt;/p&gt;
&lt;p&gt;I have been going through different posts and&amp;nbsp; have found following steps to increase the data transfer speed. Unfortunately there is no clear post which mentions code steps most of them are only describing the theory.&lt;/p&gt;
&lt;p&gt;Please see below the steps i have done to increase the the updated the code as follows:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1) Updated the connections interval as:&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;#define &lt;/span&gt;MIN_CONN_INTERVAL                MSEC_TO_UNITS(&lt;span&gt;7.5&lt;/span&gt;, UNIT_1_25_MS)&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;#define &lt;/span&gt;MAX_CONN_INTERVAL                MSEC_TO_UNITS(&lt;span&gt;500&lt;/span&gt;, UNIT_1_25_MS)&lt;/pre&gt;
&lt;p&gt;2) Updated the config file to increase MTU and set the Length as 100&lt;/p&gt;
&lt;pre&gt;&lt;br /&gt;&lt;span&gt;#define &lt;/span&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH &lt;span&gt;100&lt;br /&gt;&lt;/span&gt;&lt;span&gt;#define &lt;/span&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE &lt;span&gt;247&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;3) Updated the main to increase the Data length to 251 before advertise:&lt;/p&gt;
&lt;p&gt;In main set the&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;data_len_set(251);
advertising_start(erase_bonds);
void data_len_set(uint8_t value)
{
    ret_code_t err_code;
    err_code = nrf_ble_gatt_data_length_set(&amp;amp;m_gatt, BLE_CONN_HANDLE_INVALID, value);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;4) In&amp;nbsp;ble_evt_handler updated to use 2 MBPS&lt;/p&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
{
    NRF_LOG_INFO(&amp;quot;PHY update request.&amp;quot;);
    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);
} break;
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please point me in the right direction, Thanks&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/254465?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 11:56:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f578477f-8583-4a15-b29e-9cbf4e45147b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You need to change the settings to what your log says:&lt;/p&gt;
&lt;p&gt;RAM_START=20002c80&lt;br /&gt;RAM_SIZE=0x3d380&lt;/p&gt;
&lt;p&gt;Use those values. And if you change something else later in your project, and you see that log message again, you must change the values in the log again.&lt;/p&gt;
&lt;p&gt;Just to let you know. Queued write is not intended for higher throughput. I would not recommend using it for your use case.&lt;/p&gt;
&lt;p&gt;If you are interested, queued write is intended if you want to change several characteristics at the same time. E.g. if you have a service containing characteristics that contains a heart rate and a time stamp, and these belong together, you can use queued write to update them simultaneously. It has nothing to do with throughput speed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/254307?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 14:49:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4c08ba1-47ec-44fc-919b-4a43505b6037</guid><dc:creator>Raja</dc:creator><description>&lt;p&gt;I see currently this is the RAM settings in segger:&lt;/p&gt;
&lt;p&gt;FLASH_PH_START=0x0&lt;/p&gt;
&lt;p&gt;FLASH_PH_SIZE=0x100000&lt;/p&gt;
&lt;p&gt;RAM_PH_START=0x20000000&lt;/p&gt;
&lt;p&gt;RAM_PH_SIZE=0x40000&lt;/p&gt;
&lt;p&gt;FLASH_START=0x27000&lt;/p&gt;
&lt;p&gt;FLASH_SIZE=0xd9000&lt;/p&gt;
&lt;p&gt;RAM_START=0x20002300&lt;/p&gt;
&lt;p&gt;RAM_SIZE=0x3dd00&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;From the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/62363/nrf52832-throughput-test-with-nordic-uart-service" rel="noopener noreferrer" target="_blank"&gt;link &lt;/a&gt;above attached project&amp;nbsp; &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-66da924423a948088df52f6d59be354f/nus_5F00_throughput.zip"&gt;\examples\nus_throughput\ble_app_uart\pca10056\s140\ses&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I get RAM settings as:&lt;/p&gt;
&lt;p&gt;FLASH_PH_START=0x0&lt;/p&gt;
&lt;p&gt;FLASH_PH_SIZE=0x100000&lt;/p&gt;
&lt;p&gt;RAM_PH_START=0x20000000&lt;/p&gt;
&lt;p&gt;RAM_PH_SIZE=0x40000&lt;/p&gt;
&lt;p&gt;FLASH_START=0x27000&lt;/p&gt;
&lt;p&gt;FLASH_SIZE=0xd9000&lt;/p&gt;
&lt;p&gt;RAM_START=0x20002bf0&lt;/p&gt;
&lt;p&gt;RAM_SIZE=0x3d410&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When i changed to this&amp;nbsp;i get this error:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;lt;warning&amp;gt; app: System reset&lt;br /&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_sdh_ble: Change the RAM start location from 0x20002BF0 to 0x20002C80.&lt;br /&gt;&amp;lt;warning&amp;gt; nrf_sdh_ble: Maximum RAM size for application is 0x3D380.&lt;br /&gt;&amp;lt;error&amp;gt; nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.&lt;br /&gt;&amp;lt;error&amp;gt; app: Fatal error&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Do you have a similar project for&amp;nbsp;queued write?&lt;/p&gt;
&lt;p&gt;Please advice&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase data transfer rate for nRF52840 for queued write</title><link>https://devzone.nordicsemi.com/thread/254288?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 13:49:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c059ca46-07a9-47ee-870b-80d1bba41a17</guid><dc:creator>Edvin</dc:creator><description>[quote user=""]1) &lt;em&gt;ATT MTU&amp;nbsp;: &lt;/em&gt;&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE more than 23 results in error:[/quote]
&lt;p&gt;&amp;nbsp;You need to actually do these ram adjustments in your IDE settings. What do you use? Segger Embedded Studio?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]2) When updating to BLE_GAP_PHY_2MBPS getting again&amp;nbsp;System reset[/quote]
&lt;p&gt;&amp;nbsp;What does the log say? Try to define DEBUG in your preprocessor definitions to see what the error handler points to.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just answered a very similar question. Check out the answer, and the project I attached in that ticket:&lt;/p&gt;
&lt;p&gt;&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;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>