Skip to content

ble: esp32c2: Add support #93328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boards/espressif/esp8684_devkitm/esp8684_devkitm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@
&wifi {
status = "okay";
};

&esp32_bt_hci {
status = "okay";
};
10 changes: 5 additions & 5 deletions drivers/bluetooth/hci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ config BT_ESP32
select BT_CTLR_PRIVACY_SUPPORT
select BT_CTLR_EXT_SCAN_FP_SUPPORT
select BT_CTLR_DATA_LEN_UPDATE_SUPPORT
select BT_CTLR_ADV_EXT_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_PHY_UPDATE_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_EXT_REJ_IND_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_PHY_2M_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_CHAN_SEL_2_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_ADV_EXT_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_PHY_UPDATE_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_EXT_REJ_IND_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_PHY_2M_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
select BT_CTLR_CHAN_SEL_2_SUPPORT if SOC_SERIES_ESP32S3 || SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32C6
help
Espressif HCI bluetooth interface

Expand Down
24 changes: 18 additions & 6 deletions drivers/bluetooth/hci/Kconfig.esp32
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2024 Espressif Systems (Shanghai) PTE LTD
# Copyright 2024-2025 Espressif Systems (Shanghai) PTE LTD

if BT_ESP32

config HEAP_MEM_POOL_ADD_SIZE_ESP_BT
int
default 50000 if SOC_SERIES_ESP32C6
default 50000 if SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C6
default 25600
default 0
help
Expand Down Expand Up @@ -269,7 +269,7 @@ config ESP32_BT_CTLR_COEX_PHY_CODED_TX_RX_TLIM_EFF

endmenu # ESP32 Bluetooth Controller Configuration

if SOC_SERIES_ESP32C6
if SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C6

menu "Espressif HCI Config"

Expand Down Expand Up @@ -348,7 +348,8 @@ endif
config ESP32_BT_LE_MAX_PERIODIC_SYNCS
int "Maximum periodic advertising syncs"
depends on ESP32_BT_LE_50_FEATURE_SUPPORT
range 0 8
range 0 3 if SOC_SERIES_ESP32C2
range 0 8 if SOC_SERIES_ESP32C6
default 1 if ESP32_BT_LE_ENABLE_PERIODIC_ADV
default 0
help
Expand All @@ -364,6 +365,7 @@ config ESP32_BT_LE_MAX_PERIODIC_ADVERTISER_LIST

config ESP32_BT_LE_POWER_CONTROL_ENABLED
bool "Controller BLE power control"
depends on SOC_SERIES_ESP32C6
depends on ESP32_BT_LE_50_FEATURE_SUPPORT
help
Allow controller to adjust transmit power based on link quality.
Expand Down Expand Up @@ -533,8 +535,10 @@ config ESP32_BT_LE_LL_PEER_SCA

config ESP32_BT_LE_MAX_CONNECTIONS
int "Max concurrent connections"
range 1 70
default 3
range 1 2 if SOC_SERIES_ESP32C2
range 1 70 if SOC_SERIES_ESP32C6
default 2 if SOC_SERIES_ESP32C2
default 3 if SOC_SERIES_ESP32C6
help
Maximum number of BLE connections. Each uses ~1 KB of DRAM.

Expand Down Expand Up @@ -586,6 +590,8 @@ config ESP32_BT_LE_USE_ESP_TIMER
help
Use high-priority esp-timer for controller callouts.

if SOC_SERIES_ESP32C6

config ESP32_BT_LE_SCAN_DUPL
bool "BLE scan duplicate filtering"
default y
Expand Down Expand Up @@ -638,6 +644,8 @@ config ESP32_BT_LE_MSYS_INIT_IN_CONTROLLER
help
Allocate MSYS mbufs within the controller instead of the host.

endif # SOC_SERIES_ESP32C6

config ESP32_BT_LE_TX_CCA_ENABLED
bool "TX CCA feature"
help
Expand Down Expand Up @@ -684,6 +692,10 @@ config BT_CTLR_SCAN_BACKOFF_UPPERLIMITMAX
help
Upperlimitmax value (power of 2) for scan backoff procedure.

endif # SOC_SERIES_ESP32C2 || SOC_SERIES_ESP32C6

if SOC_SERIES_ESP32C6

config ESP32_BT_LE_CTLR_CHAN_ASS_EN
bool "Channel assessment (experimental)"
help
Expand Down
6 changes: 6 additions & 0 deletions dts/riscv/espressif/esp32c2/esp32c2_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
chosen {
zephyr,entropy = &trng0;
zephyr,flash-controller = &flash;
zephyr,bt-hci = &esp32_bt_hci;
};

cpus {
Expand Down Expand Up @@ -50,6 +51,11 @@
status = "disabled";
};

esp32_bt_hci: esp32_bt_hci {
compatible = "espressif,esp32-bt-hci";
status = "disabled";
};

clock: clock {
compatible = "espressif,esp32-clock";
fast-clk-src = <ESP32_RTC_FAST_CLK_SRC_RC_FAST>;
Expand Down
1 change: 1 addition & 0 deletions samples/bluetooth/central/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tests:
platform_allow:
- esp32_devkitc/esp32/procpu
- esp32s3_devkitm/esp32s3/procpu
- esp8684_devkitm
- esp32c3_devkitm
- esp32c6_devkitc/esp32c6/hpcore
- sltb010a/efr32bg22c224f512im40
Expand Down
1 change: 1 addition & 0 deletions samples/bluetooth/peripheral/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tests:
platform_allow:
- esp32_devkitc/esp32/procpu
- esp32s3_devkitm/esp32s3/procpu
- esp8684_devkitm
- esp32c3_devkitm
- esp32c6_devkitc/esp32c6/hpcore
- sltb010a/efr32bg22c224f512im40
Expand Down
14 changes: 14 additions & 0 deletions soc/espressif/esp32c2/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ SECTIONS
*libpp.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
#endif /* CONFIG_ESP32_WIFI_RX_IRAM_OPT */

*libble_app.a:(.isr_iram1.* .conn_iram1.* .sleep_iram1.*)

. = ALIGN(4) + 16;

} GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
Expand Down Expand Up @@ -592,6 +594,18 @@ SECTIONS
__bss_start = ABSOLUTE(.);
_bss_start = ABSOLUTE(.);

. = ALIGN (4);
_bt_bss_start = ABSOLUTE(.);
*libbtbb.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_bt_bss_end = ABSOLUTE(.);

. = ALIGN (4);
_bt_controller_bss_start = ABSOLUTE(.);
*libble_app.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_bt_controller_bss_end = ABSOLUTE(.);

*(.dynsbss)
*(.sbss)
*(.sbss.*)
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ manifest:
groups:
- hal
- name: hal_espressif
revision: f3453bdeced28642424692aae32cce4eec3f2d7f
revision: 114bdcb05136403d84e3529809c3e8044153a86c
path: modules/hal/espressif
west-commands: west/west-commands.yml
groups:
Expand Down
Loading