From c53cedb9474763faa91db89fb5b817105157f683 Mon Sep 17 00:00:00 2001 From: xiehang Date: Mon, 18 Dec 2023 16:09:14 +0800 Subject: [PATCH 1/4] fix(phy): All chip support cert_test --- components/esp_phy/CMakeLists.txt | 12 ++++++++++-- components/esp_phy/Kconfig | 1 - examples/phy/.build-test-rules.yml | 2 +- examples/phy/cert_test/README.md | 6 +++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index d8a75f1796..9c333eda46 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -87,8 +87,16 @@ if(CONFIG_ESP_PHY_ENABLED) endif() if(CONFIG_ESP_PHY_ENABLE_CERT_TEST) - target_link_libraries(${COMPONENT_LIB} INTERFACE $ libbttestmode.a - librfate.a librftest.a $) + if(CONFIG_IDF_TARGET_ESP32) + target_link_libraries(${COMPONENT_LIB} INTERFACE $ libbttestmode.a + librftest.a $) + elseif(CONFIG_IDF_TARGET_ESP32S2) + target_link_libraries(${COMPONENT_LIB} INTERFACE $ librftest.a + librfate.a $) + else() + target_link_libraries(${COMPONENT_LIB} INTERFACE $ libbttestmode.a + librfate.a librftest.a $) + endif() endif() endif() diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index e6835b30fe..c0837398e2 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -130,7 +130,6 @@ menu "PHY" config ESP_PHY_ENABLE_CERT_TEST bool "Enable RF certification test functions" default n - depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 help If enabled, you can use RF certification test APIs. diff --git a/examples/phy/.build-test-rules.yml b/examples/phy/.build-test-rules.yml index 1072fffc25..60dcb493ef 100644 --- a/examples/phy/.build-test-rules.yml +++ b/examples/phy/.build-test-rules.yml @@ -9,6 +9,6 @@ examples/phy/antenna: reason: not supported examples/phy/cert_test: enable: - - if: IDF_TARGET in ["esp32c3", "esp32s3"] + - if: IDF_TARGET in ["esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s2", "esp32s3"] temporary: true reason: the other targets are not tested yet diff --git a/examples/phy/cert_test/README.md b/examples/phy/cert_test/README.md index fa8dd04ba3..3ac5021bfd 100644 --- a/examples/phy/cert_test/README.md +++ b/examples/phy/cert_test/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-C3 | ESP32-S3 | -| ----------------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | # Certification Test Example @@ -121,4 +121,4 @@ For BLE test, if you want to use `fcc_le_tx` and `rw_le_rx_per` legacy commands ## Troubleshooting -For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon. \ No newline at end of file +For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon. From aa80dbe2511c235ab2f4632c3e0983f6623ed071 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Tue, 25 Jun 2024 15:16:39 +0800 Subject: [PATCH 2/4] fix(phy): fix esp32 build fail issue Closes https://github.com/espressif/esp-idf/issues/11972 --- components/esp_phy/CMakeLists.txt | 26 +++++++++---------- .../esp_phy/include/esp_phy_cert_test.h | 6 ++--- examples/phy/.build-test-rules.yml | 8 +++--- examples/phy/cert_test/sdkconfig.defaults | 1 + 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 9c333eda46..d7bec39ef5 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -73,6 +73,19 @@ if(CONFIG_ESP_PHY_ENABLED) idf_component_get_property(esp_phy_lib esp_phy COMPONENT_LIB) + if(CONFIG_ESP_PHY_ENABLE_CERT_TEST) + if(CONFIG_IDF_TARGET_ESP32) + target_link_libraries(${COMPONENT_LIB} INTERFACE $ libbttestmode.a + librftest.a $) + elseif(CONFIG_IDF_TARGET_ESP32S2) + target_link_libraries(${COMPONENT_LIB} INTERFACE $ librftest.a + librfate.a $) + else() + target_link_libraries(${COMPONENT_LIB} INTERFACE $ libbttestmode.a + librfate.a librftest.a $) + endif() + endif() + if(CONFIG_IDF_TARGET_ESP32) target_link_libraries(${COMPONENT_LIB} PUBLIC rtc) target_link_libraries(${COMPONENT_LIB} INTERFACE $ libphy.a librtc.a @@ -85,20 +98,7 @@ if(CONFIG_ESP_PHY_ENABLED) target_link_libraries(${COMPONENT_LIB} INTERFACE $ libphy.a $) endif() - - if(CONFIG_ESP_PHY_ENABLE_CERT_TEST) - if(CONFIG_IDF_TARGET_ESP32) - target_link_libraries(${COMPONENT_LIB} INTERFACE $ libbttestmode.a - librftest.a $) - elseif(CONFIG_IDF_TARGET_ESP32S2) - target_link_libraries(${COMPONENT_LIB} INTERFACE $ librftest.a - librfate.a $) - else() - target_link_libraries(${COMPONENT_LIB} INTERFACE $ libbttestmode.a - librfate.a librftest.a $) - endif() endif() -endif() if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION) idf_component_get_property(esp_common_dir esp_common COMPONENT_DIR) diff --git a/components/esp_phy/include/esp_phy_cert_test.h b/components/esp_phy/include/esp_phy_cert_test.h index 461295683c..75e6b5e093 100644 --- a/components/esp_phy/include/esp_phy_cert_test.h +++ b/components/esp_phy/include/esp_phy_cert_test.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -63,7 +63,7 @@ typedef struct { uint32_t phy_rx_correct_count; /*!< The number of desired packets received */ int phy_rx_rssi; /*!< Average RSSI of desired packets */ uint32_t phy_rx_total_count; /*!< The number of total packets received */ - uint32_t phy_rx_result_flag; /*!< 0 means no RX info; 1 means the lastest Wi-Fi RX info; 2 means the lastest BLE RX info. */ + uint32_t phy_rx_result_flag; /*!< 0 means no RX info; 1 means the latest Wi-Fi RX info; 2 means the latest BLE RX info. */ } esp_phy_rx_result_t; /** @@ -120,7 +120,7 @@ void esp_phy_cbw40m_en(bool en); void esp_phy_wifi_tx(uint32_t chan, esp_phy_wifi_rate_t rate, int8_t backoff, uint32_t length_byte, uint32_t packet_delay, uint32_t packet_num); /** - * @brief Test start/stop command, used to stop transmitting or reciving state. + * @brief Test start/stop command, used to stop transmitting or receiving state. * * @param value: * Value should be set to 3 before TX/RX. diff --git a/examples/phy/.build-test-rules.yml b/examples/phy/.build-test-rules.yml index 60dcb493ef..bd914b1c5e 100644 --- a/examples/phy/.build-test-rules.yml +++ b/examples/phy/.build-test-rules.yml @@ -8,7 +8,9 @@ examples/phy/antenna: - if: IDF_TARGET in ["esp32p4", "esp32h2"] reason: not supported examples/phy/cert_test: - enable: - - if: IDF_TARGET in ["esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s2", "esp32s3"] + disable: + - if: IDF_TARGET in ["esp32p4"] + reason: not supported + - if: IDF_TARGET == "esp32c5" temporary: true - reason: the other targets are not tested yet + reason: not supported yet # TODO: [ESP32C5] IDF-8851 diff --git a/examples/phy/cert_test/sdkconfig.defaults b/examples/phy/cert_test/sdkconfig.defaults index b0ce7b5c29..13e6bed13d 100644 --- a/examples/phy/cert_test/sdkconfig.defaults +++ b/examples/phy/cert_test/sdkconfig.defaults @@ -2,3 +2,4 @@ CONFIG_ESP_TASK_WDT_EN=n CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=y CONFIG_ESP_PHY_ENABLE_CERT_TEST=y +CONFIG_BT_ENABLED=y From 30a48b126e92aaf991dd9549c9c5576f2e8f7942 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 16 Aug 2024 17:12:16 +0800 Subject: [PATCH 3/4] fix(phy): esp32s2 and esph2 support rf cert_test --- components/esp_phy/lib | 2 +- examples/phy/.build-test-rules.yml | 2 +- examples/phy/cert_test/main/cert_test.c | 4 +++- examples/phy/cert_test/sdkconfig.defaults.esp32s3 | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 examples/phy/cert_test/sdkconfig.defaults.esp32s3 diff --git a/components/esp_phy/lib b/components/esp_phy/lib index b526a0d720..8608fcf54d 160000 --- a/components/esp_phy/lib +++ b/components/esp_phy/lib @@ -1 +1 @@ -Subproject commit b526a0d7204fb36cb322ead9b1096ffd6a097dc9 +Subproject commit 8608fcf54d51e81f2e74ebf335fa33f61953f7c8 diff --git a/examples/phy/.build-test-rules.yml b/examples/phy/.build-test-rules.yml index bd914b1c5e..120f460580 100644 --- a/examples/phy/.build-test-rules.yml +++ b/examples/phy/.build-test-rules.yml @@ -11,6 +11,6 @@ examples/phy/cert_test: disable: - if: IDF_TARGET in ["esp32p4"] reason: not supported - - if: IDF_TARGET == "esp32c5" + - if: IDF_TARGET in ["esp32c5", "esp32c61"] temporary: true reason: not supported yet # TODO: [ESP32C5] IDF-8851 diff --git a/examples/phy/cert_test/main/cert_test.c b/examples/phy/cert_test/main/cert_test.c index 4e8e3c0405..323e106554 100644 --- a/examples/phy/cert_test/main/cert_test.c +++ b/examples/phy/cert_test/main/cert_test.c @@ -38,7 +38,9 @@ void app_main(void) register_phy_cmd(); /* rftest.a requirements */ - esp_wifi_power_domain_on(); + #ifndef CONFIG_IDF_TARGET_ESP32H2 + esp_wifi_power_domain_on(); + #endif esp_phy_rftest_config(1); esp_phy_rftest_init(); diff --git a/examples/phy/cert_test/sdkconfig.defaults.esp32s3 b/examples/phy/cert_test/sdkconfig.defaults.esp32s3 new file mode 100644 index 0000000000..771824b41e --- /dev/null +++ b/examples/phy/cert_test/sdkconfig.defaults.esp32s3 @@ -0,0 +1,4 @@ +# +# ESP32S3-specific +# +CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 From dacc1f94dd530eeeafe467b2994085c28a99f3fb Mon Sep 17 00:00:00 2001 From: Mu Hai Dong Date: Thu, 5 Sep 2024 12:01:07 +0800 Subject: [PATCH 4/4] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Jiang Jiang Jian --- examples/phy/cert_test/main/cert_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/phy/cert_test/main/cert_test.c b/examples/phy/cert_test/main/cert_test.c index 323e106554..af5c99ffff 100644 --- a/examples/phy/cert_test/main/cert_test.c +++ b/examples/phy/cert_test/main/cert_test.c @@ -38,9 +38,9 @@ void app_main(void) register_phy_cmd(); /* rftest.a requirements */ - #ifndef CONFIG_IDF_TARGET_ESP32H2 - esp_wifi_power_domain_on(); - #endif +#ifndef CONFIG_IDF_TARGET_ESP32H2 + esp_wifi_power_domain_on(); +#endif esp_phy_rftest_config(1); esp_phy_rftest_init();