<?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>Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37398/error-enabling-connection-event-extension-in-uart-example</link><description>Hi all, 
 I use nRF52832 with the UART peripheral example. 
 I try to enable connection event extension in the device and get an error. 
 I use SDK V15.0.0 and Softdevice V 6.0.0 
 I put the following code at the end of the nrf_sdh_ble_default_cfg_set</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Aug 2018 12:24:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37398/error-enabling-connection-event-extension-in-uart-example" /><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145512?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 12:24:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6250bed1-2e9e-4e32-886c-b04b58cacb0d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, please mention me in the new ticket. Thanks.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145502?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 11:49:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de31f8d0-71d8-4204-81b9-fc775012ba6c</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;I will open a private ticket. Should I tag you in the new ticket?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145414?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 07:17:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e24d5e60-3504-4c6e-9a31-e59ba1e50632</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Are you able to share your project so I can try to test it here? You can create a new private ticket if you don&amp;#39;t want to post it here. Please provide instructions on how I should test it if you can share it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145413?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 07:03:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:951ec30d-246d-4bd8-b6d1-326c24b1b6d8</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;Unfortunately this didn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;I tried first with the configuration that was already working for me (interval min=max=15, event length=6).&lt;br /&gt;I tried not waiting for&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE&amp;nbsp;and just update the indices of the ring buffer if&amp;nbsp;ble_nus_data_send returned with NRF_SUCCESS.&lt;br /&gt;&lt;br /&gt;I tried&amp;nbsp;a different approach also, looping&amp;nbsp;ble_nus_data_send until it returned with NRF_SUCCESS, I had many losses/distortions of data.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145410?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 06:54:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f820c96b-343f-43c8-8ed4-6a76cf7e35f9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;There is a limit to how many packets you can send per event where it won&amp;#39;t help to increase the event length. Not sure what it is for the softdevice, but the largest number of packets I have been able to sent is 12 packets (27 byte link layer packet), and that was with a nRF52 and an iphone 7. For better throughput, the central must support data length extension, long MTU and 2M PHY.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145404?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 06:40:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91599991-38a1-438d-93fa-4c02c8b07c62</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;I don&amp;#39;t fully understand.&lt;/p&gt;
