<?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>Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61197/advertisement-packet-loss-in-coded-phy-vs-1-mb-phy</link><description>Using the following: 
 Rigado BMD-360 nRF52811 development board. 
 Softdevice S140 7.0.1 
 SDK 16.0 
 Using two development boards inches apart, one development board sends a single advertising event every 12 seconds. The other development board is continuously</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Jul 2020 09:04:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61197/advertisement-packet-loss-in-coded-phy-vs-1-mb-phy" /><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/258257?ContentTypeID=1</link><pubDate>Fri, 03 Jul 2020 09:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adf50bc5-b829-4cb1-aeaf-b62eadf99152</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Kurtis&lt;/p&gt;
&lt;p&gt;When you&amp;#39;re increasing the scan interval and scan window, that also increases the time of how long you scan on each channel, so that might cause the packet loss you&amp;#39;re seeing. See the picture below for reference (note that this is for &amp;quot;regular&amp;quot; BLE scanning, but it should be similar for Coded PHY as well AFAIK):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-b78c70e9c6414fd097d30f07f189f63e/pastedimage1593767018478v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The only other thing I can think of is that your custom HW&amp;#39;s antenna layout isn&amp;#39;t optimal, and that causes the radio to drift and lose more packets when it is scanning for a longer amount of time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/258156?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 14:34:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1de8d52a-3a07-4e5a-abff-9db23492fc17</guid><dc:creator>Kcecil</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;To verify the packets were lost on air, I simultaneously debugged the BLE application through SWD printing what was received, and monitored the output from the host processor.&amp;nbsp; When the host processor showed a missing packet, the debugger output also showed a missing packet.&lt;/p&gt;
&lt;p&gt;Delays are not an issue at this point.&amp;nbsp; I don&amp;#39;t see using a shorter scan interval as an issue, although I am curious as to why it would make a difference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/258023?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 09:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4816df23-10fe-4cb4-9c67-ca205b689d73</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Could you provide any details as to how you confirmed the packets were lost on air? You could also try using SPI for transmission on the DK as well, just to make sure that it provides the same output as the UART.&lt;/p&gt;
&lt;p&gt;If it is indeed on the air I think I&amp;#39;ll have to see your hardware files to make sure the antenna matching, etc. all look good. Please let me know if you&amp;#39;d like me to set this case to private before you share any files and I&amp;#39;ll do so.&lt;/p&gt;
&lt;p&gt;Please note that we&amp;#39;re entering the summer vacation period here in Norway, so delays must be expected as we are low on staff for the month of July. Sorry about the inconvenience!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/257879?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 13:57:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74d70329-c7d1-4c4c-95c1-c8b0fa43b86e</guid><dc:creator>Kcecil</dc:creator><description>&lt;p&gt;I haven&amp;#39;t had a chance to test the longer interval on the dev board, but I did verify that it was being lost on air and not in the SPI.&lt;/p&gt;
&lt;p&gt;In this application the central only scans and for this testing was only scanning the coded PHY.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/257748?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 08:45:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffb383ef-1c4f-4ee0-a214-91123cec70d0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Does this apply to both the custom board and the UBlox BMD-360? It might be that the buffer fills up&amp;nbsp;before the SPI/UART is able to pass it on on longer scan intervals, or are you positive that the data is lost on air?&lt;/p&gt;
&lt;p&gt;Does this central application switch between scanning or advertising? If so, it might be that the longer scan intervals/windows are interfered by the device advertising (or trying to).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/257671?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 20:18:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8c483f6-bfc6-4a8f-888b-81345f6674dd</guid><dc:creator>Kcecil</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;It looks like the dropped packets are due to the scan interval/window.&amp;nbsp; I&amp;#39;m seeing a loss rate of ~15% with interval/window = 10.24s, 4% with interval/window = 7s, 0% with interval/window = 3.125.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/257604?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 13:24:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa6a3c5a-b500-4894-9b2a-319d6fe75422</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Kurtis&lt;/p&gt;
&lt;p&gt;Thank you for the update. Can you provide some more details regarding your test setup? What kind of environment are you performing these tests in? What pins on the&amp;nbsp;nRF52811 are you using for SPI communication, and what pins on the UBlox BMD-360 are you using for UART?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Seeing as the packet loss is now only seen on your custom board, I think we might have a hardware issue on our hands, as it might be that the custom board&amp;#39;s antenna is not tuned optimally. If you&amp;#39;d like we can do a review of your schematics and HW layout for you, but I suggest you create a new (private) ticket for that, so we can keep this one public. This is entirely up to you though, and if you&amp;#39;d like, we can keep it in this ticket as well, and I&amp;#39;ll set this one to Private mode if you prefer that.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/257471?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 00:06:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01a2b5e8-3367-4e6f-86d2-08fdc4147716</guid><dc:creator>Kcecil</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;When sending a single advertisement, does advertising interval make a difference.&amp;nbsp; My understanding is that it is the time between advertising events, which should be irrelevant with a single advertisement.&amp;nbsp; I did some testing with 2 advertising events with various advertising intervals with very little difference in packet loss.&lt;/p&gt;
&lt;p&gt;It looks like the central example you uploaded doesn&amp;#39;t fit in the nRF52811.&amp;nbsp; I don&amp;#39;t know how relevant it is anyway, as it establishes a connection and my application is advertisement only.&lt;/p&gt;
&lt;p&gt;I have done more testing with the&amp;nbsp;original conditions and with&amp;nbsp;the receiving unit a custom board.&amp;nbsp;In all tests the unit sending the advertisements is the Rigado BMD-360 dev board.&amp;nbsp; I have made some minor changes to both the sending and receiving code from the original testing, including changing the LF clock source from RC to Synth.&amp;nbsp; The code run on the nRF52811 on both the receiving dev board and the custom board are identical.&amp;nbsp; The BLE module in the custom board is the Rigado/UBlox BMD-360.&lt;/p&gt;
&lt;p&gt;On the dev board I am communicating with the module via UART, on the custom board it is via SPI.&amp;nbsp; The code determines which interface it is receiving data from and stops transmitting to the unused interface.&lt;/p&gt;
&lt;p&gt;With the receiving unit a BMD-360, with max advertising events set to 1, I am getting 0% packet loss.&lt;/p&gt;
&lt;p&gt;With the receiving unit a custom board, with max advertising events set to 1, I am getting 14% packet loss.&lt;/p&gt;
&lt;p&gt;With the receiving unit a custom board, with max advertising events set to 2, 30ms advertising interval, I got 80% receiving both packets and 20% receiving only 1 packet.&amp;nbsp; Upping the advertising interval, to 187.5ms and 375ms, I got 82% receiving both packets and 18% receiving only 1 packet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When I first experienced the high packet loss with a dev board as the receiver, it was before I changed the LF clock source.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/256637?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2020 09:44:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91eae0d9-0f36-4c74-85d3-4161c9a871cc</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Kurtis&lt;/p&gt;
&lt;p&gt;Can you try to increase the advertising interval of your peripheral to see if that increases/decreases the packet loss?&lt;/p&gt;
&lt;p&gt;Also, have you checked out the example I uploaded in my last reply to see if the same packet loss can be seen there? I&amp;#39;d also like to know what device the scanner/central is here? Is this a DK as well or are you testing with some other device?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/256547?ContentTypeID=1</link><pubDate>Tue, 23 Jun 2020 20:38:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f9963bd-26cf-44b3-8f57-88b7f36bb617</guid><dc:creator>Kcecil</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;After being pulled away to work on other things, I am investigating this further.&lt;/p&gt;
&lt;p&gt;I am now using custom boards&amp;nbsp;as well as&amp;nbsp;development boards.&amp;nbsp; Currently I am experiencing approximately 20% packet loss under the original conditions.&lt;/p&gt;
&lt;p&gt;I have attached snippets of the ble stack init and the advertising init.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_stack_init(void)
{
    ret_code_t err_code;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

}

