<?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>How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78113/how-to-sent-a-200-bytes-data-packet-via-nus-every-20ms-between-nrf52832-and-nrf52840</link><description>Hello, I&amp;#39;m making a system with NUS of nRF52832 and nRF52840 to sample data with SAADC. I started the system with &amp;quot;ble_app_uart__saadc_timer_driven__scan_mode_03&amp;quot; from Github &amp;quot;NordicPlayground&amp;quot;. The link is below: nRF52-ADC-examples/README.md at master</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Aug 2021 11:37:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78113/how-to-sent-a-200-bytes-data-packet-via-nus-every-20ms-between-nrf52832-and-nrf52840" /><item><title>RE: How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/thread/325089?ContentTypeID=1</link><pubDate>Mon, 16 Aug 2021 11:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89a89247-7e6d-4d0e-b46b-5d5ed42215aa</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;If you build with DEBUG then you should get more information about the error from&amp;nbsp;app_error_fault_handler() in app_error_weak.c&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/thread/323861?ContentTypeID=1</link><pubDate>Fri, 06 Aug 2021 23:40:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fbae1e8-2098-45c7-83e3-9cff493cac02</guid><dc:creator>laumung</dc:creator><description>&lt;p&gt;Since the &amp;quot;Windows size&amp;quot; and &amp;quot;interval&amp;quot; is a index number and the real time is about &amp;quot;1.25&amp;quot; proportional to the number, so I guess we should correct the&amp;nbsp;MIN_CONN_INTERVAL and&amp;nbsp;MAX_CONN_INTERVAL in the peripheral. Am I right? But when I decreased the parameters to 5 and 35 respectively, The peripheral will keep in fatal errors. How to correct that? Thanks.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1628293197994v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/thread/323613?ContentTypeID=1</link><pubDate>Fri, 06 Aug 2021 00:11:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbf80be9-3c93-4f91-a39f-9815d6e5d31c</guid><dc:creator>laumung</dc:creator><description>&lt;p&gt;On the central side, I used &amp;quot;nrf52-ble-app-uart-c-multilink-master&amp;quot; as example. It&amp;#39;s also based on the &amp;quot;ble_app_multilink_central&amp;quot; project in &amp;quot;ble_central &amp;quot; folder. I didn&amp;#39;t find any connection parameter in main.c but I get some in the sdk_config.h files which listed below. Does it match the peripheral firmware? Thanks.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;o&amp;gt; NRF_BLE_SCAN_SCAN_INTERVAL - Scanning interval. Determines the scan interval in units of 0.625 millisecond. 
#ifndef NRF_BLE_SCAN_SCAN_INTERVAL
#define NRF_BLE_SCAN_SCAN_INTERVAL 160               //160
#endif

// &amp;lt;o&amp;gt; NRF_BLE_SCAN_SCAN_DURATION - Duration of a scanning session in units of 10 ms. Range: 0x0001 - 0xFFFF (10 ms to 10.9225 ms). If set to 0x0000, the scanning continues until it is explicitly disabled. 
#ifndef NRF_BLE_SCAN_SCAN_DURATION
#define NRF_BLE_SCAN_SCAN_DURATION 0
#endif

// &amp;lt;o&amp;gt; NRF_BLE_SCAN_SCAN_WINDOW - Scanning window. Determines the scanning window in units of 0.625 millisecond. 
#ifndef NRF_BLE_SCAN_SCAN_WINDOW
#define NRF_BLE_SCAN_SCAN_WINDOW 80                     //80
#endif

// &amp;lt;o&amp;gt; NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL - Determines minimum connection interval in milliseconds. 
#ifndef NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL
#define NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL 7.5       //7.5
#endif

// &amp;lt;o&amp;gt; NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL - Determines maximum connection interval in milliseconds. 
#ifndef NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL
#define NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL 30      //30
#endif&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/thread/323605?ContentTypeID=1</link><pubDate>Thu, 05 Aug 2021 17:55:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1129536-47f8-4e4d-97ef-8d50ee92eb4d</guid><dc:creator>laumung</dc:creator><description>&lt;p&gt;Hi Kenneth, thank you for your reply. I have tried other examples in the&amp;nbsp;&lt;span&gt;nRF5 SDK and it&amp;#39;s lots of migration between the firmware. I will try later. This firmware also based on the example which NORDIC released and it&amp;#39;s also released by NORDIC I think.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have checked my code, as you said. The configuration of the peripheral is listed below and I didn&amp;#39;t find the definition of connection intervals to be 30ms.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define APP_BLE_CONN_CFG_TAG            1                                           /**&amp;lt; A tag identifying the SoftDevice BLE configuration. */

#define DEVICE_NAME                     &amp;quot;Nordic_UART_SAADC_01&amp;quot;                               /**&amp;lt; Name of device. Will be included in the advertising data. */
#define NUS_SERVICE_UUID_TYPE           BLE_UUID_TYPE_VENDOR_BEGIN                  /**&amp;lt; UUID type for the Nordic UART Service (vendor specific). */

