Skip to content

Commit

Permalink
[ESP32] ESP-IDF v5.0 support in few apps (#24720)
Browse files Browse the repository at this point in the history
* [ESP32] all-clusters-app: changes to support idf v5.0

- Fixed few format specifier
- Using the older version of led_strip, v1.0.0-alpha, which is present in
  idf v4.4.3 to avoid putting in more ifdefs in the code.

* [ESP32] all-clusters-minimal-app: changes to support idf v5.0

- Fixed few format specifier
- Using the older version of led_strip, v1.0.0-alpha, which is present in
  idf v4.4.3 to avoid putting in more ifdefs in the code.

* Added esp idf component manager related files to .gitignore

* [ESP32] bridge-app: changes to support idf v5.0

- Fixed few format specifier

* [ESP32] light-switch-app: changes to support idf v5.0

- Fixed few format specifiers

* restyle

* remove ErrorStr.h from bridge app

* added reason for adding files to .gitignore
  • Loading branch information
shubhamdp authored Feb 3, 2023
1 parent 273f8c5 commit 87e7510
Show file tree
Hide file tree
Showing 28 changed files with 149 additions and 47 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,9 @@ examples/thermostat/ameba/build

# Downloaded zap without a pigweed root (via zap_download.py)
.zap

# When building esp-idf application, if any component is fetched using idf-component-manager then they are stored in
# managed_component directory. Along with that dependencies.lock file is generated.
# https://github.com/espressif/idf-component-manager#using-with-a-project
examples/*/esp32/managed_components
examples/*/esp32/dependencies.lock
1 change: 0 additions & 1 deletion examples/all-clusters-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/cm
set(EXTRA_COMPONENT_DIRS
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components"
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/QRCode"
"${IDF_PATH}/examples/common_components/led_strip"
)
if(${IDF_TARGET} STREQUAL "esp32")
list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/m5stack-tft/repo/components/tft"
Expand Down
21 changes: 19 additions & 2 deletions examples/all-clusters-app/esp32/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@
#include "LEDWidget.h"
#include "ScreenManager.h"
#include "driver/gpio.h"
#include "esp_idf_version.h"
#include "esp_log.h"
#include "esp_spi_flash.h"
#include "freertos/FreeRTOS.h"
#include <app/server/OnboardingCodesUtil.h>
#include <lock/BoltLockManager.h>

#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
#include "esp_spi_flash.h"
#else
#include "esp_chip_info.h"
#include "esp_flash.h"
#endif

#define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000
#define APP_TASK_NAME "APP"
#define APP_EVENT_QUEUE_SIZE 10
Expand Down Expand Up @@ -173,10 +180,20 @@ CHIP_ERROR AppTask::Init()
/* Print chip information */
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
uint32_t flash_size = 0;

#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
flash_size = spi_flash_get_chip_size();
#else
if (esp_flash_get_size(NULL, &flash_size) != ESP_OK)
{
ESP_LOGW(TAG, "Failed to get flash size");
}
#endif
ESP_LOGI(TAG, "This is ESP32 chip with %d CPU cores, WiFi%s%s, ", chip_info.cores,
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
ESP_LOGI(TAG, "silicon revision %d, ", chip_info.revision);
ESP_LOGI(TAG, "%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
ESP_LOGI(TAG, "%" PRIu32 " MB %s flash\n", flash_size / (1024 * 1024),
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");

// Create FreeRTOS sw timer for Function Selection
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
)
endif (CONFIG_ENABLE_PW_RPC)

if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y"))
if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C2_DEVKITM}" STREQUAL "y"))
list(APPEND PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include")
set(PRIV_REQUIRES_LIST chip QRCode bt)
Expand Down
11 changes: 5 additions & 6 deletions examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG,
"PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: "
"'0x%02x', Attribute ID: '0x%04x'",
"PostAttributeChangeCallback - Cluster ID: '0x%04" PRIx32 "', EndPoint ID: '0x%02x' , Attribute ID: '0x%04" PRIx32 "'",
clusterId, endpointId, attributeId);

switch (clusterId)
Expand All @@ -115,7 +114,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, size, value);
break;
default:
ESP_LOGI(TAG, "Unhandled cluster ID: %d", clusterId);
ESP_LOGI(TAG, "Unhandled cluster ID: %" PRIu32, clusterId);
break;
}

