Skip to content

Commit 030470e

Browse files
committed
Merge branch 'ble_dev/esp32c61_chip_20240903' into 'master'
feat(ble): added ble support on esp32c61 Closes IDF-10360, IDF-10362, IDF-10363, and IDF-10365 See merge request espressif/esp-idf!33286
2 parents 1a065dc + bf52e37 commit 030470e

File tree

73 files changed

+258
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+258
-131
lines changed

components/bt/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ endif()
66

77
if(CONFIG_IDF_TARGET_ESP32S3)
88
set(target_name "esp32c3")
9+
elseif(CONFIG_IDF_TARGET_ESP32C61)
10+
set(target_name "esp32c6")
911
else()
1012
set(target_name "${idf_target}")
1113
endif()
@@ -853,6 +855,14 @@ if(CONFIG_BT_ENABLED)
853855
target_link_directories(${COMPONENT_LIB} INTERFACE
854856
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32s3")
855857
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
858+
elseif(CONFIG_IDF_TARGET_ESP32C6)
859+
add_prebuilt_library(libble_app
860+
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c6/libble_app.a")
861+
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
862+
elseif(CONFIG_IDF_TARGET_ESP32C61)
863+
add_prebuilt_library(libble_app
864+
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c61/libble_app.a")
865+
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
856866
elseif(CONFIG_BT_CONTROLLER_ENABLED)
857867
add_prebuilt_library(libble_app "controller/lib_${target_name}/${target_name}-bt-lib/libble_app.a")
858868
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source "$IDF_PATH/components/bt/controller/esp32c6/Kconfig.in"

components/bt/host/nimble/Kconfig.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ config BT_NIMBLE_LOG_LEVEL
6565
config BT_NIMBLE_MAX_CONNECTIONS
6666
int "Maximum number of concurrent connections"
6767
range 1 2 if IDF_TARGET_ESP32C2
68-
range 1 70 if IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32C5
68+
range 1 70 if IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C61
6969
range 1 35 if IDF_TARGET_ESP32H2
7070
range 1 9
7171
default 2 if IDF_TARGET_ESP32C2

components/bt/include/esp32c6/include/esp_bt.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,17 @@ typedef struct {
206206
uint8_t cca_drop_mode; /*!< CCA drop mode */
207207
int8_t cca_low_tx_pwr; /*!< CCA low transmit power */
208208
uint8_t main_xtal_freq; /*!< Main crystal frequency */
209+
#if CONFIG_IDF_TARGET_ESP32C6
209210
uint32_t version_num; /*!< Controller configuration version number */
211+
#endif //CONFIG_IDF_TARGET_ESP32C6
210212
uint8_t cpu_freq_mhz; /*!< CPU frequency in megahertz (MHz) */
211213
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the whitelist for direct advertising */
212214
uint8_t enable_pcl; /*!< Enable power control */
213215
uint8_t csa2_select; /*!< Select CSA#2*/
214216
uint32_t config_magic; /*!< Magic number for configuration validation */
215217
} esp_bt_controller_config_t;
216218

219+
#if CONFIG_IDF_TARGET_ESP32C6
217220
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
218221
.config_version = CONFIG_VERSION, \
219222
.ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE, \
@@ -261,6 +264,54 @@ typedef struct {
261264
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
262265
.config_magic = CONFIG_MAGIC, \
263266
}
267+
#elif CONFIG_IDF_TARGET_ESP32C61
268+
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
269+
.config_version = CONFIG_VERSION, \
270+
.ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE, \
271+
.ble_hci_evt_hi_buf_count = DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT, \
272+
.ble_hci_evt_lo_buf_count = DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT, \
273+
.ble_ll_sync_list_cnt = DEFAULT_BT_LE_MAX_PERIODIC_ADVERTISER_LIST, \
274+
.ble_ll_sync_cnt = DEFAULT_BT_LE_MAX_PERIODIC_SYNCS, \
275+
.ble_ll_rsp_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
276+
.ble_ll_adv_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
277+
.ble_ll_tx_pwr_dbm = BLE_LL_TX_PWR_DBM_N, \
278+
.rtc_freq = RTC_FREQ_N, \
279+
.ble_ll_sca = CONFIG_BT_LE_LL_SCA, \
280+
.ble_ll_scan_phy_number = BLE_LL_SCAN_PHY_NUMBER_N, \
281+
.ble_ll_conn_def_auth_pyld_tmo = BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N, \
282+
.ble_ll_jitter_usecs = BLE_LL_JITTER_USECS_N, \
283+
.ble_ll_sched_max_adv_pdu_usecs = BLE_LL_SCHED_MAX_ADV_PDU_USECS_N, \
284+
.ble_ll_sched_direct_adv_max_usecs = BLE_LL_SCHED_DIRECT_ADV_MAX_USECS_N, \
285+
.ble_ll_sched_adv_max_usecs = BLE_LL_SCHED_ADV_MAX_USECS_N, \
286+
.ble_scan_rsp_data_max_len = DEFAULT_BT_LE_SCAN_RSP_DATA_MAX_LEN_N, \
287+
.ble_ll_cfg_num_hci_cmd_pkts = BLE_LL_CFG_NUM_HCI_CMD_PKTS_N, \
288+
.ble_ll_ctrl_proc_timeout_ms = BLE_LL_CTRL_PROC_TIMEOUT_MS_N, \
289+
.nimble_max_connections = DEFAULT_BT_LE_MAX_CONNECTIONS, \
290+
.ble_whitelist_size = DEFAULT_BT_NIMBLE_WHITELIST_SIZE, \
291+
.ble_acl_buf_size = DEFAULT_BT_LE_ACL_BUF_SIZE, \
292+
.ble_acl_buf_count = DEFAULT_BT_LE_ACL_BUF_COUNT, \
293+
.ble_hci_evt_buf_size = DEFAULT_BT_LE_HCI_EVT_BUF_SIZE, \
294+
.ble_multi_adv_instances = DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, \
295+
.ble_ext_adv_max_size = DEFAULT_BT_LE_EXT_ADV_MAX_SIZE, \
296+
.controller_task_stack_size = NIMBLE_LL_STACK_SIZE, \
297+
.controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
298+
.controller_run_cpu = 0, \
299+
.enable_qa_test = RUN_QA_TEST, \
300+
.enable_bqb_test = RUN_BQB_TEST, \
301+
.enable_tx_cca = DEFAULT_BT_LE_TX_CCA_ENABLED, \
302+
.cca_rssi_thresh = 256 - DEFAULT_BT_LE_CCA_RSSI_THRESH, \
303+
.sleep_en = NIMBLE_SLEEP_ENABLE, \
304+
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
305+
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
306+
.ble_scan_classify_filter_enable = 1, \
307+
.main_xtal_freq = CONFIG_XTAL_FREQ, \
308+
.cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, \
309+
.ignore_wl_for_direct_adv = 0, \
310+
.enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED, \
311+
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
312+
.config_magic = CONFIG_MAGIC, \
313+
}
314+
#endif
264315

265316
/**
266317
* @brief Initialize BT controller to allocate task and other resource.

components/soc/esp32c61/include/soc/Kconfig.soc_caps.in

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ config SOC_GPTIMER_SUPPORTED
2323
bool
2424
default y
2525

26+
config SOC_BT_SUPPORTED
27+
bool
28+
default y
29+
2630
config SOC_USB_SERIAL_JTAG_SUPPORTED
2731
bool
2832
default y
@@ -855,6 +859,38 @@ config SOC_WIFI_MAC_VERSION_NUM
855859
int
856860
default 3
857861

862+
config SOC_BLE_SUPPORTED
863+
bool
864+
default y
865+
866+
config SOC_ESP_NIMBLE_CONTROLLER
867+
bool
868+
default y
869+
870+
config SOC_BLE_50_SUPPORTED
871+
bool
872+
default y
873+
874+
config SOC_BLE_DEVICE_PRIVACY_SUPPORTED
875+
bool
876+
default y
877+
878+
config SOC_BLE_POWER_CONTROL_SUPPORTED
879+
bool
880+
default y
881+
882+
config SOC_BLE_PERIODIC_ADV_ENH_SUPPORTED
883+
bool
884+
default y
885+
886+
config SOC_BLUFI_SUPPORTED
887+
bool
888+
default y
889+
890+
config SOC_BLE_MULTI_CONN_OPTIMIZATION
891+
bool
892+
default y
893+
858894
config SOC_PHY_COMBO_MODULE
859895
bool
860896
default y

components/soc/esp32c61/include/soc/soc_caps.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define SOC_GDMA_SUPPORTED 1
2424
#define SOC_AHB_GDMA_SUPPORTED 1
2525
#define SOC_GPTIMER_SUPPORTED 1
26-
// \#define SOC_BT_SUPPORTED 1
26+
#define SOC_BT_SUPPORTED 1
2727
// \#define SOC_IEEE802154_SUPPORTED 1
2828
#define SOC_USB_SERIAL_JTAG_SUPPORTED 1
2929
#define SOC_ASYNC_MEMCPY_SUPPORTED 1
@@ -461,17 +461,15 @@
461461
#define SOC_WIFI_MAC_VERSION_NUM (3) /*!< Wi-Fi MAC version num is 3 */
462462

463463
/*---------------------------------- Bluetooth CAPS ----------------------------------*/
464-
// \#define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */
465-
// \#define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */
466-
// \#define SOC_ESP_NIMBLE_CONTROLLER (1) /*!< Support BLE EMBEDDED controller V1 */
467-
// \#define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */
468-
// \#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */
469-
// \#define SOC_BLE_POWER_CONTROL_SUPPORTED (1) /*!< Support Bluetooth Power Control */
470-
// \#define SOC_BLE_PERIODIC_ADV_ENH_SUPPORTED (1) /*!< Support For BLE Periodic Adv Enhancements */
471-
// \#define SOC_BLUFI_SUPPORTED (1) /*!< Support BLUFI */
472-
// \#define SOC_BLE_MULTI_CONN_OPTIMIZATION (1) /*!< Support multiple connections optimization */
473-
474-
// \#define SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND (1)
464+
#define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */
465+
// #define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */
466+
#define SOC_ESP_NIMBLE_CONTROLLER (1) /*!< Support BLE EMBEDDED controller V1 */
467+
#define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */
468+
#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */
469+
#define SOC_BLE_POWER_CONTROL_SUPPORTED (1) /*!< Support Bluetooth Power Control */
470+
#define SOC_BLE_PERIODIC_ADV_ENH_SUPPORTED (1) /*!< Support For BLE Periodic Adv Enhancements */
471+
#define SOC_BLUFI_SUPPORTED (1) /*!< Support BLUFI */
472+
#define SOC_BLE_MULTI_CONN_OPTIMIZATION (1) /*!< Support multiple connections optimization */
475473

476474
/*------------------------------------- PHY CAPS -------------------------------------*/
477475
#define SOC_PHY_COMBO_MODULE (1) /*!< Support Wi-Fi, BLE and 15.4*/

docs/doxygen/Doxyfile_esp32c61

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
INPUT += \
22
$(PROJECT_PATH)/components/esp_wifi/include/esp_wifi_he_types.h \
33
$(PROJECT_PATH)/components/esp_wifi/include/esp_wifi_he.h \
4+
$(PROJECT_PATH)/components/bt/include/esp32c6/include/esp_bt.h \

examples/bluetooth/.build-test-rules.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ examples/bluetooth/esp_ble_mesh/wifi_coexist:
111111

112112
examples/bluetooth/esp_hid_host:
113113
disable_test:
114-
- if: IDF_TARGET in ["esp32c2", "esp32c3", "esp32c5", "esp32c6", "esp32h2", "esp32s3"]
114+
- if: IDF_TARGET != "esp32"
115115
temporary: true
116116
reason: temporarily test esp32
117117
disable:
@@ -200,6 +200,10 @@ examples/bluetooth/nimble/blecent:
200200
<<: *bt_default_depends
201201
disable:
202202
- if: SOC_BLE_SUPPORTED != 1
203+
disable_test:
204+
- if: IDF_TARGET in ["esp32c61"]
205+
temporary: true
206+
reason: Not supported yet
203207
depends_components:
204208
- bt
205209
- esp_phy
@@ -248,6 +252,7 @@ examples/bluetooth/nimble/power_save:
248252
<<: *bt_default_depends
249253
disable:
250254
- if: SOC_BLE_SUPPORTED != 1
255+
- if: IDF_TARGET in ["esp32c61"]
251256
depends_components:
252257
- bt
253258
- esp_phy

examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-S3 |
2-
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-S3 |
2+
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- |
33

44
# NimBLE Beacon Example
55

0 commit comments

Comments
 (0)