<?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>Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39588/random-disconnection-when-messages-are-sent-from-central-to-peripheral-at-high-rate</link><description>hello there! 
 I am working on a project in which two devices(one is central and other is peripheral ) uses Nordic bluetooth controller for connection and data exchange. nrf51822 for peripheral and nrf51422 for the central. I have random disconnection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Nov 2018 07:54:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39588/random-disconnection-when-messages-are-sent-from-central-to-peripheral-at-high-rate" /><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/159473?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 07:54:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c99e18b7-bb33-4b2e-970d-f93775e702e2</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Thomas,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry if I wasn&amp;#39;t clear. It is&amp;nbsp;&lt;strong&gt;not&amp;nbsp;&lt;/strong&gt;possible to increase the MTU size on the nRF51 series, because the softdevices for nRF51 does not support longer MTU sizes than 23.&lt;/p&gt;
&lt;p&gt;1.1 Yes and no. MTU size is the actual message size that is transmitted on air. buffer size is how much the softdevice can store.&lt;/p&gt;
&lt;p&gt;1.2 If no ACK is ever received, you will get a disconnect. The softdevice will keep re-transmitting until the message is ACKed.&lt;/p&gt;
&lt;p&gt;1.3 Is your connection encrypted? If it is, you can enter the out of band passkey in wireshark. If you don&amp;#39;t use a passkey, but just works bonding, then you should be able to sniff the connection if the sniffer is listening&amp;nbsp; while they exchange the keys. So if you delete the bonding information on both devices, then you should be able to sniff it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2.1. The HCI buffer sizes, this is not related, since you are not using HCI.&lt;/p&gt;
&lt;p&gt;2.2 exactly where do you increase this buffer from 3 to 6? The log should always tell you what your RAM memory configurations should be.&lt;/p&gt;
&lt;p&gt;2.3 Check the log.&lt;/p&gt;
&lt;p&gt;2.4 not necessarily. Since the MTU isn&amp;#39;t increased when you use the nRF51, the peripheral will get events on all received messages.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I really don&amp;#39;t think that the buffer sizes is your cause of disconnection. You shouldn&amp;#39;t focus at the buffer sizes at this point in time, if you want to find the cause of your disconnections. Focus on the sniffer trace. Try to sniff with encryption.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it possible to send the sniffer logs?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/159461?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 03:10:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5024d2d-ccf3-46cf-a166-617a1c7e27df</guid><dc:creator>tpoly</dc:creator><description>&lt;p&gt;Hi Edwin,&lt;/p&gt;
&lt;p&gt;Can you help us with these queries also&lt;/p&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;1, Do we need to change the below parameters to increase tx/rx bandwidth&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;strong&gt;#define HCI_MEM_POOL_ENABLED 0&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;#define HCI_TX_BUF_SIZE 600&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;#define HCI_RX_BUF_SIZE 600&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;#define HCI_RX_BUF_QUEUE_SIZE 4&lt;/strong&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Or does changing these parameters give the same result as setting through sd_ble_opt_set()&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;2, Since I am increasing the tx buffer bandwidth from 3 to 6, do I need to make any changes in RAM(memory configuration) file ?&lt;br /&gt;3, How much memory should I increase for the soft device, when the tx buffer is increased from 3 to 6 .&lt;br /&gt;Currently I increase 24 bytes(since MTU is 23 bytes) for one buffer, then for 3 buffers 3*24=72.&lt;br /&gt;Since our product has two peripherals and so two connections, I make it 72+72 = 144. &lt;br /&gt;Please share your thoughts on this calculations.&lt;br /&gt;4, Do I need to check the buffer width for peripheral. For peripheral I assume tx buffer width to be 6 by default.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Kind Regards,&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thomas&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/159460?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 02:51:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51f6e3bd-2068-4ac4-bd8b-bbd768f821d7</guid><dc:creator>tpoly</dc:creator><description>&lt;p&gt;Thanks Edwin for the responses.&lt;/p&gt;
&lt;p&gt;I am using SDK 12.3 and S130.&amp;nbsp; I am able to see following code in my project&lt;/p&gt;
&lt;p&gt;&lt;em&gt;/* GATT Module init. */&lt;/em&gt;&lt;br /&gt;&lt;em&gt;void gatt_init(void)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret_code_t err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So I think, I could add&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE); // NRF_SDH_BLE_GATT_MAX_MTU_SIZE is defined as 247 in sdk_config.h&lt;/em&gt;&lt;br /&gt;&lt;em&gt;APP_ERROR_CHECK(err_code);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;But the above call increases the MTU size. Does it increase the tx buffer width.&lt;/p&gt;
&lt;p&gt;1, Is the tx buffer width and MTU size the same or is it related ?&lt;/p&gt;
&lt;p&gt;2, When a message is sent from central to peripheral and no ACK is received from peripheral within the supervision timeout, do we get&amp;nbsp;BLE_GAP_EVT_DISCONNECTED event or do we get any other&amp;nbsp;BLE_GAP_EVT_TIMEOUT/BLE_GATTC_EVT_TIMEOUT ?&lt;/p&gt;
&lt;p&gt;3, Yes, tried with sniffer, but could not get it follow the connection. In the sniffer could see traces of connection events but failed to see any events when data was sent.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Thomas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/159180?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 09:35:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a57132c8-b9f9-41e3-aa0b-85867c0c3690</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Thomas,&lt;/p&gt;
&lt;p&gt;I believe what you really should be changing is the gatt_init() function (typically called in the main() function, such as it is done in the ble_app_uart example.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void gatt_init(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE); // NRF_SDH_BLE_GATT_MAX_MTU_SIZE is defined as 247 in sdk_config.h
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;On second thought, this is how you do it in SDK15.2.0. In SDK12.3.0, this was not yet supported, and isn&amp;#39;t really supported at all in the S130 softdevice.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regardless, changing the queue size shouldn&amp;#39;t affect your project. It doesn&amp;#39;t change the data going over the air, and it doesn&amp;#39;t affect disconnections.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you please give the nRF Sniffer a try. It is Alpha Omega for BLE development debugging. Let me know when you have a sniffer trace, or if you have any issues with the sniffer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/159149?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 06:39:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19510190-9a09-4308-8c60-357bb292c514</guid><dc:creator>tpoly</dc:creator><description>&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Hi Edwin,&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thanks for the resposnses.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;I tried to increase the tx buffer in 2 methods. The first method, i call the sd_ble_opt_set() during ble_stack_init() &lt;br /&gt;and in the second method i call sd_ble_opt_set(), when connection is made(BLE_GAP_EVT_ADV_REPORT). In our product we have a central and two peripherals, so for each connection the sd_ble_opt_set() is called.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;br /&gt;1, 1st method&lt;br /&gt;static void ble_stack_init(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t err_code;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp;NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;uint32_t count = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;do&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;count++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(count&amp;gt;0xFFFF)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;//timeout count in a while loop&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}while(NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Initialize the SoftDevice handler module.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SOFTDEVICE_HANDLER_INIT(&amp;amp;clock_lf_cfg, NULL);&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ble_enable_params_t ble_enable_params;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = softdevice_enable_get_default_config(NRF_BLE_CENTRAL_LINK_COUNT,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_BLE_PERIPHERAL_LINK_COUNT,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;ble_enable_params);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Check the ram settings against the used number of links&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHECK_RAM_START_ADDR(NRF_BLE_CENTRAL_LINK_COUNT, NRF_BLE_PERIPHERAL_LINK_COUNT);&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enable BLE stack.&lt;br /&gt;#if (NRF_SD_BLE_API_VERSION == 3)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ble_enable_params.gatt_enable_params.att_mtu = NRF_BLE_GATT_MAX_MTU_SIZE;&lt;br /&gt;#endif&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = softdevice_enable(&amp;amp;ble_enable_params);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Register with the SoftDevice handler module for BLE events.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Register with the SoftDevice handler module for System events.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;/*Configure bandwidth */&lt;br /&gt;&amp;nbsp;ble_opt_t ble_opt;&lt;br /&gt;&amp;nbsp;ble_common_opt_conn_bw_t conn_bw;&lt;br /&gt;&amp;nbsp;memset(&amp;amp;conn_bw, 0x00, sizeof(conn_bw));&lt;br /&gt;&amp;nbsp;memset(&amp;amp;ble_opt, 0x00, sizeof(ble_opt));&lt;br /&gt;&amp;nbsp;conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;&lt;br /&gt;&amp;nbsp;conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_HIGH;&lt;br /&gt;&amp;nbsp;conn_bw.role = BLE_GAP_ROLE_CENTRAL;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;ble_opt.common_opt.conn_bw = conn_bw;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;uint32_t err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &amp;amp;ble_opt);&lt;br /&gt;&amp;nbsp;APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;2, 2nd method&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;case BLE_GAP_EVT_ADV_REPORT:&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;ble_opt_t ble_opt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;ble_common_opt_conn_bw_t conn_bw = { .role = BLE_GAP_ROLE_CENTRAL, .conn_bw = {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .conn_bw_rx = BLE_CONN_BW_HIGH, .conn_bw_tx = BLE_CONN_BW_HIGH } };&lt;br /&gt;ble_opt.common_opt.conn_bw = conn_bw;&lt;br /&gt;sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &amp;amp;ble_opt);&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;}&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;br /&gt;With both the methods, i am not successfully able to connect to the peripherals.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;1, Is this the correct method to increase the tx buffer bandwidth ?&lt;br /&gt;2, Do we need to change the below parameters to increase tx/rx bandwidth&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;#define HCI_MEM_POOL_ENABLED 0&lt;br /&gt;#define HCI_TX_BUF_SIZE 600&lt;br /&gt;#define HCI_RX_BUF_SIZE 600&lt;br /&gt;#define HCI_RX_BUF_QUEUE_SIZE 4&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Or does changing these parameters give the same result as setting through sd_ble_opt_set()&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;3, Since I am increasing the tx buffer bandwidth from 3 to 6, do I need to make any changes in RAM(memory configuration) file ?&lt;br /&gt;4, How much memory should I increase for the soft device, when the tx buffer is increased from 3 to 6 .&lt;br /&gt;Currently I increase 24 bytes(since MTU is 23 bytes) for one buffer, then for 3 buffers 3*24=72.&lt;br /&gt;Since our product has two peripherals and so two connections, I make it 72+72 = 144. &lt;br /&gt;Please share your thoughts on this calculations.&lt;br /&gt;5, Do I need to check the buffer width for peripheral. For peripheral I assume tx buffer width to be 6 by default.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thanks,&lt;/div&gt;
&lt;div style="background-color:transparent;color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;line-height:24px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thomas&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/158565?ContentTypeID=1</link><pubDate>Thu, 22 Nov 2018 09:03:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc5084c1-b5be-4c51-afd7-7553b172a545</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Thomas,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know your implementation of ble_nus_c_control_send(), and when it returns NRF_SUCCESS when it returns something else, but I assume you use this implementation to keep sending until you have sent all your packets. By doing this, your nRF will not go to sleep until the timeout is reached, or all the packets are queued (sd_ble_gattc_write()).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When sd_ble_gattc_write returns NRF_ERROR_RESOURCES, you should wait for a&amp;nbsp;BLE_EVT_TX_COMPLETE event (you need to add this to your ble_evt_handler() in main.c) which means that a packet is ACKed, and you have freed up space in the queue. Use this event to queue another packet, as you can then go to sleep in between queuing packets. This is just a general tip, though. It shouldn&amp;#39;t affect your disconnect reason.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you try to monitor these events, the&amp;nbsp;BLE_EVT_TX_COMPLETE? Do you not receive these in the seconds before the disconnect?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regarding the nRF Sniffer:&lt;/p&gt;
&lt;p&gt;I assume you have seen the &lt;a href="http://infocenter.nordicsemi.com/pdf/nRF_Sniffer_UG_v2.2.pdf"&gt;user guide&lt;/a&gt;. Can you check that you have done everything in the setup section, section 2?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regarding disconnection due to timeout, the chances of this may be increased when sending large packets. When you don&amp;#39;t send any packets, each device will send an empty packet on the connection events (every connection interval). These are ACKed, and it resets the timeout timer. When you send a long packet, it increases the chance of flipping bits, and thus not being ACKed. Especially on long ranges. However, the other device (peripheral in your case, I believe), will still send empty packets, which will be ACKed, and this should reset this timer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A sniffer trace should say whether they can hear each other or not. And do you get the TX complete events in the seconds before the disconnection?&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: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/158534?ContentTypeID=1</link><pubDate>Thu, 22 Nov 2018 06:50:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c74c697-6dc5-4e0b-a8c2-68caf5ccc82c</guid><dc:creator>tpoly</dc:creator><description>&lt;div&gt;Thanks Edwin for the responses.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;We do not use APP_ERROR_CHECK(err_code), while sending messages. So we can rule out the possibility of device being reset due to APP_ERROR_CHECK()&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;In our code we use ble_nus_c_control_send() to send messages&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;em&gt;timeout_counter = 0;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;while (ble_nus_c_control_send(&amp;amp;m_ble_nus_c_first_client, data_array, leng) != NRF_SUCCESS)&amp;nbsp;&amp;nbsp; &lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // repeat until sent or until timeout counter reached maximum count&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timeout_counter++;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(timeout_counter &amp;gt; MAX_TIMEOUT_COUNT_SEND_TO_WHEELS)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt; &lt;br /&gt;and ble_nus_string_send() internally calls&lt;br /&gt;&lt;em&gt;sd_ble_gattc_write(p_ble_nus_c-&amp;gt;conn_handle, &amp;amp;write_params)&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;1, When we are sending messages slowly, we do not receive disconnection at range(20-50 m). But when the messages are sent at faster rate, we have disconnection even at close range(15 m).&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;2, We are not sure why the disconnection happens at close range. Try to understand the posibilities the disconnection can occur at close range. From the stack trace collected, &lt;br /&gt;&amp;nbsp;&amp;nbsp; it shows the disconnection happens due to BLE_HCI_CONNECTION_TIMEOUT. Attached the stack trace for your reference.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Trying to understand the root cause of the issue, before we implement the method you suggested.&lt;br /&gt;&amp;quot;If the buffer is full, you must wait for the BLE_EVT_TX_COMPLETE event (you must add this to your ble_evt_handler() ). When this event is received, it means that a packet was ACKed, and you can queue more. Repeat this pattern.&amp;quot;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Please share your thoughts on the possible root causes why the disconnection can happen in close range, which otherwise does not happen when messages are sent at slow rate.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Thanks in advance,&lt;br /&gt;Thomas&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/ble_5F00_disconnection_5F00_stack_5F00_trace.jpg" /&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/158334?ContentTypeID=1</link><pubDate>Wed, 21 Nov 2018 09:00:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b54e118c-adc3-4bed-ac39-a58f9392ddd6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Thomas,&lt;/p&gt;
&lt;p&gt;Let me be clear, to avoid confusions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="tpoly"]As you mentioned in earlier mail, TX buffer getting full does not result in disconnection event.[/quote]
&lt;p&gt;&amp;nbsp;This is correct. This in itself doesn&amp;#39;t cause a disconnect, but if you call:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;err_code = ble_nus_string_send(...) // or any other function that queues a packet to the TX queue
APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and err_code = NRF_ERROR_RESOURCES&lt;/p&gt;
&lt;p&gt;which is returned if the queue is full. If this value is passed into APP_ERROR_CHECK() then the device will reset. The device that resets will start from scratch, starting to advertise. The device that was connected to it will not receive any disconnect messages, and is still trying to listen to packets from the device that was reset.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Your questions:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;&lt;span&gt;BLE_HCI_CONNECTION_TIMEOUT&amp;nbsp;occurs if the device doesn&amp;#39;t receive any complete packets for the duration of the supervision timeout (by default 4 seconds in most of the examples).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. When you get this event you are already disconnected, so no need to call the disconnect function. You can start scanning again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. You can avoid using indication or notification, but then you will have to trigger manual readings from the central. The throughput will go down drastically, and I don&amp;#39;t think it will solve your issue. Every packet sent over the air is ACKed by the SoftDevice. So a read request message will also be ACKed, and retransmitted if it isn&amp;#39;t. This is from the BLE specification.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4/5:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When you want to send data, you just queue them up in the buffer, using the hvx function call:&amp;nbsp;sd_ble_gatts_hvx().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If this returns NRF_CONNECT, the packet is queued. If it returns something else, DONT send that value into APP_ERROR_CHECK. Look at the description of the return values in ble_gatts.h line 507-555, what the different return values mean.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If the buffer is full, you must wait for the&amp;nbsp;BLE_EVT_TX_COMPLETE event (you must add this to your ble_evt_handler() ). When this event is received, it means that a packet was ACKed, and you can queue more. Repeat this pattern.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/158298?ContentTypeID=1</link><pubDate>Wed, 21 Nov 2018 07:22:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c6a3049-e3cf-4f65-abf6-cad9569f3fb8</guid><dc:creator>tpoly</dc:creator><description>&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Hi Edwin,&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thanks for the responses.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;We are using SDK version 12.3. The reason for disconnection is BLE_HCI_CONNECTION_TIMEOUT(0x08)&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;As you mentioned in earlier mail, TX buffer getting full does not result in disconnection event.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;1, At what scenarios BLE_HCI_CONNECTION_TIMEOUT can occur ? Does it happen only when out of range ?&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;2, Also, when there is a BLE_HCI_CONNECTION_TIMEOUT, do we get BLE_GAP_EVT_TIMEOUT. If we get BLE_GAP_EVT_TIMEOUT, how should it be handled. Should we call sd_ble_gap_disconnect() or start scanning again ?&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;3, Is it possible &lt;strong style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;to not use&lt;/strong&gt; either indication or notification, so that the buffers are cleared without ACK being received. Can we tell the link layer &lt;strong style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;to not use&lt;/strong&gt; indication or notification ?&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;4, Tried increasing TX buffer width in my central device to 6(default was 3).&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;In ble_stack_init(),tried changing TX buffer width from 3 to 6 using the below methods.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;a,&amp;nbsp; 1st method&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&amp;nbsp;ble_conn_bw_counts_t conn_bw_counts = {&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&amp;nbsp;&amp;nbsp;.tx_counts = {.high_count = 1, .mid_count = 0, .low_count = 0},&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&amp;nbsp;&amp;nbsp;.rx_counts = {.high_count = 1, .mid_count = 0, .low_count = 0}&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&amp;nbsp;};&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&amp;nbsp;ble_enable_params.common_enable_params.p_conn_bw_counts = &amp;amp;conn_bw_counts;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;b,2nd method&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;/&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;*Configure bandwidth */&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;ble_opt_t ble_opt;&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;ble_common_opt_conn_bw_t conn_bw;&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;memset(&amp;amp;conn_bw, 0x00, sizeof(conn_bw));&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;memset(&amp;amp;ble_opt, 0x00, sizeof(ble_opt));&lt;/em&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;// if this set to mid this will work but setting it to high will not&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_HIGH;&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &amp;amp;ble_opt);&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;APP_ERROR_CHECK(err_code);&lt;/em&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;Even after trying to set the bandwidth to 6 as in above methods, the bandwidth does not change. Verified using sd_ble_tx_packet_count_get() and could see the value is still 3&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;uint8_t p_count = 0;&lt;/em&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&amp;nbsp;sd_ble_tx_packet_count_get(p_ble_nus_c-&amp;gt;conn_handle, &amp;amp;p_count);&lt;/em&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;em style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;5, How to check&amp;nbsp;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;these events to know when you have some free space in the buffe&lt;/span&gt;r?&lt;/em&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thanks in advance for the responses to help us solving a critical issue.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;Thanks,&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;Thomas&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/158184?ContentTypeID=1</link><pubDate>Tue, 20 Nov 2018 13:11:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:958377ea-d9c4-426b-946b-d97407bf119f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;1: no&lt;/p&gt;
&lt;p&gt;2: not possible to clear the buffer.&lt;/p&gt;
&lt;p&gt;3: no.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What SDK version do you use?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When a message is queued it is not possible to remove it before it is ACKed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can wait for the TX_COMPLETE event. The name of this event depends on the SDK version that you use. Therefore I keep asking what SDK version you use. What SDK version do you use?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can use these events to know when you have some free space in the buffer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note that if you use indication instead of notification, the message has to be ACKed in the application layer of the receiver (central). If this is not done, the buffer will not be cleared.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/158148?ContentTypeID=1</link><pubDate>Tue, 20 Nov 2018 11:25:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e90ce45-360b-4aff-9ada-c2dfda199e4f</guid><dc:creator>tpoly</dc:creator><description>&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Hi Edwin,&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thanks for your inputs.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;Summarizing the issue, tx buffers are getting full when messages are sent at high rate and it results in a disconnection event.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;1, Is it possible to tell the BLE layer to clear the transmit buffers irrespective the sent message was successful or not. Which method to use, BLE_GATT_HVX_NOTIFICATION or BLE_GATT_HVX_INDICATION ?&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;2, Please suggest a way so that irrespective the ACK is received for the messages, the buffer could be cleared. &lt;br style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;" /&gt;3, Does configuring as BLE_GATT_HVX_NOTIFICATION means buffers are cleared and no ACKS are needed to clear the tx buffer.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Request you to give answers to the above queries.&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thanks,&lt;/div&gt;
&lt;div style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thomas&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/154116?ContentTypeID=1</link><pubDate>Tue, 23 Oct 2018 13:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14f06681-d299-4098-9ce8-cb17bde1831e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Thomas,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply. I&amp;nbsp;were out of office for a few days.&lt;/p&gt;
&lt;p&gt;So. Which SDK version do you use?&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t use APP_ERROR_CHECK() it shouldn&amp;#39;t reset. Can you double check that it doesn&amp;#39;t return something else? Is it possible to do some logging?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Queuing up packs shouldn&amp;#39;t be the cause of a timeout. It will only cause the link to send packets with payload data instead of without payload data. That being said, sending longer packets &lt;strong&gt;may&amp;nbsp;&lt;/strong&gt;increase the chance of a packet loss, because there are more places that could include bit errors.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is it possible to do a sniffer trace of the connection when you get the disconnect?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. It is no function call to clear the Softdevice buffer, unfortunately. The softdevice will continue to re-transmit the packets in the buffer until it gets the ACK.&lt;/p&gt;
&lt;p&gt;2. You can try to increase the connection timeout (SUPERVISION_TIMEOUT). Most of our examples uses 4 seconds.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. Clock settings:&lt;/p&gt;
&lt;p&gt;I read from the &lt;a href="http://infocenter.nordicsemi.com/pdf/nRF51422_PS_v3.2.pdf"&gt;nRF51 spec&lt;/a&gt;&amp;nbsp;that the ANT protocol requires a clock accuracy of 50ppm, while using the RC Oscillator only provides 250ppm. I don&amp;#39;t know whether you use ANT or not, (but I suspect it, since you use nRF51422 on one device and nRF51822 on the other). Either way, you may try to reduce the rc_ctiv to see whether it makes a difference.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Previous mail:&lt;/p&gt;
&lt;p&gt;1. Yes, but to be honest, I don&amp;#39;t see that it would help you in the issue. This may increase the throughput of the link, but as long as not one single packet is received within the supervision timeout, it doesn&amp;#39;t really matter. To increase the buffer, you must increase the MTU. This is done in the ble_stack_init() function:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Since you use the S130 softdevice (nRF51), this is not supported.&lt;/p&gt;
&lt;p&gt;2. No.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As mentioned, is it possible to get a sniffer trace? A sniffer trace using &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer"&gt;nRF Sniffer&lt;/a&gt; is sufficient.&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: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/153700?ContentTypeID=1</link><pubDate>Sat, 20 Oct 2018 02:52:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:281ff7fb-bd75-48a3-b903-12c4f34224d7</guid><dc:creator>tpoly</dc:creator><description>&lt;p&gt;Hello Edwin,&lt;/p&gt;
&lt;p&gt;Continuation of my previous mail. Request your reply ASAP, as i am debugging a critical issue in our product.&lt;/p&gt;
&lt;p&gt;More analysis on the short range disconnection issue is due to distance between central and peripheral, some packets are getting lost and do not get BLE_EVT_TX_COMPLETE/BLE_GATTS_EVT_HVX_TX_COMPLETE for those messages. Due to which the trasmit buffers are not cleared and on sending more messages fills up the transmit buffers very fast. This would lead to&amp;nbsp;&lt;span&gt;NRF_ERROR_NO_TX_PACKETS.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kindly answer the questions below for us to help in debugging.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1, In above scenario, is it possible to tell the BLE layer to clear the transmit buffers irrespective the sent message was successful or not. Which method to use,&amp;nbsp;&lt;/span&gt;&lt;code&gt;BLE_GATT_HVX_NOTIFICATION or&amp;nbsp;&lt;/code&gt;&lt;code&gt;BLE_GATT_HVX_INDICATION ?&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2, Can you please suggest o&lt;/span&gt;ptimistic connection parameters (too short connection supervision timeout relative to the connection interval) so that only a few packet drops will lead to disconnect. In our case, we will have frequent out of range scenarios and expect to reconnect back quickly. when in range.&lt;/p&gt;
&lt;p&gt;#define MIN_CONNECTION_INTERVAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSEC_TO_UNITS(7.5, UNIT_1_25_MS)&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Determines minimum connection interval in millisecond. */&lt;/p&gt;
&lt;p&gt;#define MAX_CONNECTION_INTERVAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSEC_TO_UNITS(30, UNIT_1_25_MS)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Determines maximum connection interval in millisecond. */&lt;br /&gt;#define SLAVE_LATENCY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Determines slave latency in counts of connection events. */&lt;br /&gt;#define SUPERVISION_TIMEOUT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSEC_TO_UNITS(1000, UNIT_10_MS)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Determines supervision time-out in units of 10 millisecond. */&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3, Please advise if the LF_CLK_SRC values are opptimal.&lt;/p&gt;
&lt;p&gt;#define NRF_CLOCK_LFCLKSRC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {.source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = NRF_CLOCK_LF_SRC_RC,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .rc_ctiv&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 16,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .rc_temp_ctiv&amp;nbsp; = 2,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM}&lt;/p&gt;
&lt;p&gt;Adding the previous queries what was posted in previous mail.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1,&amp;nbsp;&lt;/span&gt;Is it possible to increase the transmit/receive FIFO/buffer size or number of TX/RX buffer ?&lt;/p&gt;
&lt;p&gt;2, Can we use any function to clear the TX/RX FIFO/buffer ? If yes can you please let us know what function could do this ?&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Thomas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/153558?ContentTypeID=1</link><pubDate>Fri, 19 Oct 2018 07:11:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81e89c87-e072-4d1c-9402-e407bf0c60bd</guid><dc:creator>tpoly</dc:creator><description>&lt;p&gt;Thanks Edvin for the prompt reply.&lt;/p&gt;
&lt;p&gt;Yes, I was able to capture one more stack trace on the central device where it points to the error&amp;nbsp;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;NRF_ERROR_NO_TX_PACKETS. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Our code does not use&amp;nbsp;APP_ERROR_CHECK(err_code) . and no soft device resets happen due to that. Below the code to send ble messages.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;#define MAX_TIMEOUT_COUNT 0xFFFF&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;while (ble_nus_c_control_send(&amp;amp;m_ble_nus_c_first_client, data_array, leng) != NRF_SUCCESS)&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// repeat until sent or until timeout counter reached maximum count&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timeout_counter++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(timeout_counter &amp;gt; MAX_TIMEOUT_COUNT)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Could you please look at the above code that we use to send ble messages and let us know if this could cause any issues to fill up the TX buffer fast.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Couple of queries what we have&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#007000;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:medium;"&gt;1, &lt;/span&gt;Is it possible to increase the transmit/receive FIFO/buffer size or number of TX/RX buffer ?&lt;/p&gt;
&lt;p&gt;2, Can we use any function to clear the TX/RX FIFO/buffer ? If yes can you please let us know what function could do this ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Thomas&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/TX-buffer-full-stack-trace.jpg" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random disconnection when messages are sent from central to peripheral at high rate.</title><link>https://devzone.nordicsemi.com/thread/153472?ContentTypeID=1</link><pubDate>Thu, 18 Oct 2018 12:29:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3c58e8f-d3a8-4df0-b9de-2060af610cb3</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Thomas,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suspect that what you are seeing is that when you try to send packages too fast on a bad link (long distance), the packets that aren&amp;#39;t ACKed because of packet loss remains in the softdevice&amp;#39;s queue. If the queue is full, and you try to queue another packet, it will return something like NRF_ERROR_RESOURCES (or something like that. The name depends on the SDK version you use).&lt;/p&gt;
&lt;p&gt;If this return value is passed into an APP_ERROR_CHECK(err_code); the error handler will reset the application. On the device that is reset, it will start to advertise or scan, depending on whether it is the peripheral or central, but the other device will just see that the BLE link goes silent, and eventually the link will time out.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what your application looks like, or what SDK version you are using, so I will use the ble_app_uart from SDK12.3.0 as an example, since you use the nRF51.&lt;/p&gt;
&lt;p&gt;This application, as you may or may not be aware of, send&amp;#39;s all data received over UART on the BLE link. This happens in uart_event_handle() in main.c.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It will wait for an &amp;#39;\n&amp;#39;, and call err_code = ble_nus_string_send(). This function will call return err_code = sd_ble_gatts_hvx();&lt;/p&gt;
&lt;p&gt;If the queue is full, it will return BLE_ERROR_NO_TX_PACKETS (in this SDK version). This means that the buffer was full. The default check for the return value is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;err_code = ble_nus_string_send(&amp;amp;m_nus, data_array, index);
                if (err_code != NRF_ERROR_INVALID_STATE)
                {
                    APP_ERROR_CHECK(err_code);
                }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you change the if-check to: if (err_code != NRF_ERROR_INVALID_STATE&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;err_code != NRF_ERROR_NO_TX_PACKETS)&lt;/p&gt;
&lt;p&gt;Then your application will not reset. But you should use this information to know that the packet was not queued.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It is possible to increase this queue size by increasing the MTU size. However, note that this will only increase the buffer. The same issue may still happen if the link has bad connection, and you continue to queue packets. All packets that are queued with the return value NRF_SUCCESS is queued, and will eventually be ACKed. The softdevice will retransmit the packet until it is ACKed.&amp;nbsp;&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>