<?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>Coded PHY for blinky peripheral and central</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75549/coded-phy-for-blinky-peripheral-and-central</link><description>nRF52840 DKs with SDK 17.0.2, SoftDevice 7.2.0 
 
 The resources on this are starting to get a little scattered and possibly outdated. My long range use case is non-scannable, connectable blinky example without having to switch to 1MBPs to connect. Since</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 May 2021 13:36:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75549/coded-phy-for-blinky-peripheral-and-central" /><item><title>RE: Coded PHY for blinky peripheral and central</title><link>https://devzone.nordicsemi.com/thread/312138?ContentTypeID=1</link><pubDate>Thu, 27 May 2021 13:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6132892f-b17a-419d-82ac-b25344bc1fb1</guid><dc:creator>SRall</dc:creator><description>&lt;p&gt;Hey Vidar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After some debugging I was able to resolve this behavior that was caused by an unrelated bug. Successfully able to make connections in CODED PHY now with the parameters you listed in your reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Many Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coded PHY for blinky peripheral and central</title><link>https://devzone.nordicsemi.com/thread/311663?ContentTypeID=1</link><pubDate>Wed, 26 May 2021 07:53:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01d15d96-f272-4b78-af12-d67b4600f435</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I left the scan paramaters unchanged, but you are free to adjust these if you want. The trade-off is discovery time vs power consumption.&lt;/p&gt;
[quote user="SRall"]I&amp;#39;m getting sporadic behavior from the DKs. They are constantly connecting and disconnecting[/quote]
&lt;p&gt;This could be a symptom of an assertion in your code. Are you able to debug the multilink project and see if the program ends up in the app error handler function (see &lt;span&gt;&lt;a title="Error module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_error.html?cp=7_1_3_13"&gt;Error module&lt;/a&gt;&lt;/span&gt;)?&lt;/p&gt;
&lt;p&gt;Debugging with Assert with SES&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1622015587810v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coded PHY for blinky peripheral and central</title><link>https://devzone.nordicsemi.com/thread/311514?ContentTypeID=1</link><pubDate>Tue, 25 May 2021 14:03:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58b19b1a-a6a8-483d-8ff3-520d7d492968</guid><dc:creator>SRall</dc:creator><description>&lt;p&gt;Thank you Vidar! This is great, I will sift through these later today. I can already see where I went wrong. Curious though, what would values be for&amp;nbsp;NRF_BLE_SCAN_SCAN_INTERVAL, WINDOW, and DURATION? Are they unchanged from the default values the SDK gives?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;UPDATED: After making sure the above parameters were set correctly, I&amp;#39;m getting sporadic behavior from the DKs. They are constantly connecting and disconnecting. Apologies for not mentioning earlier but my central device is using the multilink example but configured for long range per diff file you sent. Could this behavior be cause by something in the multilink_c example? My only other thought is a difference from SDK 16 to 17 that is disrupting the long range configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your help is much appreciated.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coded PHY for blinky peripheral and central</title><link>https://devzone.nordicsemi.com/thread/311301?ContentTypeID=1</link><pubDate>Tue, 25 May 2021 06:52:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6586705-b83d-47b2-988e-a603b2a106e6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Sam,&lt;/p&gt;
&lt;p&gt;Yes, you can establish a connection with CODED PHY.&amp;nbsp; Please go over the &amp;#39;diff&amp;#39; file below and let me know if you have done anything differently in your two projects. The diff is from a CODED PHY version of the blinky projects I made with SDK 16 a while ago.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;diff --git a/examples/ble_central/ble_app_blinky_c_coded_phy/main.c b/examples/ble_central/ble_app_blinky_c_coded_phy/main.c
index 1b6a63a..788c3b9 100644
--- a/examples/ble_central/ble_app_blinky_c_coded_phy/main.c
+++ b/examples/ble_central/ble_app_blinky_c_coded_phy/main.c
@@ -459,13 +459,25 @@ static void power_management_init(void)
 
 static void scan_init(void)
 {
-    ret_code_t          err_code;
+    ret_code_t err_code;
     nrf_ble_scan_init_t init_scan;
+    ble_gap_scan_params_t params;
+
+    memset(&amp;amp;params, 0, sizeof(params));
+
+    params.active  = 1;
+    params.interval = NRF_BLE_SCAN_SCAN_INTERVAL;
+    params.window = NRF_BLE_SCAN_SCAN_WINDOW;
+    params.timeout = NRF_BLE_SCAN_SCAN_DURATION;
+    params.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL;
+    params.scan_phys = NRF_BLE_SCAN_SCAN_PHY;
+    params.extended = true;
 
     memset(&amp;amp;init_scan, 0, sizeof(init_scan));
 
     init_scan.connect_if_match = true;
     init_scan.conn_cfg_tag     = APP_BLE_CONN_CFG_TAG;
+    init_scan.p_scan_param     = &amp;amp;params;
 
     err_code = nrf_ble_scan_init(&amp;amp;m_scan, &amp;amp;init_scan, scan_evt_handler);
     APP_ERROR_CHECK(err_code);
@@ -501,6 +513,8 @@ static void idle_state_handle(void)
 
 int main(void)
 {
+    uint32_t err_code; 
+
     // Initialize.
     log_init();
     timer_init();
@@ -512,6 +526,10 @@ int main(void)
     gatt_init();
     db_discovery_init();
     lbs_c_init();
+    
+    /* Optional: set max tx output power */
+    err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, 0, 8); 
+    APP_ERROR_CHECK(err_code);
 
     // Start execution.
     NRF_LOG_INFO(&amp;quot;Blinky CENTRAL example started.&amp;quot;);
@@ -525,4 +543,4 @@ int main(void)
     {
         idle_state_handle();
     }
-}
+}
\ No newline at end of file
diff --git a/examples/ble_central/ble_app_blinky_c_coded_phy/pca10056/s140/config/sdk_config.h b/examples/ble_central/ble_app_blinky_c_coded_phy/pca10056/s140/config/sdk_config.h
index 07e9848..9a06666 100644
--- a/examples/ble_central/ble_app_blinky_c_coded_phy/pca10056/s140/config/sdk_config.h
+++ b/examples/ble_central/ble_app_blinky_c_coded_phy/pca10056/s140/config/sdk_config.h
@@ -154,7 +154,7 @@
 #endif
 // &amp;lt;o&amp;gt; NRF_BLE_SCAN_BUFFER - Data length for an advertising set. 
 #ifndef NRF_BLE_SCAN_BUFFER
