From ba9545abbf5b573b280a2c4c4c6e2c722ec43d94 Mon Sep 17 00:00:00 2001 From: Tan Yan Quan Date: Wed, 30 Apr 2025 12:28:40 +0800 Subject: [PATCH 1/4] feat(openthread): support esp32p4 as ot_br --- examples/openthread/.build-test-rules.yml | 4 ++-- examples/openthread/ot_br/README.md | 11 ++++++++--- examples/openthread/ot_br/main/idf_component.yml | 2 +- examples/openthread/ot_br/sdkconfig.defaults.esp32p4 | 6 ++++++ 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 examples/openthread/ot_br/sdkconfig.defaults.esp32p4 diff --git a/examples/openthread/.build-test-rules.yml b/examples/openthread/.build-test-rules.yml index c27a2f2ce5..03dcf253fa 100644 --- a/examples/openthread/.build-test-rules.yml +++ b/examples/openthread/.build-test-rules.yml @@ -23,8 +23,8 @@ examples/openthread/ot_br: enable: - - if: (SOC_WIFI_SUPPORTED == 1 and IDF_TARGET != "esp32c61") and CONFIG_NAME != "native_radio" - - if: (SOC_WIFI_SUPPORTED == 1 and IDF_TARGET != "esp32c61") and (SOC_IEEE802154_SUPPORTED == 1 and CONFIG_NAME == "native_radio") + - if: (SOC_WIFI_SUPPORTED == 1 and IDF_TARGET == "esp32p4") and CONFIG_NAME != "native_radio" + - if: SOC_WIFI_SUPPORTED == 1 and (SOC_IEEE802154_SUPPORTED == 1 and CONFIG_NAME == "native_radio") disable_test: - if: IDF_TARGET not in ["esp32s3"] reason: only test on esp32s3 diff --git a/examples/openthread/ot_br/README.md b/examples/openthread/ot_br/README.md index fe3c90938a..718fbd86d4 100644 --- a/examples/openthread/ot_br/README.md +++ b/examples/openthread/ot_br/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | # OpenThread Border Router Example @@ -33,7 +33,12 @@ ESP32 pin | ESP32-H2 pin The example could also run on a single SoC which supports both Wi-Fi and Thread (e.g., ESP32-C6), but since there is only one RF path in ESP32-C6, which means Wi-Fi and Thread can't receive simultaneously, it has a significant impact on performance. Hence the two SoCs solution is recommended. #### **Ethernet based Thread Border Router** -Similar to the previous Wi-Fi based Thread Border Route setup, but a device with Ethernet interface is required, such as [ESP32-Ethernet-Kit](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-ethernet-kit.html) +Similar to the previous Wi-Fi based Thread Border Route setup, but a device with Ethernet interface is required, such as [ESP32-Ethernet-Kit](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-ethernet-kit.html) or [ESP32-P4-Function-EV-Board](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/index.html). + +#### **ESP32-P4 using Wi-Fi Co-Processor** +This example can also be run using Wi-Fi using the ESP32-P4, which does not natively support Wi-Fi, by incorporating the ESP-Hosted component to enable Wi-Fi connectivity for the ESP32-P4 through a ESP32-C6 co-processor. You may refer to the [ESP-Hosted-MCU documentation](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/esp32_p4_function_ev_board.md) for more information about ESP-Hosted. + +If you are using the ESP32-P4-Function-EV-Board, you may refer to the [OpenThread Border Router Example](https://github.com/espressif/esp-thread-br/tree/main/examples/basic_thread_border_router) for running a Wi-Fi based Thread Border Router. ### Configure the project diff --git a/examples/openthread/ot_br/main/idf_component.yml b/examples/openthread/ot_br/main/idf_component.yml index dff9291048..663e91b6e0 100644 --- a/examples/openthread/ot_br/main/idf_component.yml +++ b/examples/openthread/ot_br/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: espressif/esp_ot_cli_extension: - version: "~1.3.0" + version: "~1.3.1" espressif/mdns: "^1.0.3" ## Required IDF version idf: diff --git a/examples/openthread/ot_br/sdkconfig.defaults.esp32p4 b/examples/openthread/ot_br/sdkconfig.defaults.esp32p4 new file mode 100644 index 0000000000..0bf7855bcc --- /dev/null +++ b/examples/openthread/ot_br/sdkconfig.defaults.esp32p4 @@ -0,0 +1,6 @@ +# Enable BR auto start for Ethernet builds +CONFIG_OPENTHREAD_BR_AUTO_START=y + +# Enable PPP support as a workaround to ensure LWIP thread-lib compatibility for Ethernet builds +CONFIG_LWIP_PPP_SUPPORT=y +CONFIG_LWIP_PPP_SERVER_SUPPORT=y From 184379b6bdf400e7ed3863e57283d0877146c24c Mon Sep 17 00:00:00 2001 From: Tan Yan Quan Date: Thu, 8 May 2025 10:35:54 +0800 Subject: [PATCH 2/4] feat(openthread): update OT upstream to ec2b0d487 --- components/openthread/openthread | 2 +- components/openthread/sbom_openthread.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/openthread/openthread b/components/openthread/openthread index 8c30b93fee..ec2b0d4873 160000 --- a/components/openthread/openthread +++ b/components/openthread/openthread @@ -1 +1 @@ -Subproject commit 8c30b93feed13f2da38f8592b3ed94f4d0a077a4 +Subproject commit ec2b0d487356d2955346457a6515201039140037 diff --git a/components/openthread/sbom_openthread.yml b/components/openthread/sbom_openthread.yml index df9dd82dd6..789349f827 100644 --- a/components/openthread/sbom_openthread.yml +++ b/components/openthread/sbom_openthread.yml @@ -5,4 +5,4 @@ supplier: 'Organization: Espressif Systems (Shanghai) CO LTD' originator: 'Organization: Google LLC' description: OpenThread released by Google is an open-source implementation of the Thread networking url: https://github.com/espressif/openthread -hash: 8c30b93feed13f2da38f8592b3ed94f4d0a077a4 +hash: ec2b0d487356d2955346457a6515201039140037 From 0282e9f16ffa6193e175b7a368be0e7d09476a4c Mon Sep 17 00:00:00 2001 From: Tan Yan Quan Date: Thu, 8 May 2025 11:31:11 +0000 Subject: [PATCH 3/4] feat(openthread/br): update thread-lib for esp32p4 and OT upstream ec2b0d487 * esp-openthread: thread_zigbee/esp-openthread@8b26c0b64 * openthread: espressif/openthread@ec2b0d487 * esp-idf: espressif/esp-idf@184379b6b --- components/openthread/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/openthread/lib b/components/openthread/lib index eada398075..459448381b 160000 --- a/components/openthread/lib +++ b/components/openthread/lib @@ -1 +1 @@ -Subproject commit eada398075e5b7bc2f8b79003a6b28d948c30096 +Subproject commit 459448381b89b7c8e82480e4836d0dc32eb9c68b From 161117908d9da32ae082fe89c7c244de83406978 Mon Sep 17 00:00:00 2001 From: Tan Yan Quan Date: Fri, 9 May 2025 12:05:38 +0800 Subject: [PATCH 4/4] fix(openthread/br): enable ot_br CI case for native wifi targets --- examples/openthread/.build-test-rules.yml | 2 +- examples/openthread/ot_br/main/idf_component.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/openthread/.build-test-rules.yml b/examples/openthread/.build-test-rules.yml index 03dcf253fa..559a7957ce 100644 --- a/examples/openthread/.build-test-rules.yml +++ b/examples/openthread/.build-test-rules.yml @@ -23,7 +23,7 @@ examples/openthread/ot_br: enable: - - if: (SOC_WIFI_SUPPORTED == 1 and IDF_TARGET == "esp32p4") and CONFIG_NAME != "native_radio" + - if: (SOC_WIFI_SUPPORTED == 1 or IDF_TARGET == "esp32p4") and CONFIG_NAME != "native_radio" - if: SOC_WIFI_SUPPORTED == 1 and (SOC_IEEE802154_SUPPORTED == 1 and CONFIG_NAME == "native_radio") disable_test: - if: IDF_TARGET not in ["esp32s3"] diff --git a/examples/openthread/ot_br/main/idf_component.yml b/examples/openthread/ot_br/main/idf_component.yml index 663e91b6e0..dff9291048 100644 --- a/examples/openthread/ot_br/main/idf_component.yml +++ b/examples/openthread/ot_br/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: espressif/esp_ot_cli_extension: - version: "~1.3.1" + version: "~1.3.0" espressif/mdns: "^1.0.3" ## Required IDF version idf: