diff --git a/components/bt/controller/esp32c3/Kconfig.in b/components/bt/controller/esp32c3/Kconfig.in index 6f6c4d549c8..cd6c59fd3bf 100644 --- a/components/bt/controller/esp32c3/Kconfig.in +++ b/components/bt/controller/esp32c3/Kconfig.in @@ -2,6 +2,15 @@ config BT_CTRL_MODE_EFF int default 1 +config BT_CTRL_CHECK_CONFIG_EFF + int + default 1 + help + Marker that controller Kconfig is active (always set in sdkconfig). + Must not be unset in normal IDF builds. Controller-only integrations + that do not export this symbol rely on esp_bt.h to apply compile-time + defaults for missing BLE feature CONFIG_* names. + config BT_CTRL_BLE_MAX_ACT int "BLE Max Instances" default 6 diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index 32de734522b..3cd8a140569 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -1866,6 +1866,11 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) ESP_LOGI(BT_LOG_TAG, "BT controller compile version [%s]", btdm_controller_get_compile_version()); +#ifndef CONFIG_BT_CTRL_CHECK_CONFIG_EFF + ESP_LOGW(BT_LOG_TAG, "CONFIG_BT_CTRL_CHECK_CONFIG_EFF is not defined; " + "using compile-time default BLE controller feature options"); +#endif + #if (CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) ESP_LOGI(BT_LOG_TAG,"Put all controller code in flash"); #endif diff --git a/components/bt/include/esp32c3/include/esp_bt.h b/components/bt/include/esp32c3/include/esp_bt.h index c997e2bf666..6dfb46d83ba 100644 --- a/components/bt/include/esp32c3/include/esp_bt.h +++ b/components/bt/include/esp32c3/include/esp_bt.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -268,7 +268,21 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); #define BT_CTRL_RUN_IN_FLASH_ONLY (0) #endif - +/* + * Only when CONFIG_BT_CTRL_CHECK_CONFIG_EFF is absent: this build does not + * run controller Kconfig, so missing CONFIG_BT_CTRL_BLE_* means "use default", + * not "disabled". When the symbol is defined (normal IDF sdkconfig), Kconfig + * is authoritative: bool=n leaves CONFIG_BT_CTRL_BLE_* undefined and must + * not be overridden here. + */ +#ifndef CONFIG_BT_CTRL_CHECK_CONFIG_EFF +#define CONFIG_BT_CTRL_BLE_ADV 1 +#define CONFIG_BT_CTRL_BLE_SCAN 1 +#define CONFIG_BT_CTRL_DTM_ENABLE 1 +#define CONFIG_BT_CTRL_BLE_MASTER 1 +#define CONFIG_BT_CTRL_BLE_SECURITY_ENABLE 1 +#define CONFIG_BT_CTRL_BLE_MIN_CONN_INTERVAL_ENABLE 1 +#endif /* !CONFIG_BT_CTRL_CHECK_CONFIG_EFF */ #if defined(CONFIG_BT_CTRL_DTM_ENABLE) #define BT_CTRL_DTM_ENABLE CONFIG_BT_CTRL_DTM_ENABLE