#define APP_BLE_OBSERVER_PRIO           3                                           /**&amp;lt; Application&amp;#39;s BLE observer priority. You shouldn&amp;#39;t need to modify this value. */

#define APP_ADV_INTERVAL                64                                          /**&amp;lt; The advertising interval (in units of 0.625 ms. This value corresponds to 40 ms). */

#define APP_ADV_DURATION                18000                                       /**&amp;lt; The advertising duration (180 seconds) in units of 10 milliseconds. */

#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(10, UNIT_1_25_MS)             // 20 /**&amp;lt; Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(75, UNIT_1_25_MS)             /**&amp;lt; Maximum acceptable connection interval (75 ms), Connection interval uses 1.25 ms units. */
#define SLAVE_LATENCY                   0                                           /**&amp;lt; Slave latency. */
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)             /**&amp;lt; Connection supervisory timeout (4 seconds), Supervision Timeout uses 10 ms units. */
#define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(5000)                       /**&amp;lt; Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(30000)                      /**&amp;lt; Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT    3                                           /**&amp;lt; Number of attempts before giving up the connection parameter negotiation. */

#define DEAD_BEEF                       0xDEADBEEF                                  /**&amp;lt; Value used as error code on stack dump, can be used to identify stack location on stack unwind. */

#define UART_TX_BUF_SIZE                256                                         /**&amp;lt; UART TX buffer size. */
#define UART_RX_BUF_SIZE                256                                         /**&amp;lt; UART RX buffer size. */

#define SAADC_SAMPLES_IN_BUFFER         4
#define SAADC_SAMPLE_RATE               4                                         /**&amp;lt; SAADC sample rate in ms. */               

#define PACKET_SIZE                     20                                          // MING

BLE_NUS_DEF(m_nus, NRF_SDH_BLE_TOTAL_LINK_COUNT);                                   /**&amp;lt; BLE NUS service instance. */
NRF_BLE_GATT_DEF(m_gatt);                                                           /**&amp;lt; GATT module instance. */
NRF_BLE_QWR_DEF(m_qwr);                                                             /**&amp;lt; Context for the Queued Write module.*/
BLE_ADVERTISING_DEF(m_advertising);                                                 /**&amp;lt; Advertising module instance. */
&lt;/pre&gt;I have modified the parameter &amp;quot;MIN_CONN_INTERVAL&amp;quot; to 10ms and nothing else. Which code is related to the connection interval? Thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/thread/323438?ContentTypeID=1</link><pubDate>Thu, 05 Aug 2021 06:49:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b4f93d0-ec67-4e40-8668-cb502fcd7404</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I suggest to check out the throughput example project in the nRF5 SDK. For instance your connection interval is rather slow (30ms), it should be possible to lower this to for instance 7.5ms if you have an nRF device in both ends of the link:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1628145955121v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Another strange thing is that I can see the master is skippin many connection intervals, it should be consistenly 30ms, but instead I can find it&amp;#39;s both ~30, ~60, and ~90ms intervals. Likely this indicate that the central is busy scheduling other BLE activities, either other links, scanning etc. So this will have e negative effect on the throughput for the link you are monitoring.&lt;/p&gt;
&lt;p&gt;Not quite sure what you can tell me about the other BLE activities the central is doing here, but that seems to be the main limiting factor.&lt;/p&gt;
&lt;p&gt;Kenneth&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><item><title>RE: How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/thread/323423?ContentTypeID=1</link><pubDate>Thu, 05 Aug 2021 02:16:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9b6fbc5-4189-4be2-bc4d-3c2ac1e2a4b2</guid><dc:creator>laumung</dc:creator><description>&lt;p&gt;Here is the data snap by nordic Sniffer.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0804.pcapng"&gt;devzone.nordicsemi.com/.../0804.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/thread/323415?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 23:23:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3920dae4-f059-40c1-9bed-d75feb44255b</guid><dc:creator>laumung</dc:creator><description>&lt;p&gt;Hi Kenneth, thank you for your reply. I have install the Nordic sniffer le on another NRF52 DK board and capture the data on BLE. This is what I capture in the BLE network. How can I analysis the data?&amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/2080x480/__key/communityserver-discussions-components-files/4/nordic_5F00_scan_5F00_01.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sent a 200 bytes data packet via NUS every 20ms between nRF52832 and nRF52840</title><link>https://devzone.nordicsemi.com/thread/323005?ContentTypeID=1</link><pubDate>Tue, 03 Aug 2021 07:25:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66c953cf-b1ba-418d-b6bb-3fb4b4f36d27</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I suggest to check out this page that describe some good tips:&lt;br /&gt;&lt;a href="https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt;https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To find what may be reducing the throughput further we may need an on-air sniffer log:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html"&gt;https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>