static void advertising_init(void)
{

    ble_gap_adv_params_t m_adv_params;
    uint32_t      err_code;
    ble_advdata_t advdata;
    uint8_t       flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

    ble_advdata_manuf_data_t manuf_specific_data;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    manuf_specific_data.data.p_data = (uint8_t *) binData;
    manuf_specific_data.data.size   = BIN_DATA_SIZE;

    // Build and set advertising data.
    memset(&amp;amp;advdata, 0, sizeof(advdata));

    advdata.name_type             = BLE_ADVDATA_NO_NAME;
    advdata.flags                 = flags;
    advdata.p_manuf_specific_data = &amp;amp;manuf_specific_data;

...
    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
    m_adv_params.p_peer_addr     = NULL;    // Undirected advertisement.
    m_adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval        = APP_ADV_INTERVAL;
    m_adv_params.duration        = APP_ADV_DURATION;
    m_adv_params.primary_phy	 = BLE_GAP_PHY_CODED;
    m_adv_params.secondary_phy	 = BLE_GAP_PHY_CODED;
    m_adv_params.max_adv_evts	 = NUM_ADV_EVENTS;

    err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
    if (err_code != NRF_SUCCESS)
	printf(&amp;quot;encode=%x\n&amp;quot;, err_code);

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params);
    if (err_code != NRF_SUCCESS)
	printf(&amp;quot;cfg=%x\n&amp;quot;, err_code);
    
    m_adv_data.adv_data.p_data[0] = 30;
    m_adv_data.adv_data.p_data[1] = 1;
    uint16_t *manuf_ptr = (uint16_t *)&amp;amp;m_adv_data.adv_data.p_data[2];
    *manuf_ptr = APP_COMPANY_IDENTIFIER;