Expand All @@ -126,7 +125,7 @@ void AppDeviceCallbacks::OnOnOffPostAttributeChangeCallback(EndpointId endpointI
{
using namespace app::Clusters::OnOff::Attributes;

VerifyOrExit(attributeId == OnOff::Id, ESP_LOGI(TAG, "Unhandled Attribute ID: '0x%04x", attributeId));
VerifyOrExit(attributeId == OnOff::Id, ESP_LOGI(TAG, "Unhandled Attribute ID: '0x%04" PRIx32 "'", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));

// At this point we can assume that value points to a bool value.
Expand All @@ -144,7 +143,7 @@ void AppDeviceCallbacks::OnLevelControlAttributeChangeCallback(EndpointId endpoi
bool onOffState = mEndpointOnOffState[endpointId - 1];
uint8_t brightness = onOffState ? *value : 0;

VerifyOrExit(attributeId == CurrentLevel::Id, ESP_LOGI(TAG, "Unhandled Attribute ID: '0x%04x", attributeId));
VerifyOrExit(attributeId == CurrentLevel::Id, ESP_LOGI(TAG, "Unhandled Attribute ID: '0x%04" PRIx32 "'", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));

// At this point we can assume that value points to a bool value.
Expand All @@ -162,7 +161,7 @@ void AppDeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpoi
using namespace app::Clusters::ColorControl::Attributes;

VerifyOrExit(attributeId == CurrentHue::Id || attributeId == CurrentSaturation::Id,
ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04x", attributeId));
ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04" PRIx32 "'", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));
if (endpointId == 1)
{
Expand Down
8 changes: 6 additions & 2 deletions examples/all-clusters-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ menu "Demo"
prompt "Device Type"
default DEVICE_TYPE_ESP32_DEVKITC if IDF_TARGET_ESP32
default DEVICE_TYPE_ESP32_C3_DEVKITM if IDF_TARGET_ESP32C3
default DEVICE_TYPE_ESP32_C2_DEVKITM if IDF_TARGET_ESP32C2
help
Specifies the type of ESP32 device.

Expand All @@ -46,6 +47,9 @@ menu "Demo"
bool "ESP32-Ethernet-Kit_A_V1.0"
select ENABLE_ETHERNET_TELEMETRY
depends on IDF_TARGET_ESP32
config DEVICE_TYPE_ESP32_C2_DEVKITM
bool "ESP32C2-DevKitM"
depends on IDF_TARGET_ESP32C2
endchoice

choice
Expand Down Expand Up @@ -77,7 +81,7 @@ menu "Demo"
int
range 0 5
default 0 if DEVICE_TYPE_ESP32_DEVKITC
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
default 3 if DEVICE_TYPE_M5STACK
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT

Expand All @@ -102,7 +106,7 @@ menu "Demo"
range 0 40
default 2 if DEVICE_TYPE_ESP32_DEVKITC #Use LED1 (blue LED) as status LED on DevKitC
default 2 if DEVICE_TYPE_ESP32_ETHERNET_KIT
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
default 26 if DEVICE_TYPE_ESP32_WROVER_KIT
default 40 if DEVICE_TYPE_M5STACK
help
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/esp32/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
espressif/led_strip: "^1.0.0-alpha"
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ extern "C" void app_main()
DeviceCallbacksDelegate::Instance().SetAppDelegate(&sAppDeviceCallbacksDelegate);
if (error != CHIP_NO_ERROR)
{
ESP_LOGE(TAG, "device.Init() failed: %s", ErrorStr(error));
ESP_LOGE(TAG, "device.Init() failed: %" CHIP_ERROR_FORMAT, error.Format());
return;
}

Expand All @@ -180,7 +180,7 @@ extern "C" void app_main()
error = GetAppTask().StartAppTask();
if (error != CHIP_NO_ERROR)
{
ESP_LOGE(TAG, "GetAppTask().StartAppTask() failed : %s", ErrorStr(error));
ESP_LOGE(TAG, "GetAppTask().StartAppTask() failed : %" CHIP_ERROR_FORMAT, error.Format());
}

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
Expand Down
4 changes: 4 additions & 0 deletions examples/all-clusters-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n

# This example uses the older version of RMT driver to work with both
# idf-v4.4.3 and idf-v5.0, so supressing the warnings by setting below option
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
19 changes: 19 additions & 0 deletions examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Disable chip shell
CONFIG_ENABLE_CHIP_SHELL=n

# CONFIG_ESP32_WIFI_IRAM_OPT is not set
# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y

CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y

CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16
CONFIG_LWIP_TCP_RECVMBOX_SIZE=8

CONFIG_BT_NIMBLE_ROLE_CENTRAL=n
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n

CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16
1 change: 0 additions & 1 deletion examples/all-clusters-minimal-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/cm
set(EXTRA_COMPONENT_DIRS
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components"
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/QRCode"
"${IDF_PATH}/examples/common_components/led_strip"
)
if(${IDF_TARGET} STREQUAL "esp32")
list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/m5stack-tft/repo/components/tft"
Expand Down
21 changes: 19 additions & 2 deletions examples/all-clusters-minimal-app/esp32/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@
#include "LEDWidget.h"
#include "ScreenManager.h"
#include "driver/gpio.h"
#include "esp_idf_version.h"
#include "esp_log.h"
#include "esp_spi_flash.h"
#include "freertos/FreeRTOS.h"
#include <app/server/OnboardingCodesUtil.h>

#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
#include "esp_spi_flash.h"
#else
#include "esp_chip_info.h"
#include "esp_flash.h"
#endif

#define APP_TASK_NAME "APP"
#define APP_EVENT_QUEUE_SIZE 10
#define APP_TASK_STACK_SIZE (3072)
Expand Down Expand Up @@ -63,10 +70,20 @@ CHIP_ERROR AppTask::Init()
/* Print chip information */
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
uint32_t flash_size = 0;

#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
flash_size = spi_flash_get_chip_size();
#else
if (esp_flash_get_size(NULL, &flash_size) != ESP_OK)
{
ESP_LOGW(TAG, "Failed to get flash size");
}
#endif
ESP_LOGI(TAG, "This is ESP32 chip with %d CPU cores, WiFi%s%s, ", chip_info.cores,
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
ESP_LOGI(TAG, "silicon revision %d, ", chip_info.revision);
ESP_LOGI(TAG, "%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
ESP_LOGI(TAG, "%" PRIu32 " MB %s flash\n", flash_size / (1024 * 1024),
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");

CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
)
endif (CONFIG_ENABLE_PW_RPC)

if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y"))
if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C2_DEVKITM}" STREQUAL "y"))
list(APPEND PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include")
set(PRIV_REQUIRES_LIST chip QRCode bt)
Expand Down
11 changes: 5 additions & 6 deletions examples/all-clusters-minimal-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG,
"PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: "
"'0x%02x', Attribute ID: '0x%04x'",
"PostAttributeChangeCallback - Cluster ID: '0x%04" PRIx32 "', EndPoint ID: '0x%02x' , Attribute ID: '0x%04" PRIx32 "'",
clusterId, endpointId, attributeId);

switch (clusterId)
Expand All @@ -114,7 +113,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, size, value);
break;
default:
ESP_LOGI(TAG, "Unhandled cluster ID: %d", clusterId);
ESP_LOGI(TAG, "Unhandled cluster ID: %" PRIu32, clusterId);
break;
}

Expand All @@ -124,7 +123,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
void AppDeviceCallbacks::OnOnOffPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value)
{
VerifyOrExit(attributeId == Clusters::OnOff::Attributes::OnOff::Id,
ESP_LOGI(TAG, "Unhandled Attribute ID: '0x%04x", attributeId));
ESP_LOGI(TAG, "Unhandled Attribute ID: '0x%04" PRIx32 "'", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));

// At this point we can assume that value points to a bool value.
Expand All @@ -141,7 +140,7 @@ void AppDeviceCallbacks::OnLevelControlAttributeChangeCallback(EndpointId endpoi
uint8_t brightness = onOffState ? *value : 0;

VerifyOrExit(attributeId == Clusters::LevelControl::Attributes::CurrentLevel::Id,
ESP_LOGI(TAG, "Unhandled Attribute ID: '0x%04x", attributeId));
ESP_LOGI(TAG, "Unhandled Attribute ID: '0x%04" PRIx32 "'", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));

// At this point we can assume that value points to a bool value.
Expand All @@ -159,7 +158,7 @@ void AppDeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpoi
using namespace Clusters::ColorControl::Attributes;

VerifyOrExit(attributeId == CurrentHue::Id || attributeId == CurrentSaturation::Id,
ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04x", attributeId));
ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04" PRIx32 "'", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));
if (endpointId == 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ menu "Demo"
prompt "Device Type"
default DEVICE_TYPE_ESP32_DEVKITC if IDF_TARGET_ESP32
default DEVICE_TYPE_ESP32_C3_DEVKITM if IDF_TARGET_ESP32C3
default DEVICE_TYPE_ESP32_C2_DEVKITM if IDF_TARGET_ESP32C2
help
Specifies the type of ESP32 device.

Expand All @@ -42,6 +43,9 @@ menu "Demo"
config DEVICE_TYPE_ESP32_C3_DEVKITM
bool "ESP32C3-DevKitM"
depends on IDF_TARGET_ESP32C3
config DEVICE_TYPE_ESP32_C2_DEVKITM
bool "ESP32C2-DevKitM"
depends on IDF_TARGET_ESP32C2
endchoice

choice
Expand Down Expand Up @@ -73,7 +77,7 @@ menu "Demo"
int
range 0 5
default 0 if DEVICE_TYPE_ESP32_DEVKITC
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
default 3 if DEVICE_TYPE_M5STACK
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT

Expand All @@ -97,7 +101,7 @@ menu "Demo"
int
range 0 40
default 2 if DEVICE_TYPE_ESP32_DEVKITC #Use LED1 (blue LED) as status LED on DevKitC
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
default 26 if DEVICE_TYPE_ESP32_WROVER_KIT
default 40 if DEVICE_TYPE_M5STACK
help
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
espressif/led_strip: "^1.0.0-alpha"
4 changes: 2 additions & 2 deletions examples/all-clusters-minimal-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ extern "C" void app_main()
DeviceCallbacksDelegate::Instance().SetAppDelegate(&sAppDeviceCallbacksDelegate);
if (error != CHIP_NO_ERROR)
{
ESP_LOGE(TAG, "device.Init() failed: %s", ErrorStr(error));
ESP_LOGE(TAG, "device.Init() failed: %" CHIP_ERROR_FORMAT, error.Format());
return;
}

Expand All @@ -174,7 +174,7 @@ extern "C" void app_main()
error = GetAppTask().StartAppTask();
if (error != CHIP_NO_ERROR)
{
ESP_LOGE(TAG, "GetAppTask().StartAppTask() failed : %s", ErrorStr(error));
ESP_LOGE(TAG, "GetAppTask().StartAppTask() failed : %" CHIP_ERROR_FORMAT, error.Format());
}

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));
Expand Down
4 changes: 4 additions & 0 deletions examples/all-clusters-minimal-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n

# This example uses the older version of RMT driver to work with both
# idf-v4.4.3 and idf-v5.0, so supressing the warnings by setting below option
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
19 changes: 19 additions & 0 deletions examples/all-clusters-minimal-app/esp32/sdkconfig.defaults.esp32c2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Disable chip shell
CONFIG_ENABLE_CHIP_SHELL=n

# CONFIG_ESP32_WIFI_IRAM_OPT is not set
# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y

CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y

CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16
CONFIG_LWIP_TCP_RECVMBOX_SIZE=8

CONFIG_BT_NIMBLE_ROLE_CENTRAL=n
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n

CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16
2 changes: 1 addition & 1 deletion examples/bridge-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
PRIV_REQUIRES chip QRCode bt)
PRIV_REQUIRES chip QRCode bt nvs_flash)

get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH)

Expand Down
Loading

0 comments on commit 87e7510

Please sign in to comment.