From ff3b28bdc11fff7c2b82cfa27fdae0b8a58982d2 Mon Sep 17 00:00:00 2001 From: Alexander Begoon Date: Wed, 15 Jan 2025 17:33:59 +0100 Subject: [PATCH 1/2] Add support of ESP32C6 to OTBR example --- .gitignore | 2 ++ examples/thread_border_router/CMakeLists.txt | 2 ++ examples/thread_border_router/README.md | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a70301abf1..17a64cd7a3 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ out/ _build/ tools/chip-tool/ .zap/ +.idea +cmake-build-* \ No newline at end of file diff --git a/examples/thread_border_router/CMakeLists.txt b/examples/thread_border_router/CMakeLists.txt index 3a1f2cc6bc..fad9339469 100644 --- a/examples/thread_border_router/CMakeLists.txt +++ b/examples/thread_border_router/CMakeLists.txt @@ -9,6 +9,8 @@ endif(NOT DEFINED ENV{ESP_MATTER_PATH}) if(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) if("${IDF_TARGET}" STREQUAL "esp32s3") 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) else() message(FATAL_ERROR "Unsupported IDF_TARGET") endif() diff --git a/examples/thread_border_router/README.md b/examples/thread_border_router/README.md index ffc1368a37..e56bedc62e 100644 --- a/examples/thread_border_router/README.md +++ b/examples/thread_border_router/README.md @@ -9,7 +9,7 @@ See the [docs](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/de ### 1.1 Hardware Platform -The [ESP Thread Border Router board](https://github.com/espressif/esp-thread-br?tab=readme-ov-file#esp-thread-border-router-board) which provides an integrated module of an ESP32-S3 and an ESP32-H2 is required for this example. +The [ESP Thread Border Router board](https://github.com/espressif/esp-thread-br?tab=readme-ov-file#esp-thread-border-router-board) which provides an integrated module of an ESP32-S3 and an ESP32-H2 is required for this example. Alternatively, the ESP32-S3 and ESP32-H2 might be replaced by the ESP32-C6. ### 1.2 Firmware for RCP From ff6e341726602466c494a295493dc2344561af80 Mon Sep 17 00:00:00 2001 From: Alexander Begoon Date: Wed, 22 Jan 2025 13:39:41 +0100 Subject: [PATCH 2/2] Add support of ESP32C6 to OTBR example --- .gitignore | 3 ++- examples/controller/CMakeLists.txt | 2 ++ examples/controller/main/esp_ot_config.h | 11 +++++++++-- examples/thread_border_router/main/esp_ot_config.h | 11 +++++++++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 17a64cd7a3..5f57a43fdd 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ _build/ tools/chip-tool/ .zap/ .idea -cmake-build-* \ No newline at end of file +cmake-build-* +venv \ No newline at end of file diff --git a/examples/controller/CMakeLists.txt b/examples/controller/CMakeLists.txt index d83cf47cb6..4142c0d9ff 100644 --- a/examples/controller/CMakeLists.txt +++ b/examples/controller/CMakeLists.txt @@ -13,6 +13,8 @@ if(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32c3_devkit_m) elseif("${IDF_TARGET}" STREQUAL "esp32s3") 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) else() message(FATAL_ERROR "Unsupported IDF_TARGET") endif() diff --git a/examples/controller/main/esp_ot_config.h b/examples/controller/main/esp_ot_config.h index 76d8faf230..6c672d701b 100644 --- a/examples/controller/main/esp_ot_config.h +++ b/examples/controller/main/esp_ot_config.h @@ -24,6 +24,13 @@ .radio_mode = RADIO_MODE_NATIVE, \ } #elif CONFIG_OPENTHREAD_RADIO_SPINEL_UART +#ifdef CONFIG_IDF_TARGET_ESP32C6 +#define UART_RX_PIN GPIO_NUM_17 +#define UART_TX_PIN GPIO_NUM_16 +#else +#define UART_RX_PIN GPIO_NUM_17 +#define UART_TX_PIN GPIO_NUM_18 +#endif #define ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG() \ { \ .radio_mode = RADIO_MODE_UART_RCP, \ @@ -39,8 +46,8 @@ .rx_flow_ctrl_thresh = 0, \ .source_clk = UART_SCLK_DEFAULT, \ }, \ - .rx_pin = GPIO_NUM_17, \ - .tx_pin = GPIO_NUM_18, \ + .rx_pin = UART_RX_PIN, \ + .tx_pin = UART_TX_PIN, \ }, \ } #else diff --git a/examples/thread_border_router/main/esp_ot_config.h b/examples/thread_border_router/main/esp_ot_config.h index e73f8cf961..bd8f779183 100644 --- a/examples/thread_border_router/main/esp_ot_config.h +++ b/examples/thread_border_router/main/esp_ot_config.h @@ -25,6 +25,13 @@ .radio_mode = RADIO_MODE_NATIVE, \ } #elif CONFIG_OPENTHREAD_RADIO_SPINEL_UART +#ifdef CONFIG_IDF_TARGET_ESP32C6 +#define UART_RX_PIN GPIO_NUM_17 +#define UART_TX_PIN GPIO_NUM_16 +#else +#define UART_RX_PIN GPIO_NUM_17 +#define UART_TX_PIN GPIO_NUM_18 +#endif #define ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG() \ { \ .radio_mode = RADIO_MODE_UART_RCP, \ @@ -40,8 +47,8 @@ .rx_flow_ctrl_thresh = 0, \ .source_clk = UART_SCLK_DEFAULT, \ }, \ - .rx_pin = GPIO_NUM_17, \ - .tx_pin = GPIO_NUM_18, \ + .rx_pin = UART_RX_PIN, \ + .tx_pin = UART_TX_PIN, \ }, \ } #else