...
    err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_adv_handle, TRANSMIT_POWER);
    if (err_code != NRF_SUCCESS)
	printf(&amp;quot;power set failed=%x\n&amp;quot;, err_code);
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/250124?ContentTypeID=1</link><pubDate>Fri, 15 May 2020 09:11:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:474ebadc-6e3d-4c8b-99e8-6444fe954146</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Thank you for the update Kurt&lt;/p&gt;
&lt;p&gt;This seems very strange indeed. You should have a much larger success rate with the setup you&amp;#39;re describing. Coded PHY should definitely not be losing this many packets compared to the other PHY(s). Can you show me how your advertising initialization function looks?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can also take a look at this example, where the ble_app_uart and ble_app_uart_c projects have been modified to use Coded PHY. Please keep in mind that you should set the advertising flag to GENERAL_DISC_MODE in this example to make it work properly.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-b78c70e9c6414fd097d30f07f189f63e/Long_5F00_range_5F00_15.2.zip"&gt;devzone.nordicsemi.com/.../Long_5F00_range_5F00_15.2.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/250053?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 19:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2e5e274-aaf0-4a45-b142-cd3d43c1df66</guid><dc:creator>Kcecil</dc:creator><description>&lt;p&gt;I&amp;#39;ve repeated the experiment with 15 fewer data bytes, so now the GAP event structure reports a size of 15 bytes.&amp;nbsp; I am still getting a packet loss rate of approximately 50%.&amp;nbsp; I have verified that the advertiser is not&amp;nbsp;reporting errors in sending.&lt;/p&gt;
&lt;p&gt;I have performed another limited experiment where I have sent 15 advertisements with a delay of 100ms between them.&amp;nbsp; In approximately 50% of those cases, the first advertisement is not detected.&amp;nbsp; All the remaining advertisements are detected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/249349?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 07:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da4de830-0684-4d8a-a7d9-adddef32cbde</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Kurt&lt;/p&gt;
&lt;p&gt;Packets with a data length of more than 27 bytes in Coded PHY has an increased chance of losing packets. It would be better to transmit two smaller packets than one larger one when using Coded PHY.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/249216?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 13:59:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19f708a4-34d5-4fcb-ad84-d96d91200b38</guid><dc:creator>Kcecil</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;Thank you for the quick response.&lt;/p&gt;
&lt;p&gt;I want to make sure I understand.&amp;nbsp; The 27 bytes per packet you reference, is that an extended advertising limit&amp;nbsp; and if exceeded requires a second packet, thereby increasing the likelihood of interference?&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Kurt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss in Coded PHY vs 1 Mb PHY</title><link>https://devzone.nordicsemi.com/thread/249183?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 11:58:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:560d8b8a-88a4-4d2c-95b0-55aa4f8a9643</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Kurtis&lt;/p&gt;
&lt;p&gt;Coded PHY is still limited to a data length of 27 bytes per packet. Longer packets than this will cause interference on longer ranges and will have a bigger chance for packet loss than when using 27 bytes or less per packet.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>