&lt;p&gt;What if my connection interval is long and I set a high value for the event length, I still can&amp;#39;t send more than 12 packets?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145403?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 06:35:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdda77ba-cea5-45bb-9365-ddd8d1ac64de</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/dani_5f00_cvetanov"&gt;dani_cvetanov&lt;/a&gt;, thanks for your comments!&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/clonimmus74"&gt;Clonimmus74&lt;/a&gt;,&amp;nbsp;&amp;nbsp;&lt;span&gt;hvn_tx_queue_size defines the number of notification &lt;strong&gt;packets&lt;/strong&gt; you can queue in the softdevice&amp;#39;s tx buffer. You can&amp;#39;t send more than ~12 packets per connection so I don&amp;#39;t think it makes sense to increase the buffer to more than 12.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;excerpt from API documentation for&amp;nbsp;sd_ble_gatts_hvx():&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The number of Handle Value Notifications that can be queued is configured by&amp;nbsp;&lt;a class="el" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.0.0/structble__gatts__conn__cfg__t.html#ae2a1156d8b06a6ccc70696f2372226cc"&gt;ble_gatts_conn_cfg_t::hvn_tx_queue_size&lt;/a&gt;&amp;nbsp;When the queue is full, the function call will return&amp;nbsp;&lt;a class="el" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.0.0/group__nrf__error.html#gac94383171545e604e8347a044e8be13f"&gt;NRF_ERROR_RESOURCES&lt;/a&gt;. A&amp;nbsp;&lt;a class="el" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.0.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;&amp;nbsp;event will be issued as soon as the transmission of the notification is complete.The application can keep track of the available queue element count for notifications by following the procedure below:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Store initial queue element count in a variable.&lt;/li&gt;
&lt;li&gt;Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a class="el" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.0.0/group__nrf__error.html#ga7e6367efeaac363d8cf024940b4ec123"&gt;NRF_SUCCESS&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Increment the variable, which stores the current available queue element count, by the count variable in&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a class="el" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.0.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;&lt;span&gt;&amp;nbsp;&lt;/span&gt;event.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145401?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 06:30:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb01264c-a0c8-41cb-9204-9e79839d9137</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;What do you mean by:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;add the message in your queue&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;you can remove completely your queue&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there a limit on&amp;nbsp;HVN queue size, and&amp;nbsp;is it measured in bytes?&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: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145371?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 17:41:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0577491a-c92e-4da9-8528-67b892bc3bb1</guid><dc:creator>dani_cvetanov</dc:creator><description>&lt;p&gt;You don&amp;#39;t need to wait for&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE in order to send the next packet. Just send it whenever you can by calling&amp;nbsp;ble_nus_data_send. Only if it returns error (i.e. the HVN queue is full), then you can add the message in your queue. Or you can remove completely your queue and&amp;nbsp;in case&amp;nbsp;you need more space to buffer the TX packets, then just increase the HVN queue size as mentioned above.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145341?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 14:07:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7037f0ce-aa19-45fd-ac0a-a15ed9169ef5</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;Can you please elaborate, as I&amp;#39;m extremely new to BLE, and Nordic especially....&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145339?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 14:04:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e04c1392-8f4e-47bb-ae72-73616eaaa8f4</guid><dc:creator>dani_cvetanov</dc:creator><description>&lt;p&gt;Solved on my side! It seems that our issue is that we have our own message queue and we&amp;#39;re waiting for the&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE event in order to send the next packet. However, this limits the maximum TX packets to 1 per connection interval. We should use the HVN queue if we want to boost the throughput.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145290?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 11:24:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc7eaaab-eaf6-4bf6-a732-35639637905e</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;Yes, I tried it with a phone running Android 8 (Honor 9).&lt;/p&gt;
&lt;p&gt;I also tried it with Nordic Central (same chip, using eval board PCA10040)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145167?ContentTypeID=1</link><pubDate>Tue, 21 Aug 2018 15:33:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96da8a1d-3f1b-4aba-a932-c7cabba0c3a5</guid><dc:creator>dani_cvetanov</dc:creator><description>&lt;p&gt;Gents,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have absolutely the same issue with that SDK and&amp;nbsp;that chip.&amp;nbsp;I have set the MTU to 244 bytes.&amp;nbsp;With the default connection interval (min=20. max=75mS) I get ~700bytes/sec. When I reduce the connection interval to 15mS (min and max), then the throughput increases to 2100bytes/sec.&lt;/p&gt;
&lt;p&gt;What are we missing?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145112?ContentTypeID=1</link><pubDate>Tue, 21 Aug 2018 11:58:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86b52541-cdf4-414b-8dd3-3a9d8d95692a</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;Thank you&lt;br /&gt;What is&amp;nbsp;&lt;span&gt;hvn queue size and&amp;nbsp;is there a limit to its size?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/145097?ContentTypeID=1</link><pubDate>Tue, 21 Aug 2018 11:20:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e74af3d-b8a4-4d6a-9d54-5ca942e21427</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;ble_nus_data_send() will only transfer data if it returns NRF_SUCCESS so your buffer handling appears to be correct. But you are less likely to run out of buffer space when you have a shorter CI (15 ms). Please try to increase the hvn queue size to see if it helps:&lt;/p&gt;
&lt;p&gt;in ble_stack_init()&lt;/p&gt;
&lt;p&gt;{&amp;nbsp;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;// Configure the BLE stack using the default settings.&lt;br /&gt; // Fetch the start address of the application RAM.&lt;br /&gt; uint32_t ram_start = 0;&lt;br /&gt; err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;ble_cfg, 0, sizeof(ble_cfg_t));&lt;br /&gt; ble_cfg.conn_cfg.conn_cfg_tag = APP_BLE_CONN_CFG_TAG;&lt;br /&gt; ble_cfg.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = 12;&lt;br /&gt; err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTS, &amp;amp;ble_cfg, ram_start);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/144856?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2018 07:53:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:099e2b8c-66bc-4fd7-bcbb-027a1b23c22d</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;As I said, with connection interval of min = 15 max = 15 it works fine, so yes, my ring buffer implementation is good (and used in other projects as well).&lt;/p&gt;
&lt;p&gt;What do I do if&amp;nbsp;&lt;span&gt;ble_nus_data_send returns with something other than&amp;nbsp;NRF_SUCCESS?&lt;br /&gt;What I currently do is leave the ring buffer indices as they are (as to force re-transmit). What is not clear is if&amp;nbsp;ble_nus_data_send can return with error but manage to send parts of the data, in which case I will get distorted buffers.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I work in debug mode so I can see if I stop in&amp;nbsp;app_error_fault_handler, so I configured the RAM as was indicated the first time I got an error. still the configurations with higher event length didn&amp;#39;t work well.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/144838?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2018 07:01:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ce0ffd0-eae3-40d5-999c-1fff6b800a59</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;If you see lost or corrupted packets it is likely caused by an error in the application code on one of your devices (see endnode&amp;#39;s answer in this&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/28919/notify-is-safe/114426#114426"&gt;thread&lt;/a&gt;). As long as ble_nus_data_send() is called with the correct data and returns NRF_SUCCESS you should not see this problem. Have you verified that your ring buffer implementation works as intended?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given that you are checking return codes, your application would have failed during initialization if you had the wrong RAM configuration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/144799?ContentTypeID=1</link><pubDate>Sun, 19 Aug 2018 08:08:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab919ddb-acfd-412a-9fca-c10b1a75d87f</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;When I say it doesn&amp;#39;t work I mean the transfer is too slow and I lose packets or get distorted ones.&lt;/p&gt;
&lt;p&gt;I increased the application RAM but still the mentioned configurations didn&amp;#39;t work, was I missing something?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;min=max=15 msec&amp;nbsp;is not a good idea for me since it is the minimum allowed by iOS and Android at the moment, if in next versions of the OS they will decide to raise the minimum as they did before, the application will not work (though 30 msec or longer with longer&amp;nbsp;event length, should).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Another solution is to use 100-200 msec interval when using low data rate (45 bytes per second) in my case, and lower it to 15 msec when needed. Not sure if it will work though. constant interval of 200-400 with higher event length seems better, as it covers all scenarios.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/144735?ContentTypeID=1</link><pubDate>Fri, 17 Aug 2018 13:32:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4faab7f-12e2-43f4-ac7a-ebe1d3212a12</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The transmit code can send &amp;quot;m_ble_nus_max_data_len&amp;quot; bytes at a time. It will not be limited to 20 bytes if the gap central supports&amp;nbsp;a larger&amp;nbsp;MTU. You make the following changes to main.c to print out the actual MTU and link layer packet size:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;--- a/examples/ble_peripheral/ble_app_uart/main.c
+++ b/examples/ble_peripheral/ble_app_uart/main.c
@@ -452,7 +452,11 @@ 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_INFO(&amp;quot;MTU is set to %d&amp;quot;, p_evt-&amp;gt;params.att_mtu_effective);
+    }
+    else if ((m_conn_handle == p_evt-&amp;gt;conn_handle) &amp;amp;&amp;amp; (p_evt-&amp;gt;evt_id == NRF_BLE_GATT_EVT_DATA_LENGTH_UPDATED))
+    {
+        NRF_LOG_INFO(&amp;quot;ll len is set to %d&amp;quot;, p_gatt-&amp;gt;links[m_conn_handle].data_length_effective);
     }
     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,&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you say it doesn&amp;#39;t work, is the transfer speed too low, or is it not&amp;nbsp;advertising/connectable? Note that you need to increase the application RAM base when increasing the GAP event length in order to allocate more RAM to the softdevice, see debug log for appropriate RAM base/size.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would suggest to set min=max=15 msec if that works. The connection param module (ble_conn_params.c) will notify the application through the registered callback if the central rejects the requested connection interval. In that case you have request a new longer interval, or disconnect.&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/144446?ContentTypeID=1</link><pubDate>Thu, 16 Aug 2018 08:24:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc89956a-c0f5-4892-ba51-8f729ece8353</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;Yes&amp;nbsp;&lt;span&gt;this is a hard requirement, only with Android and Nordic Central (as in PCA10040).&lt;br /&gt;When the&amp;nbsp;data length is&amp;nbsp;244,&amp;nbsp;m_ble_nus_max_data_len = 244 (or 241 not sure), since in&amp;nbsp;gatt_evt_handler we have:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;    m_ble_nus_max_data_len = p_evt-&amp;gt;params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The transmit code sends packets up to&amp;nbsp;m_ble_nus_max_data_len per transmission, but my understanding is that notification (via ble_nus_data_send) can send only 20 bytes at a time, can this be part of the problem?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As I said, it worked for me with connection interval min=max=15 msec, and with the same phone/Nordic central, it didn&amp;#39;t work using the following configurations:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. connection interval min =&amp;nbsp;200 &amp;amp; max = 400,&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH = 160 &amp;amp;&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. connection interval min = 100 &amp;amp; max = 200,&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH =&amp;nbsp;80 &amp;amp;&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. connection interval min =&amp;nbsp;15 &amp;amp; max = 30,&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH =&amp;nbsp;12 &amp;amp;&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. connection interval min =&amp;nbsp;15&amp;nbsp;&amp;amp; max =&amp;nbsp;30,&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH = 6&amp;nbsp;(without event extension) &amp;amp;&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/144341?ContentTypeID=1</link><pubDate>Wed, 15 Aug 2018 13:47:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0741055b-26d2-4b8e-b7a9-255884629e4d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Transfer speed is typically limited by the phone and it will not be possible to guarantee the 906 byte requirement for all phones unfortunately. Is this a hard requirement?&amp;nbsp; I think most, if not all phones support a connection interval of 30 ms, but the number of packets per connection event can be less than 6 (w standard 27 byte link layer packet). See attached pdf&amp;nbsp; section 4.5 for a comparison&amp;nbsp;between a selection of phones that we have tested internally.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-619c0d8c9b7e4fefb966e9ce5b482155/BLE_5F00_on_5F00_Android_5F00_v1.0.1.pdf"&gt;devzone.nordicsemi.com/.../BLE_5F00_on_5F00_Android_5F00_v1.0.1.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;244 byte data length means you can send 6x244&amp;nbsp;bytes every 30 msec?&amp;quot;&amp;nbsp; Yes, this means the radio will send 244 byte packets except the number of packets per event depends on the event length and connection interval. See &amp;quot;Bluetooth Low energy data throughput&amp;quot; in the softdevice specification for max. transfer speed achievable with the softdevice:&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/ble_data_throughput/ble_data_throughput.html?cp=2_3_1_0_16"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/ble_data_throughput/ble_data_throughput.html?cp=2_3_1_0_16&lt;/a&gt;. Note that support for data length extension, long MTU, and 2M mode is not available on &amp;quot;most&amp;quot; phones, but you can test these features with iphone 7 or newer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use the connection parameter negation module to renegotiate connection interval (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_ble_conn_params.html?cp=4_0_0_3_2_4_3#lib_ble_conn_params_change_conn_params"&gt;doc&lt;/a&gt;)&amp;nbsp;as needed (power consumption vs transfer speed).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/144082?ContentTypeID=1</link><pubDate>Tue, 14 Aug 2018 07:45:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a80b41d-196f-4335-b668-2ff150b10fe5</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;My Central device can either be iOS (iPhone 6/7 was tested), Android (tested with HTC that has Android 4, and Honor 9 which has Android 8), or Nordic nRF52832 (PCA10040 board).&lt;br /&gt;&lt;br /&gt;I managed to get good results with connection interval min=max=15 msec, and&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH = 6. I don&amp;#39;t like this option as it has no negotiation for connection interval, and I don&amp;#39;t want to be limited in case the Central will not support this interval. In addition this interval is not optimized for power consumption in the case where I send small amounts of data (45 bytes once a second).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My understanding of BLE is limited, I don&amp;#39;t understand how your configuration can work.&amp;nbsp;244 byte data length means you can send 6x244&amp;nbsp;bytes every 30 msec?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23, and I saw that I also got&amp;nbsp;244 byte data length in my configuration, but I don&amp;#39;t think it will always be the case, no? if&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23 the data length can actually be 23, no? In which case, using your configuration, you can achieve only 6x20 per 30 msec, that is about 808 bytes every 220 msec (short of my requirements of 906 bytes).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 247, but it caused problems and didn&amp;#39;t always work.&lt;br /&gt;&lt;br /&gt;When I tried connection interval min = 15 &amp;amp; max = 30,&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH = 12 &amp;amp;&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23, I also got&amp;nbsp;244 byte data length but had missed/uncompleted packets.&lt;br /&gt;&lt;br /&gt;I tried even:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. connection interval min =&amp;nbsp;200 &amp;amp; max = 400,&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH = 160 &amp;amp;&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. connection interval min = 100 &amp;amp; max = 200,&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH =&amp;nbsp;80 &amp;amp;&amp;nbsp;BLE_GATT_ATT_MTU_DEFAULT = 23&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Most of the data was missed.&lt;br /&gt;&lt;br /&gt;Do I need to set the option API in the [Nordic]&amp;nbsp;Central as well? What about Android Central?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/143986?ContentTypeID=1</link><pubDate>Mon, 13 Aug 2018 13:40:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e07b1cc4-41a4-4aae-984f-a2a13063aa28</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The option API must be called after sd_ble_enable(). This is probably why you got 0x3001 error ( corresponds to&amp;nbsp;BLE_ERROR_NOT_ENABLED) . As for the data rate, are you using a central device that supports Data length extension (nRF52 dev kit or a newer ios/android device)? I did a quick test with the ble_app_uart example and an iphone 7 and got ~9.8 kB/s throughput @ 30 ms , 244 byte data length, NRF_SDH_BLE_GAP_EVENT_LENGTH = 6.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error enabling connection event extension in UART example</title><link>https://devzone.nordicsemi.com/thread/143908?ContentTypeID=1</link><pubDate>Mon, 13 Aug 2018 10:53:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbcc17cd-4480-4f90-91f7-899746082b3b</guid><dc:creator>Clonimmus74</dc:creator><description>&lt;p&gt;Moved the code right after&amp;nbsp;ble_stack_init();&lt;/p&gt;
