Extended adverts bt_le_ext_adv_create error

Hi,

I am trying to enable extended adverts, when the call to bt_le_ext_adv_create is made, it always returns:

Using the following code:

#define BT_UUID_INTERCALL_P_VAL \
	BT_UUID_128_ENCODE(0xf3641400, 0x00b0, 0x4240, 0xba50, 0x05ca45bf8abc)

static struct bt_le_ext_adv *ext_adv;
static const struct bt_le_adv_param connectable_adv_param =
	BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_USE_NAME,
			BT_GAP_ADV_FAST_INT_MIN_2, /* 100 ms */
			BT_GAP_ADV_FAST_INT_MAX_2, /* 150 ms */
			NULL);

static const struct bt_data ext_ad[] = {
	BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
	BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_INTERCALL_P_VAL),
};

static int connectable_adv_create(void)
{
	int err;

	err = bt_set_name(DEVICE_NAME);
	if (err) {
		printk("Failed to set device name (err %d)\n", err);
		return err;
	}

	err = bt_le_ext_adv_create(&connectable_adv_param, &adv_cb, &ext_adv);
	if (err) {
		printk("Failed to create adv (err %d)\n", err);
		return err;
	}

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

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

	return bt_le_ext_adv_start(ext_adv, BT_LE_EXT_ADV_START_DEFAULT);
}

My custom service has the following init:

/* Intercall Peripheral Service Declaration */
BT_GATT_SERVICE_DEFINE(intercall_p_svc,
BT_GATT_PRIMARY_SERVICE(BT_UUID_INTERCALL_P),

	BT_GATT_CHARACTERISTIC(BT_UUID_INTERCALL_P_CALLPOINT,
			       BT_GATT_CHRC_READ | BT_GATT_CHRC_WRITE,
			       BT_GATT_PERM_READ | BT_GATT_PERM_WRITE,
			       read_callpoint, write_callpoint, &callpoint_data),
	BT_GATT_CCC(intercall_p_callpoint_ccc_cfg_changed,
		    BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
	
	BT_GATT_CHARACTERISTIC(BT_UUID_INTERCALL_P_NETWORK,
			       BT_GATT_CHRC_READ | BT_GATT_CHRC_WRITE,
			       BT_GATT_PERM_READ | BT_GATT_PERM_WRITE,
			       read_network, write_network, &network_data),
	BT_GATT_CCC(intercall_p_network_ccc_cfg_changed,
		    BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
	
	BT_GATT_CHARACTERISTIC(BT_UUID_INTERCALL_P_TEXTUAL,
			       BT_GATT_CHRC_READ | BT_GATT_CHRC_WRITE,
			       BT_GATT_PERM_READ | BT_GATT_PERM_WRITE,
			       read_textual, write_textual, &textual_data),
);

My prj.conf

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="Intercall"
CONFIG_BT_DEVICE_APPEARANCE=512
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_EXT_ADV=y


# CONFIG_BT_DIS=y
# CONFIG_BT_DIS_PNP=y
# CONFIG_BT_DIS_MANUF="Lismore Instruments Ltd"
# CONFIG_BT_DIS_PNP_VID_SRC=1
# CONFIG_BT_DIS_PNP_VID=0x095B
# CONFIG_BT_DIS_PNP_PID=0x0103
# CONFIG_BT_DIS_PNP_VER=0x0100

# Enable the LBS service
CONFIG_BT_LBS=n

CONFIG_DK_LIBRARY=y

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Config logger
CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_PRINTK=y

CONFIG_ASSERT=y
CONFIG_ASSERT_NO_COND_INFO=y
CONFIG_ASSERT_NO_MSG_INFO=y
CONFIG_HW_STACK_PROTECTION=y

CONFIG_BT_LBS_SECURITY_ENABLED=n

If using normal adverts, everything works fine.

Apart from using 128bit UUID, i cant see a difference between this code and examples found in the direction finder or hr samples

Are you able to shed some light on what i need to do?

Thanks

Parents
  • Hi Billy

    Have you set the configs in a child_image folder as well? You can refer to the peripheral_hr_coded sample project to see how it is done there.

    Best regards,

    Simon

  • Hi Simon,

    Yes, sorry i should have included this.

    My project is derived from the peripheral_lbs sample, so when i look in the explorer i have a

    child_image\hci_rpmsg\boards\thingy53_nrf5340_cpunet.conf

    file, i have copied the three lines from the periperhal_hr_coded file

    peripheral_hr_coded\child_image\hci_rpmsg.conf

    so now my child_image conf file looks like this:

    CONFIG_RPMSG_SERVICE=y
    CONFIG_RPMSG_SERVICE_MODE_REMOTE=y

    CONFIG_HEAP_MEM_POOL_SIZE=8192

    CONFIG_MAIN_STACK_SIZE=512
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
    CONFIG_BT=y
    CONFIG_BT_HCI_RAW=y
    CONFIG_BT_MAX_CONN=10
    CONFIG_BT_CTLR_ASSERT_HANDLER=y
    CONFIG_BT_HCI_RAW_RESERVE=1
    CONFIG_BT_BUF_CMD_TX_COUNT=10

    # Increase maximum data length of PDU supported in the Controller
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_BUF_ACL_RX_SIZE=502

    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_ADV_EXT=y
    # CONFIG_BT_CTLR_PHY_CODED=y

    But it did not help

    Im assuming this is the correct file?

Reply
  • Hi Simon,

    Yes, sorry i should have included this.

    My project is derived from the peripheral_lbs sample, so when i look in the explorer i have a

    child_image\hci_rpmsg\boards\thingy53_nrf5340_cpunet.conf

    file, i have copied the three lines from the periperhal_hr_coded file

    peripheral_hr_coded\child_image\hci_rpmsg.conf

    so now my child_image conf file looks like this:

    CONFIG_RPMSG_SERVICE=y
    CONFIG_RPMSG_SERVICE_MODE_REMOTE=y

    CONFIG_HEAP_MEM_POOL_SIZE=8192

    CONFIG_MAIN_STACK_SIZE=512
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
    CONFIG_BT=y
    CONFIG_BT_HCI_RAW=y
    CONFIG_BT_MAX_CONN=10
    CONFIG_BT_CTLR_ASSERT_HANDLER=y
    CONFIG_BT_HCI_RAW_RESERVE=1
    CONFIG_BT_BUF_CMD_TX_COUNT=10

    # Increase maximum data length of PDU supported in the Controller
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_BUF_ACL_RX_SIZE=502

    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_ADV_EXT=y
    # CONFIG_BT_CTLR_PHY_CODED=y

    But it did not help

    Im assuming this is the correct file?

Children
No Data
Related