mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24:32 +02:00
Merge branch 'bugfix/support_cert_test_v5.3' into 'release/v5.3'
fix(phy): Add cert_test support for ESP32, ESP32-C2, ESP32-C6, ESP32-H2 and ESP32-S2(Backport v5.3) See merge request espressif/esp-idf!34033
This commit is contained in:
@@ -72,6 +72,19 @@ if(CONFIG_ESP_PHY_ENABLED)
|
|||||||
|
|
||||||
idf_component_get_property(esp_phy_lib esp_phy COMPONENT_LIB)
|
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 $<TARGET_FILE:${esp_phy_lib}> libbttestmode.a
|
||||||
|
librftest.a $<TARGET_FILE:${esp_phy_lib}>)
|
||||||
|
elseif(CONFIG_IDF_TARGET_ESP32S2)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> librftest.a
|
||||||
|
librfate.a $<TARGET_FILE:${esp_phy_lib}>)
|
||||||
|
else()
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libbttestmode.a
|
||||||
|
librfate.a librftest.a $<TARGET_FILE:${esp_phy_lib}>)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CONFIG_IDF_TARGET_ESP32)
|
if(CONFIG_IDF_TARGET_ESP32)
|
||||||
target_link_libraries(${COMPONENT_LIB} PUBLIC rtc)
|
target_link_libraries(${COMPONENT_LIB} PUBLIC rtc)
|
||||||
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a librtc.a
|
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a librtc.a
|
||||||
@@ -84,12 +97,7 @@ if(CONFIG_ESP_PHY_ENABLED)
|
|||||||
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a
|
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a
|
||||||
$<TARGET_FILE:${esp_phy_lib}>)
|
$<TARGET_FILE:${esp_phy_lib}>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_ESP_PHY_ENABLE_CERT_TEST)
|
|
||||||
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libbttestmode.a
|
|
||||||
librfate.a librftest.a $<TARGET_FILE:${esp_phy_lib}>)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION)
|
if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION)
|
||||||
idf_component_get_property(esp_common_dir esp_common COMPONENT_DIR)
|
idf_component_get_property(esp_common_dir esp_common COMPONENT_DIR)
|
||||||
|
@@ -130,7 +130,6 @@ menu "PHY"
|
|||||||
config ESP_PHY_ENABLE_CERT_TEST
|
config ESP_PHY_ENABLE_CERT_TEST
|
||||||
bool "Enable RF certification test functions"
|
bool "Enable RF certification test functions"
|
||||||
default n
|
default n
|
||||||
depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
|
|
||||||
help
|
help
|
||||||
If enabled, you can use RF certification test APIs.
|
If enabled, you can use RF certification test APIs.
|
||||||
|
|
||||||
|
@@ -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
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -63,7 +63,7 @@ typedef struct {
|
|||||||
uint32_t phy_rx_correct_count; /*!< The number of desired packets received */
|
uint32_t phy_rx_correct_count; /*!< The number of desired packets received */
|
||||||
int phy_rx_rssi; /*!< Average RSSI of desired packets */
|
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_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;
|
} 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);
|
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:
|
* @param value:
|
||||||
* Value should be set to 3 before TX/RX.
|
* Value should be set to 3 before TX/RX.
|
||||||
|
Submodule components/esp_phy/lib updated: 06e7625de1...8608fcf54d
@@ -8,7 +8,9 @@ examples/phy/antenna:
|
|||||||
- if: IDF_TARGET in ["esp32p4", "esp32h2"]
|
- if: IDF_TARGET in ["esp32p4", "esp32h2"]
|
||||||
reason: not supported
|
reason: not supported
|
||||||
examples/phy/cert_test:
|
examples/phy/cert_test:
|
||||||
enable:
|
disable:
|
||||||
- if: IDF_TARGET in ["esp32c3", "esp32s3"]
|
- if: IDF_TARGET in ["esp32p4"]
|
||||||
|
reason: not supported
|
||||||
|
- if: IDF_TARGET in ["esp32c5", "esp32c61"]
|
||||||
temporary: true
|
temporary: true
|
||||||
reason: the other targets are not tested yet
|
reason: not supported yet # TODO: [ESP32C5] IDF-8851
|
||||||
|
@@ -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
|
# Certification Test Example
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ Before project configuration and build, be sure to set the correct chip target u
|
|||||||
|
|
||||||
### Hardware Required
|
### 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
|
* A USB cable for Power supply and programming
|
||||||
|
|
||||||
### Configure the project
|
### 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-]``.)
|
(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
|
## Example Output
|
||||||
|
|
||||||
The command and output logs for each test are as follows:
|
The command and output logs for each test are as follows:
|
||||||
|
@@ -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
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "sdkconfig.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
|
|
||||||
#include "esp_console.h"
|
#include "esp_console.h"
|
||||||
@@ -38,18 +39,25 @@ void app_main(void)
|
|||||||
register_phy_cmd();
|
register_phy_cmd();
|
||||||
|
|
||||||
/* rftest.a requirements */
|
/* rftest.a requirements */
|
||||||
|
#if CONFIG_SOC_WIFI_SUPPORTED
|
||||||
esp_wifi_power_domain_on();
|
esp_wifi_power_domain_on();
|
||||||
|
#endif
|
||||||
|
|
||||||
esp_phy_rftest_config(1);
|
esp_phy_rftest_config(1);
|
||||||
esp_phy_rftest_init();
|
esp_phy_rftest_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int help_index = 1;
|
||||||
printf("\n ==================================================\n");
|
printf("\n ==================================================\n");
|
||||||
printf(" | RF certification test |\n");
|
printf(" | RF certification test |\n");
|
||||||
printf(" | |\n");
|
printf(" | |\n");
|
||||||
printf(" | 1. Print 'help' to gain overview of commands |\n");
|
printf(" | 1. Print 'help' to gain overview of commands |\n");
|
||||||
printf(" | 2. Wi-Fi certification test |\n");
|
#if CONFIG_SOC_WIFI_SUPPORTED
|
||||||
printf(" | 3. Bluetooth certification test |\n");
|
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");
|
||||||
printf(" =================================================\n\n");
|
printf(" =================================================\n\n");
|
||||||
|
|
||||||
|
@@ -3,6 +3,8 @@
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "sdkconfig.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
@@ -2,3 +2,4 @@ CONFIG_ESP_TASK_WDT_EN=n
|
|||||||
|
|
||||||
CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=y
|
CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=y
|
||||||
CONFIG_ESP_PHY_ENABLE_CERT_TEST=y
|
CONFIG_ESP_PHY_ENABLE_CERT_TEST=y
|
||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
4
examples/phy/cert_test/sdkconfig.defaults.esp32s3
Normal file
4
examples/phy/cert_test/sdkconfig.defaults.esp32s3
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#
|
||||||
|
# ESP32S3-specific
|
||||||
|
#
|
||||||
|
CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096
|
@@ -1,2 +1,3 @@
|
|||||||
CONFIG_MQTT_CUSTOM_OUTBOX=y
|
CONFIG_MQTT_CUSTOM_OUTBOX=y
|
||||||
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
||||||
|
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
|
||||||
|
Reference in New Issue
Block a user