<?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>packet loss issue with nus service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13416/packet-loss-issue-with-nus-service</link><description>I am sending IMU data as 20 byte packets through nus service at the rate of 50 such packets per second. The device is a nrf51 DK configured as ble peripheral (S110). The application contains twi to read data from sensor, nus to send data, and uart to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Apr 2016 12:42:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13416/packet-loss-issue-with-nus-service" /><item><title>RE: packet loss issue with nus service</title><link>https://devzone.nordicsemi.com/thread/51216?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2016 12:42:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1869331b-123c-4964-a4ec-e02030fca0d7</guid><dc:creator>Dan</dc:creator><description>&lt;p&gt;Thank you for your response, Stefan.
My connection interval is currently set to &amp;quot;&lt;strong&gt;MSEC_TO_UNITS(8, UNIT_1_25_MS)&lt;/strong&gt;&amp;quot; which is the least possible value, if I&amp;#39;m right.&lt;/p&gt;
&lt;p&gt;And as I&amp;#39;ve said above, the central (receiver) works fine with other non-Nordic peripheral devices which implement the NUS in a custom profile. Similarly, the Nordic peripheral works properly with the Master Control Panel, without ANY packet loss.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: packet loss issue with nus service</title><link>https://devzone.nordicsemi.com/thread/51215?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 16:06:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab58a677-e0fb-4d73-9cc7-1fd99de1c41e</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Dan&lt;/p&gt;
&lt;p&gt;My first thought is that your connection interval is too low. There is a maximum of 6 packets per connection interval. If you are e.g. feeing the softdevice with a packet with 50Hz frequency, but your connection interval is e.g. 200ms, then the packets will pile up in the softdevice and you will have a buffer overflow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 26.4.2016&lt;/strong&gt;
As far as I can see, the acceptable connection intervals of the central ble_app_uart_c application is the same as in the peripheral ble_app_uart application, i.e. minimum connection interval of 20ms and maximum connection interval of 75ms. I tried connecting the two devices to see what connection interval is actually present when connecting, and it is 75ms.&lt;/p&gt;
&lt;p&gt;For S130/S132 2.0.x the RX and TX bandwidth is configurable, individually for peripheral and central links. The default configuration for connections as a central is BLE_CONN_BW_MID (both for TX and RX), and for connections as a peripheral it is BLE_CONN_BW_HIGH (both for TX and RX). The BLE_CONN_BW_MID is 3 packets per connection interval max and BLE_CONN_BW_HIGH is 6 packets per connection interval max. So I suspect the central ble_app_uart_c application is limited to maximum 3 packets per connection interval. The result is that you are able to send in one direction 1/0.075*3 = 40 packets per second. Since you are feeding the softdevice with 50 packets per second, it is logical that you will get a buffer overflow.&lt;/p&gt;
&lt;p&gt;So I see two ways of fixing this&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Change the connection interval for the central device, e.g. min 20ms and max 40ms&lt;/li&gt;
&lt;li&gt;Change the bandwidth of the central links to BLE_CONN_BW_HIGH&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To see how to change the bandwidth of the central links, look at the s13x_nrf5x_2.0.0_migration-document, chapter about &amp;quot;Configurable bandwidth&amp;quot;. The &lt;a href="https://www.nordicsemi.com/eng/nordic/Products/nRF52832/S132-SD-v2/51479"&gt;migration document&lt;/a&gt; is bundled with the softdevice download file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>