diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 707d23784bc350..a8b1be9bab9a53 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -33,7 +33,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake) set(CHIP_REQURIE_COMPONENTS freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash) -if(NOT "${IDF_TARGET}" STREQUAL "esp32h2") +if((NOT "${IDF_TARGET}" STREQUAL "esp32h2") AND (NOT "${IDF_TARGET}" STREQUAL "esp32c2")) list(APPEND CHIP_REQURIE_COMPONENTS mdns) endif() @@ -289,6 +289,11 @@ if(CONFIG_BT_ENABLED) if(CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2) list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/beta2/libble_app.a) endif() + elseif("${CONFIG_IDF_TARGET}" STREQUAL "esp32c2") + idf_component_get_property(bt_lib bt COMPONENT_LIB) + idf_component_get_property(bt_dir bt COMPONENT_DIR) + list(APPEND chip_libraries $) + list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32c2/esp32c2-bt-lib/libble_app.a) else() idf_component_get_property(bt_lib bt COMPONENT_LIB) list(APPEND chip_libraries $ -lbtdm_app) @@ -305,7 +310,7 @@ if(CONFIG_OPENTHREAD_ENABLED) list(APPEND chip_libraries $) endif() -if(NOT CONFIG_USE_MINIMAL_MDNS AND NOT CONFIG_IDF_TARGET_ESP32H2) +if((NOT CONFIG_USE_MINIMAL_MDNS) AND (NOT CONFIG_IDF_TARGET_ESP32H2) AND (NOT CONFIG_IDF_TARGET_ESP32C2)) idf_component_get_property(mdns_lib mdns COMPONENT_LIB) list(APPEND chip_libraries $) endif() diff --git a/examples/lighting-app/esp32/main/main.cpp b/examples/lighting-app/esp32/main/main.cpp index 02381fd651fe0d..6e3aaf367f8512 100644 --- a/examples/lighting-app/esp32/main/main.cpp +++ b/examples/lighting-app/esp32/main/main.cpp @@ -22,7 +22,11 @@ #include #include "esp_log.h" +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) +#include "spi_flash_mmap.h" +#else #include "esp_spi_flash.h" +#endif #include "esp_system.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp index a80999f5f03ad1..6dc68280c6dd71 100644 --- a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp @@ -34,7 +34,11 @@ #include "esp_heap_caps_init.h" #include "esp_log.h" #include "esp_netif.h" +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) +#include "spi_flash_mmap.h" +#else #include "esp_spi_flash.h" +#endif #include "esp_system.h" #include "esp_wifi.h" diff --git a/src/platform/ESP32/PlatformManagerImpl.cpp b/src/platform/ESP32/PlatformManagerImpl.cpp index 10f9554477bf13..074750654c2360 100644 --- a/src/platform/ESP32/PlatformManagerImpl.cpp +++ b/src/platform/ESP32/PlatformManagerImpl.cpp @@ -37,7 +37,11 @@ #include "esp_heap_caps_init.h" #include "esp_log.h" #include "esp_netif.h" +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) +#include "spi_flash_mmap.h" +#else #include "esp_spi_flash.h" +#endif #include "esp_system.h" #include "esp_wifi.h"