Skip to content

Commit b5c2a0f

Browse files
committed
Merge branch 'c6_icd' into 'main'
Add ESP32-C6 support for ICD example See merge request app-frameworks/esp-matter!637
2 parents 0715268 + d20bd6d commit b5c2a0f

16 files changed

+156
-49
lines changed

examples/.build-rules.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ examples/mfg_test_app:
7575
temporary: true
7676
reason: the other targets are not tested yet
7777

78-
examples/sleepy_device:
78+
examples/icd_app:
7979
enable:
80-
- if: IDF_TARGET in ["esp32h2"]
80+
- if: IDF_TARGET in ["esp32h2", "esp32c6"]
8181
temporary: true
8282
reason: the other targets are not tested yet
8383

examples/esp-now_bridge_light/main/idf_component.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## IDF Component Manager Manifest File
22
dependencies:
3-
espressif/esp-now: ">=2.2.0"
3+
# esp-now 2.5.0 will use 'dcm' member in esp_now_rate_config_t, and that member is introduced after IDF v5.1.2.
4+
# TODO: update esp-now component to the latest version when updating ESP-IDF
5+
espressif/esp-now: "2.4.0"
46
## Required IDF version
57
idf:
68
version: ">=4.1.0"

examples/sleepy_device/CMakeLists.txt examples/icd_app/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ endif(NOT DEFINED ENV{ESP_MATTER_PATH})
99
if(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH})
1010
if("${IDF_TARGET}" STREQUAL "esp32h2")
1111
set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32h2_devkit_c)
12+
elseif("${IDF_TARGET}" STREQUAL "esp32c6")
13+
set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32c6_devkit_c)
1214
else()
1315
message(FATAL_ERROR "Unsupported IDF_TARGET")
1416
endif()
@@ -31,7 +33,7 @@ set(EXTRA_COMPONENT_DIRS
3133
"${ESP_MATTER_PATH}/device_hal/device"
3234
${extra_components_dirs_append})
3335

34-
project(sleepy_device)
36+
project(icd_app)
3537

3638
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-DCONFIG_OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES=5" APPEND)
3739
idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DCONFIG_OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES=5" APPEND)

