This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error setting extended and coded advertising on dongle. Uart example.

Hi everybody,

I get this error trying to set coded_phy advertising on nrf52840 dongle. This is the code that i try.

static void start_advertising_coded(struct k_work *item)
{
	int err;
        

        //set_tx_power(BT_HCI_VS_LL_HANDLE_TYPE_ADV,
        //                     0, +8);

	err = bt_le_ext_adv_start(adv, NULL);
	if (err) {
		printk("Failed to start advertising set (%d)\n", err);
                NVIC_SystemReset();
		return;
	}

	//printk("Advertiser %p set started\n", adv);
}

static int create_advertising_coded(void)
{
	int err;
	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_LE_ADV_OPT_USE_TX_POWER,
				     BT_GAP_ADV_FAST_INT_MIN_2,
				     BT_GAP_ADV_FAST_INT_MAX_2,
				     NULL);


	err = bt_le_ext_adv_create(&param, NULL, &adv);
	if (err) {
		printk("Failed to create advertiser set (%d)\n", err);
		return err;
	}

	//printk("Created adv: %p\n", adv);

	err = bt_le_ext_adv_set_data(adv, ad, ARRAY_SIZE(ad), NULL, 0);
	if (err) {
		printk("Failed to set advertising data (%d)\n", err);
		return err;
	}

	return 0;
}


static void bt_ready(void)
{
	int err = 0;

	//printk("Bluetooth initialized\n");

	k_work_init(&start_advertising_worker, start_advertising_coded);

	err = create_advertising_coded();
	if (err) {
		printk("Advertising failed to create (err %d)\n", err);
		return;
	}

	k_work_submit(&start_advertising_worker);
}

The error that i get is:

That means  I/O error, which i am not able to understand what means.

The Kconfig that i appy is:

config BT_EXT_ADV
    bool "Extended Advertising and Scanning support"
    depends on BT_HCI && BT
    help
      Select this to enable Extended Advertising API support.
      This enables support for advertising with multiple advertising sets,
      extended advertising data, and advertising on LE Coded PHY.
      It enables support for receiving extended advertising data as a
      scanner, including support for advertising data over the LE coded PHY.
      It enables establishing connections over LE Coded PHY

config BT_DEVICE_NAME
    string "Bluetooth device name"
    default "Uart_periph1"
    depends on BT_HCI_HOST && BT_HCI && BT
    help
      Bluetooth device name. Name can be up to 248 bytes long (excluding
      NULL termination). Can be empty string.

config BT_PHY_UPDATE
    bool "PHY Update"
    default y
    depends on BT_CONN && BT_HCI && BT
    help
      Enable support for Bluetooth 5.0 PHY Update Procedure.

config BT_USER_PHY_UPDATE
    bool "User control of PHY Update Procedure"
    depends on BT_PHY_UPDATE && BT_CONN && BT_HCI_HOST && BT_HCI && BT
    help
      Enable application access to initiate the PHY Update Procedure.
      The application can also register a callback to be notified about PHY
      changes on the connection. The current PHY info is available in the
      connection info.

The exactly same code and exactly the same Kconfig is working on a nrf52840k

Some ideas on why this error occurs??

All is working on 1.7sdk with the last nrf connect version.

is an device specific issue or you can reproduce it?

Parents Reply Children
No Data
Related