Skip to content

soc: esp32c2: ble: Add support #465

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

Merged
merged 4 commits into from
Jul 23, 2025
Merged
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
33 changes: 30 additions & 3 deletions zephyr/esp32c2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if(CONFIG_SOC_SERIES_ESP32C2)

zephyr_include_directories(
include
include/bt
../esp_shared/include
../esp_shared/components/include
../port/include
Expand Down Expand Up @@ -103,19 +104,25 @@ if(CONFIG_SOC_SERIES_ESP32C2)
../../components/mbedtls/port/include

../port/include/boot

../port/bluetooth/include
../port/bluetooth/npl/zephyr/include
../port/bluetooth/transport/include
)

zephyr_link_libraries_ifdef(
CONFIG_SOC_ESP32C2_REV_2_0
gcc
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.eco4.ld
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.ble-eco4.ld
)

zephyr_link_libraries(
gcc
-T${CMAKE_CURRENT_SOURCE_DIR}/src/linker/${CONFIG_SOC_SERIES}.rom.alias.ld
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.ld
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.api.ld
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.ble.ld
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.libgcc.ld
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.newlib.ld
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.version.ld
Expand Down Expand Up @@ -379,15 +386,35 @@ if(CONFIG_SOC_SERIES_ESP32C2)

## BT definitions
if (CONFIG_BT)
zephyr_sources(src/bt/esp_bt_adapter.c)

zephyr_sources(
../../components/esp_phy/src/btbb_init.c
../port/bluetooth/mem/bt_osi_mem.c
../port/bluetooth/mem/os_msys_init.c
../port/bluetooth/npl/zephyr/src/npl_os_zephyr.c
../port/bluetooth/transport/driver/vhci/hci_driver_standard.c
../port/bluetooth/transport/src/hci_transport.c
src/bt/esp_ble_adapter.c
src/bt/esp_bt_adapter.c
)

zephyr_compile_definitions(CONFIG_BT_ENABLED)
zephyr_compile_definitions(CONFIG_BT_CONTROLLER_ENABLED)

zephyr_link_libraries(
zephyr_sources_ifdef(
CONFIG_BUILD_ONLY_NO_BLOBS
../port/bluetooth/bt_stubs.c
../port/phy/phy_stubs.c
)

zephyr_link_libraries_ifndef(
CONFIG_BUILD_ONLY_NO_BLOBS
## ble
btbb
btdm_app
ble_app
-L${CMAKE_CURRENT_SOURCE_DIR}/../blobs/lib/${CONFIG_SOC_SERIES}
)

endif()

## WIFI definitions
Expand Down
12 changes: 12 additions & 0 deletions zephyr/esp32c2/include/bt/ble_priv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
int ble_stack_initEnv(void);

void ble_stack_deinitEnv(void);

int ble_stack_enable(void);

void ble_stack_disable(void);
482 changes: 482 additions & 0 deletions zephyr/esp32c2/include/bt/esp_bt.h

Large diffs are not rendered by default.

Loading