-#define NRF_BLE_SCAN_BUFFER 31
+#define NRF_BLE_SCAN_BUFFER 1650
 #endif
 
 // &amp;lt;o&amp;gt; NRF_BLE_SCAN_NAME_MAX_LEN - Maximum size for the name to search in the advertisement report. 
@@ -211,7 +211,7 @@
 // &amp;lt;255=&amp;gt; BLE_GAP_PHY_NOT_SET 
 
 #ifndef NRF_BLE_SCAN_SCAN_PHY
-#define NRF_BLE_SCAN_SCAN_PHY 1
+#define NRF_BLE_SCAN_SCAN_PHY 4
 #endif
 
 // &amp;lt;e&amp;gt; NRF_BLE_SCAN_FILTER_ENABLE - Enabling filters for the Scanning Module.

 
 // &amp;lt;q&amp;gt; NRF_FPRINTF_DOUBLE_ENABLED  - Enable IEEE-754 double precision formatting.
@@ -7735,7 +7735,7 @@
 // &amp;lt;e&amp;gt; NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
 //==========================================================
 #ifndef NRF_LOG_BACKEND_RTT_ENABLED
-#define NRF_LOG_BACKEND_RTT_ENABLED 0
+#define NRF_LOG_BACKEND_RTT_ENABLED 1
 #endif
 // &amp;lt;o&amp;gt; NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. 
 // &amp;lt;i&amp;gt; Size of the buffer is a trade-off between RAM usage and processing.
diff --git a/examples/ble_peripheral/ble_app_blinky_coded_phy/main.c b/examples/ble_peripheral/ble_app_blinky_coded_phy/main.c
index c698a48..fa89d59 100644
--- a/examples/ble_peripheral/ble_app_blinky_coded_phy/main.c
+++ b/examples/ble_peripheral/ble_app_blinky_coded_phy/main.c
@@ -103,9 +103,8 @@ NRF_BLE_QWR_DEF(m_qwr);
 
 static uint16_t m_conn_handle = BLE_CONN_HANDLE_INVALID;                        /**&amp;lt; Handle of the current connection. */
 
-static uint8_t m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;                   /**&amp;lt; Advertising handle used to identify an advertising set. */
-static uint8_t m_enc_advdata[BLE_GAP_ADV_SET_DATA_SIZE_MAX];                    /**&amp;lt; Buffer for storing an encoded advertising set. */
-static uint8_t m_enc_scan_response_data[BLE_GAP_ADV_SET_DATA_SIZE_MAX];         /**&amp;lt; Buffer for storing an encoded scan data. */
+static uint8_t m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;                                      /**&amp;lt; Advertising handle used to identify an advertising set. */
+static uint8_t m_enc_advdata[BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED];         /**&amp;lt; Buffer for storing an encoded scan data. */
 
 /**@brief Struct that contains pointers to the encoded advertising data. */
 static ble_gap_adv_data_t m_adv_data =
@@ -113,12 +112,12 @@ static ble_gap_adv_data_t m_adv_data =
     .adv_data =
     {
         .p_data = m_enc_advdata,
-        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
+        .len    = BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED
     },
     .scan_rsp_data =
     {
-        .p_data = m_enc_scan_response_data,
-        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
+        .p_data = NULL,
+        .len    = 0
 
     }
 };
@@ -223,29 +222,30 @@ static void advertising_init(void)
 
 
     memset(&amp;amp;srdata, 0, sizeof(srdata));
-    srdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
-    srdata.uuids_complete.p_uuids  = adv_uuids;
+    advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
+    advdata.uuids_complete.p_uuids  = adv_uuids;
 
     err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
     APP_ERROR_CHECK(err_code);
 
-    err_code = ble_advdata_encode(&amp;amp;srdata, m_adv_data.scan_rsp_data.p_data, &amp;amp;m_adv_data.scan_rsp_data.len);
-    APP_ERROR_CHECK(err_code);
-
     ble_gap_adv_params_t adv_params;
 
     // Set advertising parameters.
     memset(&amp;amp;adv_params, 0, sizeof(adv_params));
 
-    adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
+    adv_params.primary_phy     = BLE_GAP_PHY_CODED;
+    adv_params.secondary_phy   = BLE_GAP_PHY_CODED;
     adv_params.duration        = APP_ADV_DURATION;
-    adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
+    adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
     adv_params.p_peer_addr     = NULL;
     adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
     adv_params.interval        = APP_ADV_INTERVAL;
 
     err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;adv_params);
     APP_ERROR_CHECK(err_code);
+    /* Optional: set max tx output power */
+    err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_adv_handle, 8);
+    APP_ERROR_CHECK(err_code);
 }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>