From 3a6516bda34420a6bf87939d7ed3b7ec9a33bb68 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:07:22 -0300 Subject: [PATCH 1/2] feat(esp32c61): Add support for ESP32-C61 --- .github/workflows/push.yml | 12 ++++++- configs/builds.json | 69 +++++++++++++++++++++++--------------- configs/defconfig.esp32c5 | 4 --- configs/defconfig.esp32c61 | 13 +++++++ tools/copy-libs.sh | 13 ++++--- 5 files changed, 75 insertions(+), 36 deletions(-) create mode 100644 configs/defconfig.esp32c61 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c76e45a6b..c97e3ebc8 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -25,7 +25,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2, esp32p4, esp32c5] + target: + - esp32 + - esp32c2 + - esp32c3 + - esp32c5 + - esp32c6 + - esp32c61 + - esp32h2 + - esp32p4 + - esp32s2 + - esp32s3 fail-fast: false steps: - name: Checkout repository diff --git a/configs/builds.json b/configs/builds.json index d40c15d2f..7fb7518b1 100644 --- a/configs/builds.json +++ b/configs/builds.json @@ -4,7 +4,7 @@ "file":"libspi_flash.a", "src":"build/esp-idf/spi_flash/libspi_flash.a", "out":"lib/libspi_flash.a", - "targets":["esp32","esp32c2","esp32c3","esp32s2","esp32s3","esp32c6","esp32h2","esp32p4","esp32c5"] + "targets":["esp32","esp32c2","esp32c3","esp32c5","esp32c6","esp32c61","esp32h2","esp32p4","esp32s2","esp32s3"] }, { "file":"libesp_psram.a", @@ -45,7 +45,7 @@ ], "targets":[ { - "target": "esp32c5", + "target": "esp32", "features":["qio_ram"], "idf_libs":["qio","80m"], "bootloaders":[ @@ -58,20 +58,6 @@ ["dio","80m"] ] }, - { - "target": "esp32p4", - "features":["qio_ram","esp_sr"], - "idf_libs":["qio","80m_200m"], - "bootloaders":[ - ["qio","80m_200m"], - ["dio","80m_200m"], - ["qio","40m_200m"], - ["dio","40m_200m"] - ], - "mem_variants":[ - ["dio","80m_200m"] - ] - }, { "target": "esp32c2", "skip": 1, @@ -88,22 +74,22 @@ ] }, { - "target": "esp32h2", + "target": "esp32c3", "features":[], - "idf_libs":["qio","64m"], + "idf_libs":["qio","80m"], "bootloaders":[ - ["qio","64m"], - ["dio","64m"], - ["qio","16m"], - ["dio","16m"] + ["qio","80m"], + ["dio","80m"], + ["qio","40m"], + ["dio","40m"] ], "mem_variants":[ - ["dio","64m"] + ["dio","80m"] ] }, { - "target": "esp32c6", - "features":[], + "target": "esp32c5", + "features":["qio_ram"], "idf_libs":["qio","80m"], "bootloaders":[ ["qio","80m"], @@ -116,7 +102,7 @@ ] }, { - "target": "esp32c3", + "target": "esp32c6", "features":[], "idf_libs":["qio","80m"], "bootloaders":[ @@ -130,7 +116,8 @@ ] }, { - "target": "esp32", + "target": "esp32c61", + "skip": 1, "features":["qio_ram"], "idf_libs":["qio","80m"], "bootloaders":[ @@ -143,6 +130,34 @@ ["dio","80m"] ] }, + { + "target": "esp32h2", + "features":[], + "idf_libs":["qio","64m"], + "bootloaders":[ + ["qio","64m"], + ["dio","64m"], + ["qio","16m"], + ["dio","16m"] + ], + "mem_variants":[ + ["dio","64m"] + ] + }, + { + "target": "esp32p4", + "features":["qio_ram","esp_sr"], + "idf_libs":["qio","80m_200m"], + "bootloaders":[ + ["qio","80m_200m"], + ["dio","80m_200m"], + ["qio","40m_200m"], + ["dio","40m_200m"] + ], + "mem_variants":[ + ["dio","80m_200m"] + ] + }, { "target": "esp32s2", "features":["qio_ram"], diff --git a/configs/defconfig.esp32c5 b/configs/defconfig.esp32c5 index 2ad03f3ac..4a71edfd3 100644 --- a/configs/defconfig.esp32c5 +++ b/configs/defconfig.esp32c5 @@ -15,10 +15,6 @@ CONFIG_BT_NIMBLE_NVS_PERSIST=y CONFIG_RTC_CLK_CAL_CYCLES=576 # CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304 -# This Enables RISCV LP for C6 - but it can't be used within Arduino at this time. -#CONFIG_ULP_COPROC_ENABLED=y -#CONFIG_ULP_COPROC_LP_CORE=y -#CONFIG_ULP_COPROC_RESERVE_MEM=4096 # # OpenThread diff --git a/configs/defconfig.esp32c61 b/configs/defconfig.esp32c61 new file mode 100644 index 000000000..923b9d37c --- /dev/null +++ b/configs/defconfig.esp32c61 @@ -0,0 +1,13 @@ +CONFIG_SPIRAM=y + +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n +CONFIG_BTDM_CTRL_MODE_BTDM=n +CONFIG_BT_BLUEDROID_ENABLED=n +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_BLUFI_ENABLE=y +CONFIG_BT_NIMBLE_NVS_PERSIST=y +CONFIG_RTC_CLK_CAL_CYCLES=576 +# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304 diff --git a/tools/copy-libs.sh b/tools/copy-libs.sh index a49b851f0..8b36360da 100755 --- a/tools/copy-libs.sh +++ b/tools/copy-libs.sh @@ -452,10 +452,15 @@ for item; do mkdir -p "$out_cpath$rel_p" cp -n $f "$out_cpath$rel_p/" done - # Temporary measure to fix issues caused by https://github.com/espressif/esp-idf/commit/dc4731101dd567cc74bbe4d0f03afe52b7db9afb#diff-1d2ce0d3989a80830fdf230bcaafb3117f32046d16cf46616ac3d55b4df2a988R17 - if [[ "$fname" == "bt" && "$out_sub" == "/include/$IDF_TARGET/include" && -f "$ipath/controller/$IDF_TARGET/esp_bt_cfg.h" ]]; then - mkdir -p "$AR_SDK/include/$fname/controller/$IDF_TARGET" - cp -n "$ipath/controller/$IDF_TARGET/esp_bt_cfg.h" "$AR_SDK/include/$fname/controller/$IDF_TARGET/esp_bt_cfg.h" + + # Copy the respective file if any /include/esp32*/include is found and copy the respective file for the soc found + if [[ "$out_sub" =~ ^/include/esp32[^/]+/include$ ]]; then + soc_name=$(echo "$out_sub" | sed -n 's|/include/\(esp32[^/]*\)/include$|\1|p') + echo "Copying bt config file for soc: $soc_name" + if [ -n "$soc_name" ] && [ -f "$ipath/controller/$soc_name/esp_bt_cfg.h" ]; then + mkdir -p "$AR_SDK/include/$fname/controller/$soc_name" + cp -n "$ipath/controller/$soc_name/esp_bt_cfg.h" "$AR_SDK/include/$fname/controller/$soc_name/esp_bt_cfg.h" + fi fi fi done From d5e46fa326a52ad5d299ace4fe1e5f4c6a4c726e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 12 Nov 2025 12:03:50 +0100 Subject: [PATCH 2/2] feat(ot): Add OpenThread to C61 defconfig --- configs/defconfig.esp32c61 | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/configs/defconfig.esp32c61 b/configs/defconfig.esp32c61 index 923b9d37c..8a072e01e 100644 --- a/configs/defconfig.esp32c61 +++ b/configs/defconfig.esp32c61 @@ -11,3 +11,43 @@ CONFIG_BT_NIMBLE_NVS_PERSIST=y CONFIG_RTC_CLK_CAL_CYCLES=576 # CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304 + +# +# OpenThread +# +CONFIG_OPENTHREAD_ENABLED=y +# Border Router disabled +# CONFIG_OPENTHREAD_BORDER_ROUTER=y +# CONFIG_OPENTHREAD_RADIO_SPINEL_UART=y + +# DNS64 and NAT64 will be disabled for a while +# OT IDF issue https://github.com/espressif/esp-idf/issues/15069 +# CONFIG_OPENTHREAD_DNS64_CLIENT=y + +# Radio for RPC +# CONFIG_OPENTHREAD_RADIO=y +# CONFIG_OPENTHREAD_RADIO_NATIVE=y +# CONFIG_OPENTHREAD_DIAG=n +CONFIG_OPENTHREAD_COMMISSIONER=y +CONFIG_OPENTHREAD_JOINER=y +CONFIG_OPENTHREAD_CLI=y +CONFIG_OPENTHREAD_SRP_CLIENT=y +CONFIG_OPENTHREAD_DNS_CLIENT=y +# Default dataset for quick start +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread-ESP" +CONFIG_OPENTHREAD_MESH_LOCAL_PREFIX="fd00:db8:a0:0::/64" +CONFIG_OPENTHREAD_NETWORK_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_PANID=0x1234 +CONFIG_OPENTHREAD_NETWORK_EXTPANID="dead00beef00cafe" +CONFIG_OPENTHREAD_NETWORK_MASTERKEY="00112233445566778899aabbccddeeff" +CONFIG_OPENTHREAD_NETWORK_PSKC="104810e2315100afd6bc9215a6bfac53" +# end of OpenThread + +# Matter settings: WiFi and OpenThread + CHIPoBLE +CONFIG_ENABLE_CHIPOBLE=y +CONFIG_ENABLE_MATTER_OVER_THREAD=y +# 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 +# increase the maximum number of endpoints per device +CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT=32