Skip to content

Commit

Permalink
fix(phy): fix esp32 build fail issue
Browse files Browse the repository at this point in the history
Closes #11972
  • Loading branch information
muhaidong committed Oct 9, 2024
1 parent 2225b4c commit cf577ee
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
26 changes: 13 additions & 13 deletions components/esp_phy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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 $<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)
target_link_libraries(${COMPONENT_LIB} PUBLIC rtc)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a librtc.a
Expand All @@ -84,20 +97,7 @@ if(CONFIG_ESP_PHY_ENABLED)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a
$<TARGET_FILE:${esp_phy_lib}>)
endif()

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()
endif()

if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION)
idf_component_get_property(esp_common_dir esp_common COMPONENT_DIR)
Expand Down
6 changes: 3 additions & 3 deletions components/esp_phy/include/esp_phy_cert_test.h
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions examples/phy/.build-test-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions examples/phy/cert_test/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cf577ee

Please sign in to comment.