nRF52840: Coded PHY connection


Background:
Our tests on SDK 2.5.0 showed that it was possible to maintain a Bluetooth connection at a distance of approximately 180 meters with the following initial advertising settings:

struct bt_le_adv_param param =
BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_CONNECTABLE |
BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CODED,
BT_GAP_ADV_FAST_INT_MIN_2,
BT_GAP_ADV_FAST_INT_MAX_2,
NULL);

err = bt_le_ext_adv_create(&param, NULL, &adv);

We initially counted on a combination of: Extanded Coded PHY scanning / Extended Coded PHY connection (this is on the ESP32s3 side), and Extended Coded PHY advertising (nRF52840).
But we were only able to connect if the connection settings (on the device being scanned) were set to 1M PHY. We then maintained the connection at a distance of up to 180 meters (we have nRF21540 amplifiers on both ends), but if the connection is lost at this distance, reconnection is impossible; the device simply isn't visible during scanning. At a distance of about 100 meters, we can barely connect.

We concluded that we needed to establish a Coded Phy connection, and we supported it on the scanned device.
However, with the above settings, establishing a connection is impossible at even the smallest distance.

For testing, we installed the latest SDK 3.2.1 and used a ready-made example for nRF52840 DK: Bluetooth Extended Advertising Advertiser.

Basic advertising setup:
err = bt_le_ext_adv_create(BT_LE_EXT_ADV_CONN, NULL, &adv);

We replaced it with:
struct bt_le_adv_param param =
BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_CONN |
BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CODED,
BT_GAP_ADV_FAST_INT_MIN_2,
BT_GAP_ADV_FAST_INT_MAX_2,
NULL);
bt_le_ext_adv_create(&param, NULL, &adv);

As a result, we receive an error about the impossibility of accepting these settings:

Failed to create advertising set (err -5)

All this looks as if it is physically impossible to establish a connection via Coded PHY (despite the fact that the description indicates support for this feature).

Please comment on the possibility of establishing a connection via Coded PHY, or confirm that this is only possible with a 1M PHY setup.









  • Hello,

    So if I understand correctly, you are able to use CODED_PHY while in a connection, but you are not able to establish a connection using CODED_PHY?

    Have you tested the sample NCS\nrf\samples\bluetooth\peripheral_hr_coded and central_hr_coded? Can you please test this sample between 2x nRF52840 DKs and verify that this is working? This should use CODED PHY both for advertising and scanning (and in the connection). If that works, then you know that one side of the connection is working as intended. Then you need to look into how/whether the ESP32 is capable of connecting using CODED_PHY for scanning and initiaiting the connection.

    Best regards,

    Edvin

Related