Skip to content

Commit 87e7510

Browse files
authored
[ESP32] ESP-IDF v5.0 support in few apps (project-chip#24720)
* [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
1 parent 273f8c5 commit 87e7510

28 files changed

+149
-47
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,9 @@ examples/thermostat/ameba/build
7474

7575
# Downloaded zap without a pigweed root (via zap_download.py)
7676
.zap
77+
78+
# When building esp-idf application, if any component is fetched using idf-component-manager then they are stored in
79+
# managed_component directory. Along with that dependencies.lock file is generated.
80+
# https://github.com/espressif/idf-component-manager#using-with-a-project
81+
examples/*/esp32/managed_components
82+
examples/*/esp32/dependencies.lock

examples/all-clusters-app/esp32/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/cm
2727
set(EXTRA_COMPONENT_DIRS
2828
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components"
2929
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/QRCode"
30-
"${IDF_PATH}/examples/common_components/led_strip"
3130
)
3231
if(${IDF_TARGET} STREQUAL "esp32")
3332
list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/m5stack-tft/repo/components/tft"

examples/all-clusters-app/esp32/main/AppTask.cpp

+19-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,19 @@
2323
#include "LEDWidget.h"
2424
#include "ScreenManager.h"
2525
#include "driver/gpio.h"
26+
#include "esp_idf_version.h"
2627
#include "esp_log.h"
27-
#include "esp_spi_flash.h"
2828
#include "freertos/FreeRTOS.h"
2929
#include <app/server/OnboardingCodesUtil.h>
3030
#include <lock/BoltLockManager.h>
3131

32+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
33+
#include "esp_spi_flash.h"
34+
#else
35+
#include "esp_chip_info.h"
36+
#include "esp_flash.h"
37+
#endif
38+
3239
#define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000
3340
#define APP_TASK_NAME "APP"
3441
#define APP_EVENT_QUEUE_SIZE 10
@@ -173,10 +180,20 @@ CHIP_ERROR AppTask::Init()
173180
/* Print chip information */
174181
esp_chip_info_t chip_info;
175182
esp_chip_info(&chip_info);
183+
uint32_t flash_size = 0;
184+
185+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
186+
flash_size = spi_flash_get_chip_size();
187+
#else
188+
if (esp_flash_get_size(NULL, &flash_size) != ESP_OK)
189+
{
190+
ESP_LOGW(TAG, "Failed to get flash size");
191+
}
192+
#endif
176193
ESP_LOGI(TAG, "This is ESP32 chip with %d CPU cores, WiFi%s%s, ", chip_info.cores,
177194
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
178195
ESP_LOGI(TAG, "silicon revision %d, ", chip_info.revision);
179-
ESP_LOGI(TAG, "%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
196+
ESP_LOGI(TAG, "%" PRIu32 " MB %s flash\n", flash_size / (1024 * 1024),
180197
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
181198

182199
// Create FreeRTOS sw timer for Function Selection

examples/all-clusters-app/esp32/main/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
109109
)
110110
endif (CONFIG_ENABLE_PW_RPC)
111111

112-
if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y"))
112+
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"))
113113
list(APPEND PRIV_INCLUDE_DIRS_LIST
114114
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include")
115115
set(PRIV_REQUIRES_LIST chip QRCode bt)

examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
9393
uint8_t type, uint16_t size, uint8_t * value)
9494
{
9595
ESP_LOGI(TAG,
96-
"PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: "
97-
"'0x%02x', Attribute ID: '0x%04x'",
96+
"PostAttributeChangeCallback - Cluster ID: '0x%04" PRIx32 "', EndPoint ID: '0x%02x' , Attribute ID: '0x%04" PRIx32 "'",
9897
clusterId, endpointId, attributeId);
9998

10099
switch (clusterId)
@@ -115,7 +114,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
115114
OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, size, value);
116115
break;
117116
default:
118-
ESP_LOGI(TAG, "Unhandled cluster ID: %d", clusterId);
117+
ESP_LOGI(TAG, "Unhandled cluster ID: %" PRIu32, clusterId);
119118
break;
120119
}
121120

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

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

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

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

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

164163
VerifyOrExit(attributeId == CurrentHue::Id || attributeId == CurrentSaturation::Id,
165-
ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04x", attributeId));
164+
ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04" PRIx32 "'", attributeId));
166165
VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));
167166
if (endpointId == 1)
168167
{

examples/all-clusters-app/esp32/main/Kconfig.projbuild

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ menu "Demo"
2424
prompt "Device Type"
2525
default DEVICE_TYPE_ESP32_DEVKITC if IDF_TARGET_ESP32
2626
default DEVICE_TYPE_ESP32_C3_DEVKITM if IDF_TARGET_ESP32C3
27+
default DEVICE_TYPE_ESP32_C2_DEVKITM if IDF_TARGET_ESP32C2
2728
help
2829
Specifies the type of ESP32 device.
2930

@@ -46,6 +47,9 @@ menu "Demo"
4647
bool "ESP32-Ethernet-Kit_A_V1.0"
4748
select ENABLE_ETHERNET_TELEMETRY
4849
depends on IDF_TARGET_ESP32
50+
config DEVICE_TYPE_ESP32_C2_DEVKITM
51+
bool "ESP32C2-DevKitM"
52+
depends on IDF_TARGET_ESP32C2
4953
endchoice
5054

5155
choice
@@ -77,7 +81,7 @@ menu "Demo"
7781
int
7882
range 0 5
7983
default 0 if DEVICE_TYPE_ESP32_DEVKITC
80-
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM
84+
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
8185
default 3 if DEVICE_TYPE_M5STACK
8286
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT
8387

@@ -102,7 +106,7 @@ menu "Demo"
102106
range 0 40
103107
default 2 if DEVICE_TYPE_ESP32_DEVKITC #Use LED1 (blue LED) as status LED on DevKitC
104108
default 2 if DEVICE_TYPE_ESP32_ETHERNET_KIT
105-
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM
109+
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
106110
default 26 if DEVICE_TYPE_ESP32_WROVER_KIT
107111
default 40 if DEVICE_TYPE_M5STACK
108112
help
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dependencies:
2+
espressif/led_strip: "^1.0.0-alpha"

examples/all-clusters-app/esp32/main/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ extern "C" void app_main()
162162
DeviceCallbacksDelegate::Instance().SetAppDelegate(&sAppDeviceCallbacksDelegate);
163163
if (error != CHIP_NO_ERROR)
164164
{
165-
ESP_LOGE(TAG, "device.Init() failed: %s", ErrorStr(error));
165+
ESP_LOGE(TAG, "device.Init() failed: %" CHIP_ERROR_FORMAT, error.Format());
166166
return;
167167
}
168168

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

186186
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

examples/all-clusters-app/esp32/sdkconfig.defaults

+4
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,7 @@ CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
5959

6060
# Disable softap support by default
6161
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
62+
63+
# This example uses the older version of RMT driver to work with both
64+
# idf-v4.4.3 and idf-v5.0, so supressing the warnings by setting below option
65+
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Disable chip shell
2+
CONFIG_ENABLE_CHIP_SHELL=n
3+
4+
# CONFIG_ESP32_WIFI_IRAM_OPT is not set
5+
# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set
6+
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
7+
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
8+
9+
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y
10+
11+
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16
12+
CONFIG_LWIP_TCP_RECVMBOX_SIZE=8
13+
14+
CONFIG_BT_NIMBLE_ROLE_CENTRAL=n
15+
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
16+
17+
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4
18+
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8
19+
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16

examples/all-clusters-minimal-app/esp32/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/cm
2727
set(EXTRA_COMPONENT_DIRS
2828
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components"
2929
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/QRCode"
30-
"${IDF_PATH}/examples/common_components/led_strip"
3130
)
3231
if(${IDF_TARGET} STREQUAL "esp32")
3332
list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/examples/common/m5stack-tft/repo/components/tft"

examples/all-clusters-minimal-app/esp32/main/AppTask.cpp

+19-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@
2323
#include "LEDWidget.h"
2424
#include "ScreenManager.h"
2525
#include "driver/gpio.h"
26+
#include "esp_idf_version.h"
2627
#include "esp_log.h"
27-
#include "esp_spi_flash.h"
2828
#include "freertos/FreeRTOS.h"
2929
#include <app/server/OnboardingCodesUtil.h>
3030

31+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
32+
#include "esp_spi_flash.h"
33+
#else
34+
#include "esp_chip_info.h"
35+
#include "esp_flash.h"
36+
#endif
37+
3138
#define APP_TASK_NAME "APP"
3239
#define APP_EVENT_QUEUE_SIZE 10
3340
#define APP_TASK_STACK_SIZE (3072)
@@ -63,10 +70,20 @@ CHIP_ERROR AppTask::Init()
6370
/* Print chip information */
6471
esp_chip_info_t chip_info;
6572
esp_chip_info(&chip_info);
73+
uint32_t flash_size = 0;
74+
75+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
76+
flash_size = spi_flash_get_chip_size();
77+
#else
78+
if (esp_flash_get_size(NULL, &flash_size) != ESP_OK)
79+
{
80+
ESP_LOGW(TAG, "Failed to get flash size");
81+
}
82+
#endif
6683
ESP_LOGI(TAG, "This is ESP32 chip with %d CPU cores, WiFi%s%s, ", chip_info.cores,
6784
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
6885
ESP_LOGI(TAG, "silicon revision %d, ", chip_info.revision);
69-
ESP_LOGI(TAG, "%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
86+
ESP_LOGI(TAG, "%" PRIu32 " MB %s flash\n", flash_size / (1024 * 1024),
7087
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
7188

7289
CHIP_ERROR err = CHIP_NO_ERROR;

examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
106106
)
107107
endif (CONFIG_ENABLE_PW_RPC)
108108

109-
if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y"))
109+
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"))
110110
list(APPEND PRIV_INCLUDE_DIRS_LIST
111111
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include")
112112
set(PRIV_REQUIRES_LIST chip QRCode bt)

examples/all-clusters-minimal-app/esp32/main/DeviceCallbacks.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
9292
uint8_t type, uint16_t size, uint8_t * value)
9393
{
9494
ESP_LOGI(TAG,
95-
"PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: "
96-
"'0x%02x', Attribute ID: '0x%04x'",
95+
"PostAttributeChangeCallback - Cluster ID: '0x%04" PRIx32 "', EndPoint ID: '0x%02x' , Attribute ID: '0x%04" PRIx32 "'",
9796
clusterId, endpointId, attributeId);
9897

9998
switch (clusterId)
@@ -114,7 +113,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus
114113
OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, size, value);
115114
break;
116115
default:
117-
ESP_LOGI(TAG, "Unhandled cluster ID: %d", clusterId);
116+
ESP_LOGI(TAG, "Unhandled cluster ID: %" PRIu32, clusterId);
118117
break;
119118
}
120119

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

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

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

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

161160
VerifyOrExit(attributeId == CurrentHue::Id || attributeId == CurrentSaturation::Id,
162-
ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04x", attributeId));
161+
ESP_LOGI(TAG, "Unhandled AttributeId ID: '0x%04" PRIx32 "'", attributeId));
163162
VerifyOrExit(endpointId == 1 || endpointId == 2, ESP_LOGE(TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));
164163
if (endpointId == 1)
165164
{

examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ menu "Demo"
2424
prompt "Device Type"
2525
default DEVICE_TYPE_ESP32_DEVKITC if IDF_TARGET_ESP32
2626
default DEVICE_TYPE_ESP32_C3_DEVKITM if IDF_TARGET_ESP32C3
27+
default DEVICE_TYPE_ESP32_C2_DEVKITM if IDF_TARGET_ESP32C2
2728
help
2829
Specifies the type of ESP32 device.
2930

@@ -42,6 +43,9 @@ menu "Demo"
4243
config DEVICE_TYPE_ESP32_C3_DEVKITM
4344
bool "ESP32C3-DevKitM"
4445
depends on IDF_TARGET_ESP32C3
46+
config DEVICE_TYPE_ESP32_C2_DEVKITM
47+
bool "ESP32C2-DevKitM"
48+
depends on IDF_TARGET_ESP32C2
4549
endchoice
4650

4751
choice
@@ -73,7 +77,7 @@ menu "Demo"
7377
int
7478
range 0 5
7579
default 0 if DEVICE_TYPE_ESP32_DEVKITC
76-
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM
80+
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
7781
default 3 if DEVICE_TYPE_M5STACK
7882
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT
7983

@@ -97,7 +101,7 @@ menu "Demo"
97101
int
98102
range 0 40
99103
default 2 if DEVICE_TYPE_ESP32_DEVKITC #Use LED1 (blue LED) as status LED on DevKitC
100-
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM
104+
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
101105
default 26 if DEVICE_TYPE_ESP32_WROVER_KIT
102106
default 40 if DEVICE_TYPE_M5STACK
103107
help
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dependencies:
2+
espressif/led_strip: "^1.0.0-alpha"

examples/all-clusters-minimal-app/esp32/main/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ extern "C" void app_main()
156156
DeviceCallbacksDelegate::Instance().SetAppDelegate(&sAppDeviceCallbacksDelegate);
157157
if (error != CHIP_NO_ERROR)
158158
{
159-
ESP_LOGE(TAG, "device.Init() failed: %s", ErrorStr(error));
159+
ESP_LOGE(TAG, "device.Init() failed: %" CHIP_ERROR_FORMAT, error.Format());
160160
return;
161161
}
162162

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

180180
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

examples/all-clusters-minimal-app/esp32/sdkconfig.defaults

+4
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,7 @@ CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
5959

6060
# Disable softap support by default
6161
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
62+
63+
# This example uses the older version of RMT driver to work with both
64+
# idf-v4.4.3 and idf-v5.0, so supressing the warnings by setting below option
65+
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Disable chip shell
2+
CONFIG_ENABLE_CHIP_SHELL=n
3+
4+
# CONFIG_ESP32_WIFI_IRAM_OPT is not set
5+
# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set
6+
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
7+
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
8+
9+
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y
10+
11+
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16
12+
CONFIG_LWIP_TCP_RECVMBOX_SIZE=8
13+
14+
CONFIG_BT_NIMBLE_ROLE_CENTRAL=n
15+
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
16+
17+
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4
18+
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8
19+
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16

examples/bridge-app/esp32/main/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
5050
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
5151
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
5252
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
53-
PRIV_REQUIRES chip QRCode bt)
53+
PRIV_REQUIRES chip QRCode bt nvs_flash)
5454

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

0 commit comments

Comments
 (0)