I can't define an Advertising file larger than 191 bytes, even in Extend.
Here's my code and proj.conf file.
My board is an NRF52840.
main.c
#include <zephyr/kernel.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/gap.h>
#define ADV_DATA_LEN 200
static uint8_t mfg_data[ADV_DATA_LEN];
static struct bt_le_ext_adv *adv;
static const struct bt_data ad[] = {
BT_DATA(BT_DATA_BIG_INFO, mfg_data, sizeof(mfg_data)),
};
struct bt_le_adv_param param_padrao = {
.options = BT_LE_ADV_OPT_EXT_ADV,
.interval_min = BT_GAP_ADV_FAST_INT_MIN_2,
.interval_max = BT_GAP_ADV_FAST_INT_MAX_2,
.peer = NULL,
};
void main(void)
{
int err;
printk("Starting Extended Advertising...\n");
bt_addr_le_t addr = {
.type = BT_ADDR_LE_RANDOM,
.a.val = {0xDE, 0x78, 0x73, 0x4A, 0x31, 0xFB}};
err = bt_id_create(&addr, NULL);
if (err < 0)
{
printk("Failed to create identity (%d)\n", err);
return;
}
printk("IP initialized\n");
err = bt_enable(NULL);
if (err)
{
printk("Bluetooth init failed (err %d)\n", err);
return;
}
printk("Bluetooth initialized\n");
err = bt_le_ext_adv_create(¶m_padrao, NULL, &adv);
if (err)
{
printk("Failed to create adv set (%d)\n", err);
return;
}
err = bt_le_ext_adv_set_data(adv, ad, ARRAY_SIZE(ad), NULL, 0);
if (err)
{
printk("Failed to set adv data (%d)\n", err);
return;
}
err = bt_le_ext_adv_start(adv, BT_LE_EXT_ADV_START_DEFAULT);
if (err)
{
printk("Failed to start adv (%d)\n", err);
return;
}
printk("Extended Advertising started\n");
}
proj.conf
CONFIG_BT_HCI=y CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_EXT_ADV=y #CONFIG_BT_CTLR_ADV_EXT_SUPPORT=y CONFIG_BT_CTLR_ADV_EXT=y CONFIG_BT_PHY_UPDATE=y #CONFIG_BT_CTLR_PHY_CODED=y CONFIG_BT_EXT_ADV_CODING_SELECTION=y CONFIG_BT_CTLR_ADV_DATA_CHAIN=y #CONFIG_HAS_BT_CTLR=y CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=1000 CONFIG_BT_BROADCASTER=y #CONFIG_BT_LL_SW_SPLIT=y
Erro
west build -b nrf52840dk/nrf52840 -p always -- west build: making build dir /media/higo.albuquerque/Dados/dev_others/BLE_Assessment/2_Power_Consumption_Assessment/src/code_05/build pristine -- west build: generating a build system Loading Zephyr default modules (Zephyr base). -- Application: /media/higo.albuquerque/Dados/dev_others/BLE_Assessment/2_Power_Consumption_Assessment/src/code_05 -- CMake version: 3.22.1 -- Found Python3: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3.10") found components: Interpreter -- Cache files will be written to: /home/higo.albuquerque/.cache/zephyr -- Zephyr version: 4.3.0 (/home/higo.albuquerque/zephyr_ws/zephyr) -- Found west (found suitable version "1.5.0", minimum required is "0.14.0") -- Board: nrf52840dk, qualifiers: nrf52840 -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK -- Found host-tools: zephyr 0.16.4 (/home/higo.albuquerque/zephyr-sdk-0.16.4) -- Found toolchain: zephyr 0.16.4 (/home/higo.albuquerque/zephyr-sdk-0.16.4) -- Found Dtc: /home/higo.albuquerque/zephyr-sdk-0.16.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") -- Found BOARD.dts: /home/higo.albuquerque/zephyr_ws/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840.dts -- Generated zephyr.dts: /media/higo.albuquerque/Dados/dev_others/BLE_Assessment/2_Power_Consumption_Assessment/src/code_05/build/zephyr/zephyr.dts -- Generated pickled edt: /media/higo.albuquerque/Dados/dev_others/BLE_Assessment/2_Power_Consumption_Assessment/src/code_05/build/zephyr/edt.pickle -- Generated devicetree_generated.h: /media/higo.albuquerque/Dados/dev_others/BLE_Assessment/2_Power_Consumption_Assessment/src/code_05/build/zephyr/include/generated/zephyr/devicetree_generated.h warning: BT_CTLR_ADV_DATA_LEN_MAX (defined at subsys/bluetooth/controller/Kconfig:765) was assigned the value '1000' but got the value '31'. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_CTLR_ADV_DATA_LEN_MAX and/or look up BT_CTLR_ADV_DATA_LEN_MAX in the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too. warning: BT_CTLR_ADV_DATA_CHAIN (defined at subsys/bluetooth/controller/Kconfig.ll_sw_split:381) was assigned the value 'y' but got the value 'n'. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_CTLR_ADV_DATA_CHAIN and/or look up BT_CTLR_ADV_DATA_CHAIN in the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too. warning: user value 1000 on the int symbol BT_CTLR_ADV_DATA_LEN_MAX (defined at subsys/bluetooth/controller/Kconfig:765) ignored due to being outside the active range ([31, 191]) -- falling back on defaults Parsing /home/higo.albuquerque/zephyr_ws/zephyr/Kconfig Loaded configuration '/home/higo.albuquerque/zephyr_ws/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig' Merged configuration '/media/higo.albuquerque/Dados/dev_others/BLE_Assessment/2_Power_Consumption_Assessment/src/code_05/prj.conf' error: Aborting due to Kconfig warnings CMake Error at /home/higo.albuquerque/zephyr_ws/zephyr/cmake/modules/kconfig.cmake:393 (message): command failed with return code: 1 Call Stack (most recent call first): /home/higo.albuquerque/zephyr_ws/zephyr/cmake/modules/zephyr_default.cmake:131 (include) /home/higo.albuquerque/zephyr_ws/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include) /home/higo.albuquerque/zephyr_ws/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate) CMakeLists.txt:4 (find_package) -- Configuring incomplete, errors occurred! FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/usr/bin/python3 -B/media/higo.albuquerque/Dados/dev_others/BLE_Assessment/2_Power_Consumption_Assessment/src/code_05/build -GNinja -DBOARD=nrf52840dk/nrf52840 -S/media/higo.albuquerque/Dados/dev_others/BLE_Assessment/2_Power_Consumption_Assessment/src/code_05