From 5d7e2a6fdeba1f01d68b55164892f39f021ca7ae Mon Sep 17 00:00:00 2001 From: xiehang Date: Mon, 18 Dec 2023 16:09:14 +0800 Subject: [PATCH 1/5] fix(phy): All chip support cert_test --- components/esp_phy/CMakeLists.txt | 12 ++++++++++-- examples/phy/.build-test-rules.yml | 2 +- examples/phy/cert_test/README.md | 5 ++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index f6cea7452d..98533093a7 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -71,8 +71,16 @@ if(link_binary_libs) 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/examples/phy/.build-test-rules.yml b/examples/phy/.build-test-rules.yml index 78b3f1475e..c0445ccffb 100644 --- a/examples/phy/.build-test-rules.yml +++ b/examples/phy/.build-test-rules.yml @@ -2,6 +2,6 @@ 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 ee41af138c..53b264c7a3 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 @@ -118,4 +118,3 @@ phy> ## 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. - From 8992e1cec84cf3fba82de7355ef671f5bf76589e Mon Sep 17 00:00:00 2001 From: muhaidong Date: Tue, 25 Jun 2024 15:16:39 +0800 Subject: [PATCH 2/5] 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 | 4 --- examples/phy/cert_test/sdkconfig.defaults | 1 + 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 98533093a7..b3efc9c51f 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -57,19 +57,6 @@ if(link_binary_libs) idf_component_get_property(esp_phy_lib esp_phy COMPONENT_LIB) - if(CONFIG_IDF_TARGET_ESP32) - target_link_libraries(${COMPONENT_LIB} PUBLIC rtc) - target_link_libraries(${COMPONENT_LIB} INTERFACE $ libphy.a librtc.a - $) - elseif(CONFIG_IDF_TARGET_ESP32S2) - target_link_libraries(${COMPONENT_LIB} INTERFACE $ libphy.a - $) - elseif(CONFIG_SOC_BT_SUPPORTED OR CONFIG_SOC_IEEE802154_SUPPORTED) - target_link_libraries(${COMPONENT_LIB} PUBLIC btbb) - target_link_libraries(${COMPONENT_LIB} INTERFACE $ libphy.a libbtbb.a - $) - endif() - if(CONFIG_ESP_PHY_ENABLE_CERT_TEST) if(CONFIG_IDF_TARGET_ESP32) target_link_libraries(${COMPONENT_LIB} INTERFACE $ libbttestmode.a @@ -82,6 +69,19 @@ if(link_binary_libs) 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 + $) + elseif(CONFIG_SOC_BT_SUPPORTED OR CONFIG_SOC_IEEE802154_SUPPORTED) + target_link_libraries(${COMPONENT_LIB} PUBLIC btbb) + target_link_libraries(${COMPONENT_LIB} INTERFACE $ libphy.a libbtbb.a + $) + elseif(CONFIG_SOC_WIFI_SUPPORTED) + target_link_libraries(${COMPONENT_LIB} INTERFACE $ libphy.a + $) + endif() endif() if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION) 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 c0445ccffb..921265fed0 100644 --- a/examples/phy/.build-test-rules.yml +++ b/examples/phy/.build-test-rules.yml @@ -1,7 +1,3 @@ # Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps examples/phy/cert_test: - enable: - - 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/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 ea85edc46993ec634b57b04fa8086cd180bbb63b Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 16 Aug 2024 17:12:16 +0800 Subject: [PATCH 3/5] fix(phy): esp32s2 and esph2 support rf cert_test --- components/esp_phy/lib | 2 +- examples/phy/cert_test/main/cert_test.c | 4 +++- examples/phy/cert_test/sdkconfig.defaults.esp32s3 | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 examples/phy/cert_test/sdkconfig.defaults.esp32s3 diff --git a/components/esp_phy/lib b/components/esp_phy/lib index 06e7625de1..8608fcf54d 160000 --- a/components/esp_phy/lib +++ b/components/esp_phy/lib @@ -1 +1 @@ -Subproject commit 06e7625de197bc12797dd701d6762229bca01826 +Subproject commit 8608fcf54d51e81f2e74ebf335fa33f61953f7c8 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 1e10eba6e5aa3fa422a06667a7811313d22425c2 Mon Sep 17 00:00:00 2001 From: Mu Hai Dong Date: Thu, 5 Sep 2024 12:01:07 +0800 Subject: [PATCH 4/5] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Jiang Jiang Jian --- components/esp_phy/Kconfig | 1 - examples/phy/cert_test/main/cert_test.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index b6b4e4923e..77c4d53b0d 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -124,7 +124,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/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(); From e2822c3a1fdfe9a9b155bcbb178fd4e6402c4e6b Mon Sep 17 00:00:00 2001 From: muhaidong Date: Wed, 18 Sep 2024 21:57:03 +0800 Subject: [PATCH 5/5] fix(phy): update cert_test docs --- examples/phy/cert_test/README.md | 7 +------ examples/phy/cert_test/main/cert_test.c | 14 ++++++++++---- examples/phy/cert_test/main/cmd_phy.c | 2 ++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/examples/phy/cert_test/README.md b/examples/phy/cert_test/README.md index 53b264c7a3..197c573919 100644 --- a/examples/phy/cert_test/README.md +++ b/examples/phy/cert_test/README.md @@ -13,7 +13,7 @@ Before project configuration and build, be sure to set the correct chip target u ### Hardware Required -* A development board with ESP32-C3/ESP32-S3/ SoC. +* A development board with ESP32/ESP32-C2/ESP32-C3/ESP32-C6/ESP32-H2/ESP32-S2/ESP32-S3/ SoC. * A USB cable for Power supply and programming ### Configure the project @@ -34,11 +34,6 @@ Run `idf.py -p PORT flash monitor` to build, flash and monitor the project. (To exit the serial monitor, type ``Ctrl-]``.) -See the Getting Started Guide for all the steps to configure and use the ESP-IDF to build projects. - -* [ESP-IDF Getting Started Guide on ESP32-C3](https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/get-started/index.html) -* [ESP-IDF Getting Started Guide on ESP32-S3](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/get-started/index.html) - ## Example Output The command and output logs for each test are as follows: diff --git a/examples/phy/cert_test/main/cert_test.c b/examples/phy/cert_test/main/cert_test.c index af5c99ffff..cd8ac2afac 100644 --- a/examples/phy/cert_test/main/cert_test.c +++ b/examples/phy/cert_test/main/cert_test.c @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ +#include "sdkconfig.h" #include "nvs_flash.h" #include "esp_console.h" @@ -38,7 +39,7 @@ void app_main(void) register_phy_cmd(); /* rftest.a requirements */ -#ifndef CONFIG_IDF_TARGET_ESP32H2 +#if CONFIG_SOC_WIFI_SUPPORTED esp_wifi_power_domain_on(); #endif @@ -46,12 +47,17 @@ void app_main(void) esp_phy_rftest_init(); #endif + int help_index = 1; printf("\n ==================================================\n"); printf(" | RF certification test |\n"); printf(" | |\n"); printf(" | 1. Print 'help' to gain overview of commands |\n"); - printf(" | 2. Wi-Fi certification test |\n"); - printf(" | 3. Bluetooth certification test |\n"); +#if CONFIG_SOC_WIFI_SUPPORTED + printf(" | %d. Wi-Fi certification test |\n", ++help_index); +#endif +#if CONFIG_SOC_BT_SUPPORTED + printf(" | %d. Bluetooth certification test |\n", ++help_index); +#endif printf(" | |\n"); printf(" =================================================\n\n"); diff --git a/examples/phy/cert_test/main/cmd_phy.c b/examples/phy/cert_test/main/cmd_phy.c index 35365861d0..952629a2a6 100644 --- a/examples/phy/cert_test/main/cmd_phy.c +++ b/examples/phy/cert_test/main/cmd_phy.c @@ -3,6 +3,8 @@ * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ + +#include "sdkconfig.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_log.h"