&lt;p&gt;Now the error doesn&amp;#39;t appear, but data rate is awful.&lt;/p&gt;
&lt;p&gt;I have connection interval min = 15, max = 30&lt;/p&gt;
&lt;p&gt;Event length = 12&lt;/p&gt;
&lt;p&gt;sending 906 bytes every 220msec and every 4-6 packets I have a few packets missing.&lt;/p&gt;
&lt;p&gt;The data is sent, instead of within the interrupt, in main, using the following function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void SendDataToHost(void)
{
  static uint16_t length_to_send;
  static uint16_t current_length_to_send;

  uint32_t err_code;

  if (ring_buffer_out_point &amp;lt; ring_buffer_fill_point)
    length_to_send = ring_buffer_fill_point - ring_buffer_out_point;
  else if (ring_buffer_out_point &amp;gt; ring_buffer_fill_point)
  {
    length_to_send = kEND_OF_TX_RING_BUFFER_LOCATION - ring_buffer_out_point;
    length_to_send += (ring_buffer_fill_point - application_tx_ring_buffer);
  }

  do
  {
    if (f_ble_tx_complete)
    {
      if (length_to_send &amp;gt; m_ble_nus_max_data_len)
      {
        current_length_to_send = m_ble_nus_max_data_len;

        if ((current_length_to_send + ring_buffer_out_point) &amp;gt; kEND_OF_TX_RING_BUFFER_LOCATION)
          current_length_to_send = kEND_OF_TX_RING_BUFFER_LOCATION - ring_buffer_out_point;

        f_ble_tx_complete = 0;
        err_code = ble_nus_data_send(&amp;amp;m_nus, ring_buffer_out_point, &amp;amp;current_length_to_send, m_conn_handle);

        if (err_code != NRF_SUCCESS)
          f_ble_tx_complete = 1;
        else
        {
          ring_buffer_out_point += current_length_to_send;
          if (ring_buffer_out_point &amp;gt;= kEND_OF_TX_RING_BUFFER_LOCATION)
            ring_buffer_out_point = application_tx_ring_buffer;
          length_to_send -= current_length_to_send;
          current_length_to_send = 0;
        }
      }
      else if (length_to_send)
      {
        if ((length_to_send + ring_buffer_out_point) &amp;gt; kEND_OF_TX_RING_BUFFER_LOCATION)
          current_length_to_send = kEND_OF_TX_RING_BUFFER_LOCATION - ring_buffer_out_point;
        else
          current_length_to_send = length_to_send;

        f_ble_tx_complete = 0;
        err_code = ble_nus_data_send(&amp;amp;m_nus, ring_buffer_out_point, &amp;amp;current_length_to_send, m_conn_handle);
        if (err_code != NRF_SUCCESS)
          f_ble_tx_complete = 1;
        else
        {
          ring_buffer_out_point += current_length_to_send;
          if (ring_buffer_out_point &amp;gt;= kEND_OF_TX_RING_BUFFER_LOCATION)
            ring_buffer_out_point = application_tx_ring_buffer;
          length_to_send -= current_length_to_send;
          current_length_to_send = 0;
        }
      }
    }
  } while(length_to_send);

  length_to_send = 0;
  current_length_to_send = 0;

  (void)err_code;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The ring buffer is of 4KB.&lt;/p&gt;
&lt;p&gt;f_ble_tx_complete is set in&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE event.&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>