BLE 5 advertising does not permit iOS 17 devices to connect.

Hi,

I am using nRF52840, and have set up BLE 5 advertising. I was able to connect with the nRF Connect app to nrf52840 device using iPhone 11, 12, 13 running iOS 16.

Recently after updating to iOS 17, I can only discover the BLE device, but can't manage to connect to the device from the app. I can only connect to the device via iPhone 11, running iOS 17. However, all the other later versions of iPhone do not permit me to connect with the nrf device. As a test switching to BLE4 advertising, devices are both discoverable and connectable, on these same iPhone versions running iOS 17. I need to use BLE5 and can't switch to BLE 4 for production release.

Also, the same devices can be both discovered and connected to, using Android phones that support BLE 5.

No log data shows up on nRF Connect app, hence making it hard to debug the issue.

Has anyone else faced this issue? Any pointers/ tips are appreciated.

Parents
  • I am using extended advertising which is BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED (238 bytes) from SDK. The advertisement itself is seen and shows up with the right data on nRF connect app.

    Now, since the device is connectable, pressing connect, there is no log output on nRF connect app (it just feels like it's trying to connect forever with the rotating wheel). However, on the FW side, I receive events in the evt_handler, first connect (that is handled) and immediately afterward it receives disconnect evt (which is also handled). It tries this connect and disconnect a few times before calling quits and failing to connect. I am kinda blind from the app side if some event isn't handled.
    Nope, I haven't tried a sniffer. 
  • I see. Can you you share logs from the nRF side and nRF Connect, as well as make a sniffer trace? You can use the nRF Sniffer for Bluetooth LE for that as long as you have an nRF DK or dongle.

  • Hi,

    Thank you for the sniffer traces. The phone sends the connection request, and then nothing. I am checking with our mobile developers to see if they have any ideas about what could be happening on the iPhone side here.

    Can you share the code you have that configures advertising so that we can test the exact same on our end?

  • Hi, thanks for your reply, the APP_ ADV_INTERVAL is 1022.5 ms. The advertising parameters are as follows:

    void ble_advertise_init()
    {
        uint32_t ret;
    
        static ble_advdata_t advdata;
    
        ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, ble_xbus_service.uuid_type}};
    
        // Build and set advertising data
        memset(&advdata, 0, sizeof(advdata));
    
        advdata.name_type = BLE_ADVDATA_FULL_NAME;
        advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
        advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
        advdata.uuids_complete.p_uuids = adv_uuids;
    
        update_adv_data();
        advdata.p_manuf_specific_data = &manuf_data;
    
        m_adv_data.adv_data.len =
            BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED;
    
        ret = ble_advdata_encode(
            &advdata,
            m_adv_data.adv_data.p_data,
            &m_adv_data.adv_data.len);
        if (ret != NRF_SUCCESS) {
            PRINTF("ERROR[%lu]: ble_advdata_encode()\n", ret);
        }
    
        ble_gap_adv_params_t adv_params;
    
        // Set advertising parameters.
        memset(&adv_params, 0, sizeof(adv_params));
    
        adv_params.primary_phy = BLE_GAP_PHY_1MBPS;
        adv_params.secondary_phy = BLE_GAP_PHY_2MBPS;
        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;
    
        ret = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &adv_params);
        if (ret != NRF_SUCCESS) {
            PRINTF("ERROR[%lu]: sd_ble_gap_adv_set_configure()\n", ret);
        }
    
    }

  • Thanks. I tested this now, with the LBS sample from SDK 17.1.0 with these changes:

    diff --git a/examples/ble_peripheral/ble_app_blinky/main.c b/examples/ble_peripheral/ble_app_blinky/main.c
    index 8e26160..b736320 100644
    --- a/examples/ble_peripheral/ble_app_blinky/main.c
    +++ b/examples/ble_peripheral/ble_app_blinky/main.c
    @@ -79,7 +79,7 @@
     #define APP_BLE_OBSERVER_PRIO           3                                       /**< Application's BLE observer priority. You shouldn't need to modify this value. */
     #define APP_BLE_CONN_CFG_TAG            1                                       /**< A tag identifying the SoftDevice BLE configuration. */
     
    -#define APP_ADV_INTERVAL                64                                      /**< The advertising interval (in units of 0.625 ms; this value corresponds to 40 ms). */
    +#define APP_ADV_INTERVAL                1636                                      /**< The advertising interval (in units of 0.625 ms; this value corresponds to 40 ms). */
     #define APP_ADV_DURATION                BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED   /**< The advertising time-out (in units of seconds). When set to 0, we will never time out. */
     
     
    @@ -117,8 +117,8 @@ static ble_gap_adv_data_t m_adv_data =
         },
         .scan_rsp_data =
         {
    -        .p_data = m_enc_scan_response_data,
    -        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
    +        .p_data = NULL,
    +        .len    = 0
     
         }
     };
    @@ -210,7 +210,6 @@ static void advertising_init(void)
     {
         ret_code_t    err_code;
         ble_advdata_t advdata;
    -    ble_advdata_t srdata;
     
         ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, m_lbs.uuid_type}};
     
    @@ -221,25 +220,18 @@ static void advertising_init(void)
         advdata.include_appearance = true;
         advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
     
    -
    -    memset(&srdata, 0, sizeof(srdata));
    -    srdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    -    srdata.uuids_complete.p_uuids  = adv_uuids;
    -
         err_code = ble_advdata_encode(&advdata, m_adv_data.adv_data.p_data, &m_adv_data.adv_data.len);
         APP_ERROR_CHECK(err_code);
     
    -    err_code = ble_advdata_encode(&srdata, m_adv_data.scan_rsp_data.p_data, &m_adv_data.scan_rsp_data.len);
    -    APP_ERROR_CHECK(err_code);
    -
         ble_gap_adv_params_t adv_params;
     
         // Set advertising parameters.
         memset(&adv_params, 0, sizeof(adv_params));
     
         adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
    +    adv_params.secondary_phy   = BLE_GAP_PHY_2MBPS;
         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;
    
    I have no problems connecting to is using an iPhone 15 Pro with iOS 17.2. Could it be that it was fixed in the latest iOS update, or do you still see this issue with iOS 17.2?

  • Still have the issue on iPhone 12, 13,14 running iOS 17.2

  • I see. Can you test the LBS sample in the SDK with just the changes below and confirm if you see the issue then, just so we know there is no problem with the way I am testing?

Reply Children
Related