From d25e5de7c976ad7efb7965e50f674ac3115f1bb9 Mon Sep 17 00:00:00 2001 From: liyashuai Date: Mon, 9 Jun 2025 21:03:31 +0800 Subject: [PATCH] target: add esp32c5 support --- .gitlab-ci.yml | 6 +- README.md | 1 + device_hal/device/esp32c5_devkit_c/device.c | 42 +++++++++++ .../esp32c5_devkit_c/esp_matter_device.cmake | 11 +++ docs/_static/esp_sdk_matter_version.js | 3 +- docs/conf_common.py | 2 +- docs/en/certification.rst | 4 +- docs/en/developing.rst | 54 +++++++++----- docs/en/introduction.rst | 2 +- docs/en/security.rst | 2 +- .../door_lock/sdkconfig.defaults.c5_thread | 51 +++++++++++++ examples/icd_app/main/CMakeLists.txt | 5 ++ examples/icd_app/main/Kconfig.projbuild | 1 + .../icd_app/sdkconfig.defaults.esp32c5.lit | 69 ++++++++++++++++++ examples/light/CMakeLists.txt | 2 + examples/light/sdkconfig.defaults.c5_thread | 59 +++++++++++++++ .../light/sdkconfig.defaults.c5_wifi_thread | 72 +++++++++++++++++++ examples/light/sdkconfig.defaults.esp32c5 | 1 + .../light_switch/sdkconfig.defaults.esp32c5 | 8 +++ .../sdkconfig.defaults.c5_thread | 47 ++++++++++++ .../refrigerator/sdkconfig.defaults.esp32c5 | 8 +++ 21 files changed, 425 insertions(+), 25 deletions(-) create mode 100644 device_hal/device/esp32c5_devkit_c/device.c create mode 100644 device_hal/device/esp32c5_devkit_c/esp_matter_device.cmake create mode 100644 examples/door_lock/sdkconfig.defaults.c5_thread create mode 100644 examples/icd_app/sdkconfig.defaults.esp32c5.lit create mode 100644 examples/light/sdkconfig.defaults.c5_thread create mode 100644 examples/light/sdkconfig.defaults.c5_wifi_thread create mode 100644 examples/light/sdkconfig.defaults.esp32c5 create mode 100644 examples/light_switch/sdkconfig.defaults.esp32c5 create mode 100644 examples/multiple_on_off_plugin_units/sdkconfig.defaults.c5_thread create mode 100644 examples/refrigerator/sdkconfig.defaults.esp32c5 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7cb3763ed..2834f855a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -632,7 +632,7 @@ build_esp_rainmaker_apps: build_docs: stage: build - image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.1:1-1 + image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.5:3-1 rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "main" || $CI_PIPELINE_SOURCE == "push" tags: @@ -648,13 +648,13 @@ build_docs: script: - cd docs - pip install -r requirements.txt - - build-docs -t esp32 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4 -l en + - build-docs -t esp32 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4 esp32c5 -l en # disable link checks for now, as it is failing due to some links taking longer time to respond # - build-docs -t esp32 -l en linkcheck .deploy_docs_template: stage: docs - image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.1:1-1 + image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.5:3-1 tags: - docs needs: diff --git a/README.md b/README.md index cf9a61cf8..a688e56b5 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ section in the ESP-Matter Programming Guide. - This SDK currently works with commit [d144bbbaae] (https://github.com/project-chip/connectedhomeip/tree/d144bbbaae) of connectedhomeip. - For Matter projects development with this SDK, it is recommended to utilize ESP-IDF [v5.4.1](https://github.com/espressif/esp-idf/tree/v5.4.1). +- For ESP32C5, it is recommended to utilize ESP-IDF [98cd765953](https://github.com/espressif/esp-idf/commit/98cd765953dfe0e7bb1c5df8367e1b54bd966cce). ## Documentation diff --git a/device_hal/device/esp32c5_devkit_c/device.c b/device_hal/device/esp32c5_devkit_c/device.c new file mode 100644 index 000000000..69bb5bf31 --- /dev/null +++ b/device_hal/device/esp32c5_devkit_c/device.c @@ -0,0 +1,42 @@ +// Copyright 2025 Espressif Systems (Shanghai) CO LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License + +#include +#include +#include +#include +#include + +#define LED_GPIO_PIN GPIO_NUM_27 +#define LED_CHANNEL 0 /* RMT_CHANNEL_0 */ +#define BUTTON_GPIO_PIN GPIO_NUM_28 + +static const char *TAG = "device"; + +led_driver_config_t led_driver_get_config() +{ + led_driver_config_t config = { + .gpio = LED_GPIO_PIN, + .channel = LED_CHANNEL, + }; + return config; +} + +button_gpio_config_t button_driver_get_config() +{ + button_gpio_config_t config = { + .gpio_num = BUTTON_GPIO_PIN, + .active_level = 0, + }; + return config; +} diff --git a/device_hal/device/esp32c5_devkit_c/esp_matter_device.cmake b/device_hal/device/esp32c5_devkit_c/esp_matter_device.cmake new file mode 100644 index 000000000..ac606e4c6 --- /dev/null +++ b/device_hal/device/esp32c5_devkit_c/esp_matter_device.cmake @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.5) +if (NOT ("${IDF_TARGET}" STREQUAL "esp32c5" )) + message(FATAL_ERROR "please set esp32c5 as the IDF_TARGET using 'idf.py --preview set-target esp32c5'") +endif() + +SET(device_type esp32c5_devkit_c) +SET(led_type ws2812) +SET(button_type iot) + +SET(extra_components_dirs_append "$ENV{ESP_MATTER_DEVICE_PATH}/../../led_driver" + "$ENV{ESP_MATTER_DEVICE_PATH}/../../button_driver/iot_button") diff --git a/docs/_static/esp_sdk_matter_version.js b/docs/_static/esp_sdk_matter_version.js index c101fefb3..6e758dd0a 100644 --- a/docs/_static/esp_sdk_matter_version.js +++ b/docs/_static/esp_sdk_matter_version.js @@ -3,13 +3,14 @@ var DOCUMENTATION_VERSIONS = { supported_targets: [ "esp32" ] }, VERSIONS: [ - { name: "latest", has_targets: true, supported_targets: [ "esp32", "esp32c2", "esp32c3", "esp32c6", "esp32s3", "esp32h2", "esp32p4" ] }, + { name: "latest", has_targets: true, supported_targets: [ "esp32", "esp32c2", "esp32c3", "esp32c5", "esp32c6", "esp32s3", "esp32h2", "esp32p4" ] }, ], IDF_TARGETS: [ { text: "ESP32", value: "esp32" }, { text: "ESP32-S3", value: "esp32s3" }, { text: "ESP32-C2", value: "esp32c2" }, { text: "ESP32-C3", value: "esp32c3" }, + { text: "ESP32-C5", value: "esp32c5" }, { text: "ESP32-C6", value: "esp32c6" }, { text: "ESP32-H2", value: "esp32h2" }, { text: "ESP32-P4", value: "esp32p4" }, diff --git a/docs/conf_common.py b/docs/conf_common.py index 7dd9d2409..187675036 100644 --- a/docs/conf_common.py +++ b/docs/conf_common.py @@ -2,7 +2,7 @@ from esp_docs.conf_docs import * # noqa: F403,F401 import subprocess languages = ['en'] -idf_targets = ['esp32', 'esp32s3', 'esp32c2', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4'] +idf_targets = ['esp32', 'esp32s3', 'esp32c2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32h2', 'esp32p4'] extensions += ['sphinx_copybutton', # Needed as a trigger for running doxygen diff --git a/docs/en/certification.rst b/docs/en/certification.rst index 0e507256a..7ba1fe0ff 100644 --- a/docs/en/certification.rst +++ b/docs/en/certification.rst @@ -99,7 +99,7 @@ The option ``-n`` (count) is the number of generated binaries. In the above comm The option ``--paa-trust-store-path`` should be added when using chip-tool to pair the device for manual tests. -.. only:: esp32 or esp32s3 or esp32c3 or esp32c2 or esp32c6 +.. only:: esp32 or esp32s3 or esp32c3 or esp32c2 or esp32c6 or esp32c5 :: @@ -110,7 +110,7 @@ The option ``--paa-trust-store-path`` should be added when using chip-tool to pa or -.. only:: esp32h2 or esp32c6 +.. only:: esp32h2 or esp32c6 or esp32c5 :: diff --git a/docs/en/developing.rst b/docs/en/developing.rst index 1a54f0aeb..8027aaca6 100644 --- a/docs/en/developing.rst +++ b/docs/en/developing.rst @@ -15,7 +15,7 @@ This section talks about setting up ESP-IDF. You should install drivers and support packages for your development host. Linux and Mac OS-X are the supported development hosts in Matter, the recommended host versions: -- Ubuntu 20.04 or 22.04 LTS +- Ubuntu 20.04 or 22.04 or 24.04 LTS - macOS 10.15 or later Additionally, we also support developing on Windows Host using WSL. @@ -52,20 +52,36 @@ The Prerequisites for ESP-IDF: - Please get the `Prerequisites for ESP-IDF`_. For beginners, please check `step by step installation guide`_ for esp-idf. +.. only:: esp32c5 + + - For ``ESP32C5``, the IDF version should be `98cd765953 `__ or newer. + .. note:: ``git clone`` command accepts the optional argument ``--jobs N``, which can significantly speed up the process by parallelizing submodule cloning. Consider using this option when cloning repositories. -Cloning esp-idf: +.. only:: not esp32c5 - :: + Cloning esp-idf: - git clone --recursive https://github.com/espressif/esp-idf.git - cd esp-idf; git checkout v5.4.1; git submodule update --init --recursive; - ./install.sh - cd .. + :: + git clone --recursive https://github.com/espressif/esp-idf.git + cd esp-idf; git checkout v5.4.1; git submodule update --init --recursive; + ./install.sh + cd .. + +.. only:: esp32c5 + + Cloning esp-idf: + + :: + + git clone --recursive https://github.com/espressif/esp-idf.git + cd esp-idf; git checkout 98cd765953; git submodule update --init --recursive; + ./install.sh + cd .. 2.1.3 Configuring the Environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -263,6 +279,12 @@ Choose IDF target. idf.py set-target esp32c6 +.. only:: esp32c5 + + :: + + idf.py --preview set-target esp32c5 + .. only:: esp32p4 :: @@ -299,9 +321,9 @@ Choose IDF target. idf.py -C managed_components/espressif__esp_hosted/slave/ -B build_slave set-target esp32c6 idf.py -C managed_components/espressif__esp_hosted/slave/ -B build_slave build flash monitor -.. only:: esp32c6 +.. only:: esp32c5 or esp32c6 - - ESP32-C6 supports both the Wi-Fi and IEEE 802.15.4 radio, so you can run Wi-Fi or Thread matter example on it. + - {IDF_TARGET_NAME} supports both the Wi-Fi and IEEE 802.15.4 radio, so you can run Wi-Fi or Thread matter example on it. - To enable Thread, you should change the menuconfig options to ``CONFIG_OPENTHREAD_ENABLED=y``, ``CONFIG_ENABLE_WIFI_STATION=n``, and ``CONFIG_USE_MINIMAL_MDNS=n``. - To enable Wi-Fi. you should change the menuconfig options to ``CONFIG_OPENTHREAD_ENABLED=n``, ``CONFIG_ENABLE_WIFI_STATION=y``, and ``CONFIG_USE_MINIMAL_MDNS=y``. @@ -359,7 +381,7 @@ Use ``chip-tool`` in interactive mode to commission the device: chip-tool interactive start -.. only:: esp32 or esp32s3 or esp32c3 or esp32c2 or esp32c6 or esp32p4 +.. only:: esp32 or esp32s3 or esp32c3 or esp32c2 or esp32c6 or esp32p4 or esp32c5 :: @@ -369,7 +391,7 @@ Use ``chip-tool`` in interactive mode to commission the device: or -.. only:: esp32h2 or esp32c6 +.. only:: esp32h2 or esp32c6 or esp32c5 :: @@ -386,7 +408,7 @@ Above method commissions the device using setup passcode and discriminator. Devi To Commission the device using manual pairing code 34970112332 -.. only:: esp32 or esp32s3 or esp32c3 or esp32c2 or esp32c6 or esp32p4 +.. only:: esp32 or esp32s3 or esp32c3 or esp32c2 or esp32c6 or esp32p4 or esp32c5 :: @@ -396,7 +418,7 @@ To Commission the device using manual pairing code 34970112332 or -.. only:: esp32h2 or esp32c6 +.. only:: esp32h2 or esp32c6 or esp32c5 :: @@ -413,7 +435,7 @@ Above default manual pairing code contains following values: To commission the device using QR code MT:Y.K9042C00KA0648G00 -.. only:: esp32 or esp32s3 or esp32c3 or esp32c2 or esp32c6 or esp32p4 +.. only:: esp32 or esp32s3 or esp32c3 or esp32c2 or esp32c6 or esp32p4 or esp32c5 :: @@ -423,7 +445,7 @@ To commission the device using QR code MT:Y.K9042C00KA0648G00 or -.. only:: esp32h2 or esp32c6 +.. only:: esp32h2 or esp32c6 or esp32c5 :: @@ -571,7 +593,7 @@ Additional Matter specific commands: matter esp wifi connect -.. only:: esp32h2 or esp32c6 +.. only:: esp32h2 or esp32c6 or esp32c5 - OpenThread command line: diff --git a/docs/en/introduction.rst b/docs/en/introduction.rst index 2f28e51aa..c3f99d55f 100644 --- a/docs/en/introduction.rst +++ b/docs/en/introduction.rst @@ -26,7 +26,7 @@ Espressif platform solutions are as shown below: :figclass: align-center - The Wi-Fi-enabled SoCs and modules, such as ESP32, ESP32-C and ESP32-S series can be used to build **Matter Wi-Fi devices**. -- ESP32-H SoCs and modules with 802.15.4 can be used to build **Matter Thread devices**. +- SoCs and modules(ESP32-H series, ESP32-C5, and ESP32-C6) with 802.15.4 can be used to build **Matter Thread devices**. - By efficiently combining ESP32-H and our Wi-Fi SoCs, a **Thread Border Router** can be built to connect the Thread network with the Wi-Fi network. We provide hardware devkits, reference designs and production-ready SDK, which supports the latest Thread 1.3 feature for Matter. - We also provide Matter-Zigbee and Matter-BLE Mesh bridge solutions that enable non-Matter devices based on Zigbee, Bluetooth LE Mesh and other protocols to connect to the Matter ecosystem. A **Matter-Zigbee Bridge** uses ESP32-H and another Wi-Fi SoC, while a **Matter-BLE Mesh Bridge** can be done on a single SoC with both Wi-Fi and Bluetooth LE interfaces. diff --git a/docs/en/security.rst b/docs/en/security.rst index d2a66424d..b0f303b05 100644 --- a/docs/en/security.rst +++ b/docs/en/security.rst @@ -59,7 +59,7 @@ DAC private needs to be protected from remote as well as physical attacks in the Recommended ways for DAC private key protection: -.. only:: esp32h2 +.. only:: esp32h2 or esp32c5 - {IDF_TARGET_NAME} supports ECDSA hardware peripheral with the ECDSA key programmed in the eFuse. This key is software read protected (in default mode). This peripheral can help to protect the identity of the DAC private key on the device. diff --git a/examples/door_lock/sdkconfig.defaults.c5_thread b/examples/door_lock/sdkconfig.defaults.c5_thread new file mode 100644 index 000000000..4bd2885bf --- /dev/null +++ b/examples/door_lock/sdkconfig.defaults.c5_thread @@ -0,0 +1,51 @@ +CONFIG_IDF_TARGET="esp32c5" + +# libsodium +CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y + +# NIMBLE +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_EXT_ADV=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n + +# FreeRTOS should use legacy API +CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y + +# Enable OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_SRP_CLIENT=y +CONFIG_OPENTHREAD_DNS_CLIENT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y +CONFIG_OPENTHREAD_CLI=n + +# Disable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=n + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" + +# LwIP config for OpenThread +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# MDNS platform +CONFIG_USE_MINIMAL_MDNS=n +CONFIG_ENABLE_EXTENDED_DISCOVERY=y + +# Enable OTA Requestor +CONFIG_ENABLE_OTA_REQUESTOR=y + +# Disable STA and AP for ESP32C5 +CONFIG_ENABLE_WIFI_STATION=n +CONFIG_ENABLE_WIFI_AP=n + +# Button +CONFIG_BUTTON_PERIOD_TIME_MS=20 +CONFIG_BUTTON_LONG_PRESS_TIME_MS=5000 + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y diff --git a/examples/icd_app/main/CMakeLists.txt b/examples/icd_app/main/CMakeLists.txt index 43626a795..28a6b519d 100644 --- a/examples/icd_app/main/CMakeLists.txt +++ b/examples/icd_app/main/CMakeLists.txt @@ -3,3 +3,8 @@ idf_component_register(SRC_DIRS "." set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") + +if (CONFIG_IDF_TARGET_ESP32C5) + idf_component_get_property(openthread_lib openthread COMPONENT_LIB) + target_link_libraries(${COMPONENT_LIB} PUBLIC $) +endif() diff --git a/examples/icd_app/main/Kconfig.projbuild b/examples/icd_app/main/Kconfig.projbuild index 31f30ff58..11d5b7655 100644 --- a/examples/icd_app/main/Kconfig.projbuild +++ b/examples/icd_app/main/Kconfig.projbuild @@ -12,6 +12,7 @@ menu "Example Configuration" range 0 7 if IDF_TARGET_ESP32C6 default 9 if IDF_TARGET_ESP32H2 default 7 if IDF_TARGET_ESP32C6 + default 28 if IDF_TARGET_ESP32C5 help GPIO number of the active mode trigger button. Note that the boot button of ESP32-C6 DevKits is GPIO9 which cannot be used to wake up the chip. diff --git a/examples/icd_app/sdkconfig.defaults.esp32c5.lit b/examples/icd_app/sdkconfig.defaults.esp32c5.lit new file mode 100644 index 000000000..79552bbdb --- /dev/null +++ b/examples/icd_app/sdkconfig.defaults.esp32c5.lit @@ -0,0 +1,69 @@ +# sdkconfig for ESP32-C5 LIT ICD example + +CONFIG_IDF_TARGET="esp32c5" +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_OFFSET=0xC000 + +# BLE +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n +CONFIG_BT_LE_SLEEP_ENABLE=y +CONFIG_ESP_PHY_MAC_BB_PD=y + +# Power Management +CONFIG_PM_ENABLE=y +CONFIG_PM_DFS_INIT_AUTO=y +CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y + +# Disable Wi-Fi +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n +CONFIG_ENABLE_WIFI_STATION=n + +# FreeRTOS +CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y + +# IEEE802.15.4 +CONFIG_IEEE802154_SLEEP_ENABLE=y + +# LwIP +CONFIG_LWIP_ND6=n +CONFIG_LWIP_IPV4=n +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# MbedTLS +CONFIG_MBEDTLS_SSL_PROTO_DTLS=y +CONFIG_MBEDTLS_HKDF_C=y + +# OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_CLI=n + +# Use Platform mDNS +CONFIG_USE_MINIMAL_MDNS=n + +# Matter Configuration +CONFIG_DISABLE_IPV4=y +CONFIG_ENABLE_OTA_REQUESTOR=y +CONFIG_ENABLE_EXTENDED_DISCOVERY=y + +# ICD Server +CONFIG_ENABLE_ICD_SERVER=y +CONFIG_ICD_SLOW_POLL_INTERVAL_MS=20000 +CONFIG_ICD_FAST_POLL_INTERVAL_MS=500 +CONFIG_ICD_IDLE_MODE_INTERVAL_SEC=600 +CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS=1000 +CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS=5000 +CONFIG_ENABLE_ICD_LIT=y +CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC=2 +CONFIG_ICD_MAX_NOTIFICATION_SUBSCRIBERS=2 + +# Enable power save for the button +CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE=y diff --git a/examples/light/CMakeLists.txt b/examples/light/CMakeLists.txt index cc2c0386c..7a8bb37a6 100644 --- a/examples/light/CMakeLists.txt +++ b/examples/light/CMakeLists.txt @@ -19,6 +19,8 @@ if(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32s3_devkit_c) elseif("${IDF_TARGET}" STREQUAL "esp32c6") set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32c6_devkit_c) + elseif("${IDF_TARGET}" STREQUAL "esp32c5") + set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32c5_devkit_c) elseif("${IDF_TARGET}" STREQUAL "esp32p4") set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/hollow) else() diff --git a/examples/light/sdkconfig.defaults.c5_thread b/examples/light/sdkconfig.defaults.c5_thread new file mode 100644 index 000000000..710bc9f4d --- /dev/null +++ b/examples/light/sdkconfig.defaults.c5_thread @@ -0,0 +1,59 @@ +CONFIG_IDF_TARGET="esp32c5" + +# libsodium +CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y + +# NIMBLE +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_EXT_ADV=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n + +# Enable OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_SRP_CLIENT=y +CONFIG_OPENTHREAD_DNS_CLIENT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y +CONFIG_OPENTHREAD_CLI=n + +# Disable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=n + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" + +# LwIP config for OpenThread +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# MDNS platform +CONFIG_USE_MINIMAL_MDNS=n +CONFIG_ENABLE_EXTENDED_DISCOVERY=y + +# Enable OTA Requestor +CONFIG_ENABLE_OTA_REQUESTOR=y + +# Disable STA for ESP32C5 +CONFIG_ENABLE_WIFI_STATION=n + +# Button +CONFIG_BUTTON_PERIOD_TIME_MS=20 +CONFIG_BUTTON_LONG_PRESS_TIME_MS=5000 + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y + +# ESP32-C5-DevKitC-1 Settings +# Buttons +CONFIG_BSP_BUTTONS_NUM=1 +CONFIG_BSP_BUTTON_1_TYPE_GPIO=y +CONFIG_BSP_BUTTON_1_GPIO=28 +CONFIG_BSP_BUTTON_1_LEVEL=0 +# LEDs +CONFIG_BSP_LEDS_NUM=1 +CONFIG_BSP_LED_TYPE_RGB=y +CONFIG_BSP_LED_RGB_GPIO=27 +CONFIG_BSP_LED_RGB_BACKEND_RMT=y diff --git a/examples/light/sdkconfig.defaults.c5_wifi_thread b/examples/light/sdkconfig.defaults.c5_wifi_thread new file mode 100644 index 000000000..d136268fc --- /dev/null +++ b/examples/light/sdkconfig.defaults.c5_wifi_thread @@ -0,0 +1,72 @@ +CONFIG_IDF_TARGET="esp32c5" + +# libsodium +CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y + +# NIMBLE +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_EXT_ADV=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n + +# Enable OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_SRP_CLIENT=y +CONFIG_OPENTHREAD_DNS_CLIENT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y +CONFIG_OPENTHREAD_CLI=n + +# Disable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=n + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" + +# LwIP config for OpenThread +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# MDNS platform +CONFIG_USE_MINIMAL_MDNS=n +CONFIG_ENABLE_EXTENDED_DISCOVERY=y + +# Enable OTA Requestor +CONFIG_ENABLE_OTA_REQUESTOR=y + +# Disable AP +CONFIG_ENABLE_WIFI_STATION=y +CONFIG_ENABLE_WIFI_AP=n + +# Button +CONFIG_BUTTON_PERIOD_TIME_MS=20 +CONFIG_BUTTON_LONG_PRESS_TIME_MS=5000 + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y + +# ESP32-C5-DevKitC-1 Settings +# Buttons +CONFIG_BSP_BUTTONS_NUM=1 +CONFIG_BSP_BUTTON_1_TYPE_GPIO=y +CONFIG_BSP_BUTTON_1_GPIO=28 +CONFIG_BSP_BUTTON_1_LEVEL=0 +# LEDs +CONFIG_BSP_LEDS_NUM=1 +CONFIG_BSP_LED_TYPE_RGB=y +CONFIG_BSP_LED_RGB_GPIO=27 +CONFIG_BSP_LED_RGB_BACKEND_RMT=y + +# Firmware size optimization +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y +CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS=y +CONFIG_NEWLIB_NANO_FORMAT=y +CONFIG_ESP_ERR_TO_NAME_LOOKUP=n + +# Set endpoint id for Thread and Wi-Fi, depending on the secondary network interface endpoint id. +CONFIG_THREAD_NETWORK_ENDPOINT_ID=2 +CONFIG_WIFI_NETWORK_ENDPOINT_ID=0 diff --git a/examples/light/sdkconfig.defaults.esp32c5 b/examples/light/sdkconfig.defaults.esp32c5 new file mode 100644 index 000000000..164b924b9 --- /dev/null +++ b/examples/light/sdkconfig.defaults.esp32c5 @@ -0,0 +1 @@ +CONFIG_IDF_TARGET="esp32c5" diff --git a/examples/light_switch/sdkconfig.defaults.esp32c5 b/examples/light_switch/sdkconfig.defaults.esp32c5 new file mode 100644 index 000000000..2686bf254 --- /dev/null +++ b/examples/light_switch/sdkconfig.defaults.esp32c5 @@ -0,0 +1,8 @@ +CONFIG_IDF_TARGET="esp32c5" + +# ESP32-C5-DevKitC-1 Settings +# Buttons +CONFIG_BSP_BUTTONS_NUM=1 +CONFIG_BSP_BUTTON_1_TYPE_GPIO=y +CONFIG_BSP_BUTTON_1_GPIO=28 +CONFIG_BSP_BUTTON_1_LEVEL=0 diff --git a/examples/multiple_on_off_plugin_units/sdkconfig.defaults.c5_thread b/examples/multiple_on_off_plugin_units/sdkconfig.defaults.c5_thread new file mode 100644 index 000000000..4962df436 --- /dev/null +++ b/examples/multiple_on_off_plugin_units/sdkconfig.defaults.c5_thread @@ -0,0 +1,47 @@ +CONFIG_IDF_TARGET="esp32c5" + +# libsodium +CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y + +# NIMBLE +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_EXT_ADV=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n + +# FreeRTOS should use legacy API +CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y + +# Enable OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_SRP_CLIENT=y +CONFIG_OPENTHREAD_DNS_CLIENT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y +CONFIG_OPENTHREAD_CLI=n + +# Disable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=n + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" + +# LwIP config for OpenThread +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# MDNS platform +CONFIG_USE_MINIMAL_MDNS=n +CONFIG_ENABLE_EXTENDED_DISCOVERY=y + +# Enable OTA Requestor +CONFIG_ENABLE_OTA_REQUESTOR=y + +# Disable STA and AP for ESP32C5 +CONFIG_ENABLE_WIFI_STATION=n +CONFIG_ENABLE_WIFI_AP=n + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y diff --git a/examples/refrigerator/sdkconfig.defaults.esp32c5 b/examples/refrigerator/sdkconfig.defaults.esp32c5 new file mode 100644 index 000000000..2686bf254 --- /dev/null +++ b/examples/refrigerator/sdkconfig.defaults.esp32c5 @@ -0,0 +1,8 @@ +CONFIG_IDF_TARGET="esp32c5" + +# ESP32-C5-DevKitC-1 Settings +# Buttons +CONFIG_BSP_BUTTONS_NUM=1 +CONFIG_BSP_BUTTON_1_TYPE_GPIO=y +CONFIG_BSP_BUTTON_1_GPIO=28 +CONFIG_BSP_BUTTON_1_LEVEL=0