examples/icd_app/README.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Intermittently Connected Device (ICD)
2+
3+
This example creates a Matter ICD device using the ESP Matter data model. Currently it is available for ESP32-H2 and ESP32-C6.
4+
5+
See the [docs](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html) for more information about building and flashing the firmware.
6+
7+
## 1. Additional Environment Setup
8+
9+
No additional setup is required.
10+
11+
## 2. Post Commissioning Setup
12+
13+
No additional setup is required.
14+
15+
## 3. ICD configuration options
16+
17+
The ICD configuration parameters can be configured in menuconfig.
18+
19+
```
20+
# Enable ICD server
21+
CONFIG_ENABLE_ICD_SERVER=y
22+
# ICD Active mode interval(ms)
23+
CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS=1000
24+
# ICD Active mode threshold(ms)
25+
CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS=1000
26+
# ICD Idle mode interval(s)
27+
CONFIG_ICD_IDLE_MODE_INTERVAL_SEC=60
28+
# ICD Fast Poll interval(ms)
29+
CONFIG_ICD_FAST_POLL_INTERVAL_MS=500
30+
# ICD Slow Poll interval(ms)
31+
CONFIG_ICD_SLOW_POLL_INTERVAL_MS=5000
32+
```
33+
34+
## 4. Power usage
35+
36+
The power usage will be various for different configuration parameters of ICD server.
37+
38+
Below are example current wave figures for ESP32-H2 Devkit-C and ESP32-C6 Devkit-C. The ICD configurations and radio TX power are list in the table.
39+
40+
| Parameter | Value |
41+
|---------------------------|--------|
42+
| ICD Fast Polling Interval | 500ms |
43+
| ICD Slow Polling Interval | 5000ms |
44+
| ICD Active Mode Duration | 1000ms |
45+
| ICD Idle Mode Duration | 60s |
46+
| Radio TX Power | 20dBm |
47+
48+
Current Wave Figure for ESP32-H2:
49+
![power_record_h2](image/power_record_h2.png)
50+
51+
Current Wave Figure for ESP32-C6:
52+
![power_record_c6](image/power_record_c6.png)
53+
54+
**Note**: For ESP32-C6, please use ESP-IDF on branch `release/v5.1` with the commit id [931eaf7320](https://github.com/espressif/esp-idf/tree/931eaf7320b6c0b9acc9711ba4774f4f1bd3dae7).
90.8 KB
Loading
85.3 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
CONFIG_IDF_TARGET="esp32c6"
2+
3+
# libsodium
4+
CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y
5+
6+
# NIMBLE
7+
CONFIG_BT_ENABLED=y
8+
CONFIG_BT_NIMBLE_ENABLED=y
9+
CONFIG_BT_NIMBLE_EXT_ADV=n
10+
CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70
11+
CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=y
12+
13+
# FreeRTOS should use legacy API
14+
CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y
15+
16+
# Enable OpenThread
17+
CONFIG_OPENTHREAD_ENABLED=y
18+
CONFIG_OPENTHREAD_SRP_CLIENT=y
19+
CONFIG_OPENTHREAD_DNS_CLIENT=y
20+
CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n
21+
CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y
22+
CONFIG_OPENTHREAD_CLI=n
23+
24+
# Disable lwip ipv6 autoconfig
25+
CONFIG_LWIP_IPV6_AUTOCONFIG=n
26+
27+
# Use a custom partition table
28+
CONFIG_PARTITION_TABLE_CUSTOM=y
29+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
30+
31+
# LwIP config for OpenThread
32+
CONFIG_LWIP_IPV6_NUM_ADDRESSES=8
33+
CONFIG_LWIP_MULTICAST_PING=y
34+
35+
# MDNS platform
36+
CONFIG_USE_MINIMAL_MDNS=n
37+
CONFIG_ENABLE_EXTENDED_DISCOVERY=y
38+
39+
# Enable OTA Requestor
40+
CONFIG_ENABLE_OTA_REQUESTOR=y
41+
42+
# Disable STA and AP for ESP32H2
43+
CONFIG_ENABLE_WIFI_STATION=n
44+
CONFIG_ENABLE_WIFI_AP=n
45+
46+
# Disable chip shell
47+
CONFIG_ENABLE_CHIP_SHELL=n
48+
49+
# Enable DS Peripheral
50+
CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL=y
51+
52+
# BLE Sleep
53+
CONFIG_BT_LE_SLEEP_ENABLE=y
54+
CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL=y
55+
56+
# Disable external 32K crystal
57+
CONFIG_RTC_CLK_SRC_EXT_CRYS=n
58+
59+
# Enable power management
60+
CONFIG_PM_ENABLE=y
61+
CONFIG_PM_DFS_INIT_AUTO=y
62+
CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
63+
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=n
64+
CONFIG_ESP_PHY_MAC_BB_PD=y
65+
66+
# FreeRTOS config for light sleep
67+
CONFIG_FREERTOS_HZ=1000
68+
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
69+
70+
# Enable IEEE 802.15.4 sleep
71+
CONFIG_IEEE802154_SLEEP_ENABLE=y
72+
73+
# FreeRTOS config for light sleep
74+
CONFIG_LWIP_ND6=n
75+
CONFIG_LWIP_IPV4=n
76+
CONFIG_DISABLE_IPV4=y
77+
78+
# Disable hardware acceleration
79+
CONFIG_MBEDTLS_HARDWARE_AES=n
80+
CONFIG_MBEDTLS_HARDWARE_MPI=n
81+
CONFIG_MBEDTLS_HARDWARE_SHA=n
82+
CONFIG_MBEDTLS_HARDWARE_ECC=n
83+
CONFIG_MBEDTLS_HARDWARE_ECDSA_VERIFY=n
84+
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
85+
86+
# Use OpenThread MTD
87+
CONFIG_OPENTHREAD_MTD=y
88+
89+
# ICD configurations
90+
CONFIG_ENABLE_ICD_SERVER=y
91+
CONFIG_ICD_FAST_POLL_INTERVAL_MS=500
92+
CONFIG_ICD_IDLE_MODE_INTERVAL_SEC=60
93+
CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS=1000
94+
CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS=1000

examples/sleepy_device/README.md

-39
This file was deleted.
-129 KB
Binary file not shown.

examples/sleepy_device/main/idf_component.yml

-6
This file was deleted.

0 commit comments

Comments
 (0)