Skip to content

Commit 9b5809d

Browse files
committed
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
2 parents 4a74ca2 + 67b9993 commit 9b5809d

File tree

11 files changed

+45
-25
lines changed

11 files changed

+45
-25
lines changed

components/esp_phy/CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ if(CONFIG_ESP_PHY_ENABLED)
7272

7373
idf_component_get_property(esp_phy_lib esp_phy COMPONENT_LIB)
7474

75+
if(CONFIG_ESP_PHY_ENABLE_CERT_TEST)
76+
if(CONFIG_IDF_TARGET_ESP32)
77+
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libbttestmode.a
78+
librftest.a $<TARGET_FILE:${esp_phy_lib}>)
79+
elseif(CONFIG_IDF_TARGET_ESP32S2)
80+
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> librftest.a
81+
librfate.a $<TARGET_FILE:${esp_phy_lib}>)
82+
else()
83+
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libbttestmode.a
84+
librfate.a librftest.a $<TARGET_FILE:${esp_phy_lib}>)
85+
endif()
86+
endif()
87+
7588
if(CONFIG_IDF_TARGET_ESP32)
7689
target_link_libraries(${COMPONENT_LIB} PUBLIC rtc)
7790
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a librtc.a
@@ -84,12 +97,7 @@ if(CONFIG_ESP_PHY_ENABLED)
8497
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a
8598
$<TARGET_FILE:${esp_phy_lib}>)
8699
endif()
87-
88-
if(CONFIG_ESP_PHY_ENABLE_CERT_TEST)
89-
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libbttestmode.a
90-
librfate.a librftest.a $<TARGET_FILE:${esp_phy_lib}>)
91100
endif()
92-
endif()
93101

94102
if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION)
95103
idf_component_get_property(esp_common_dir esp_common COMPONENT_DIR)

components/esp_phy/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ menu "PHY"
130130
config ESP_PHY_ENABLE_CERT_TEST
131131
bool "Enable RF certification test functions"
132132
default n
133-
depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
134133
help
135134
If enabled, you can use RF certification test APIs.
136135

components/esp_phy/include/esp_phy_cert_test.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -63,7 +63,7 @@ typedef struct {
6363
uint32_t phy_rx_correct_count; /*!< The number of desired packets received */
6464
int phy_rx_rssi; /*!< Average RSSI of desired packets */
6565
uint32_t phy_rx_total_count; /*!< The number of total packets received */
66-
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. */
66+
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. */
6767
} esp_phy_rx_result_t;
6868

6969
/**
@@ -120,7 +120,7 @@ void esp_phy_cbw40m_en(bool en);
120120
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);
121121

122122
/**
123-
* @brief Test start/stop command, used to stop transmitting or reciving state.
123+
* @brief Test start/stop command, used to stop transmitting or receiving state.
124124
*
125125
* @param value:
126126
* Value should be set to 3 before TX/RX.

examples/phy/.build-test-rules.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ examples/phy/antenna:
88
- if: IDF_TARGET in ["esp32p4", "esp32h2"]
99
reason: not supported
1010
examples/phy/cert_test:
11-
enable:
12-
- if: IDF_TARGET in ["esp32c3", "esp32s3"]
11+
disable:
12+
- if: IDF_TARGET in ["esp32p4"]
13+
reason: not supported
14+
- if: IDF_TARGET in ["esp32c5", "esp32c61"]
1315
temporary: true
14-
reason: the other targets are not tested yet
16+
reason: not supported yet # TODO: [ESP32C5] IDF-8851

examples/phy/cert_test/README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
| Supported Targets | ESP32-C3 | ESP32-S3 |
2-
| ----------------- | -------- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
2+
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
33

44
# Certification Test Example
55

@@ -13,7 +13,7 @@ Before project configuration and build, be sure to set the correct chip target u
1313

1414
### Hardware Required
1515

16-
* A development board with ESP32-C3/ESP32-S3/ SoC.
16+
* A development board with ESP32/ESP32-C2/ESP32-C3/ESP32-C6/ESP32-H2/ESP32-S2/ESP32-S3/ SoC.
1717
* A USB cable for Power supply and programming
1818

1919
### Configure the project
@@ -34,11 +34,6 @@ Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
3434

3535
(To exit the serial monitor, type ``Ctrl-]``.)
3636

37-
See the Getting Started Guide for all the steps to configure and use the ESP-IDF to build projects.
38-
39-
* [ESP-IDF Getting Started Guide on ESP32-C3](https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/get-started/index.html)
40-
* [ESP-IDF Getting Started Guide on ESP32-S3](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/get-started/index.html)
41-
4237
## Example Output
4338

4439
The command and output logs for each test are as follows:
@@ -121,4 +116,4 @@ For BLE test, if you want to use `fcc_le_tx` and `rw_le_rx_per` legacy commands
121116

122117
## Troubleshooting
123118

124-
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
119+
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.

examples/phy/cert_test/main/cert_test.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include "sdkconfig.h"
78
#include "nvs_flash.h"
89

910
#include "esp_console.h"
@@ -38,18 +39,25 @@ void app_main(void)
3839
register_phy_cmd();
3940

4041
/* rftest.a requirements */
42+
#if CONFIG_SOC_WIFI_SUPPORTED
4143
esp_wifi_power_domain_on();
44+
#endif
4245

4346
esp_phy_rftest_config(1);
4447
esp_phy_rftest_init();
4548
#endif
4649

50+
int help_index = 1;
4751
printf("\n ==================================================\n");
4852
printf(" | RF certification test |\n");
4953
printf(" | |\n");
5054
printf(" | 1. Print 'help' to gain overview of commands |\n");
51-
printf(" | 2. Wi-Fi certification test |\n");
52-
printf(" | 3. Bluetooth certification test |\n");
55+
#if CONFIG_SOC_WIFI_SUPPORTED
56+
printf(" | %d. Wi-Fi certification test |\n", ++help_index);
57+
#endif
58+
#if CONFIG_SOC_BT_SUPPORTED
59+
printf(" | %d. Bluetooth certification test |\n", ++help_index);
60+
#endif
5361
printf(" | |\n");
5462
printf(" =================================================\n\n");
5563

examples/phy/cert_test/main/cmd_phy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*
44
* SPDX-License-Identifier: Unlicense OR CC0-1.0
55
*/
6+
7+
#include "sdkconfig.h"
68
#include "freertos/FreeRTOS.h"
79
#include "freertos/task.h"
810
#include "esp_log.h"

examples/phy/cert_test/sdkconfig.defaults

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ CONFIG_ESP_TASK_WDT_EN=n
22

33
CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=y
44
CONFIG_ESP_PHY_ENABLE_CERT_TEST=y
5+
CONFIG_BT_ENABLED=y
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#
2+
# ESP32S3-specific
3+
#
4+
CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096

0 commit comments

Comments
 (0)