From 7207194442c249f2b5c98b1b32f71e4938b92597 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 17 Mar 2023 15:25:28 +0800 Subject: [PATCH 1/2] disable reduce PHY TX power when brownout reset --- components/esp_phy/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index 9febe98d26..626f509b66 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -101,7 +101,7 @@ menu "PHY" config ESP_PHY_REDUCE_TX_POWER bool "Reduce PHY TX power when brownout reset" depends on ESP_BROWNOUT_DET - default y + default n help When brownout reset occurs, reduce PHY TX power to keep the code running. From f1cec643a769702a122b5296b80d2fec61648cb0 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Sun, 12 Mar 2023 18:18:06 +0800 Subject: [PATCH 2/2] esp_phy: add menuconfig of phy calibration mode --- components/esp_phy/Kconfig | 24 ++++++++++++++++++++++++ components/esp_phy/src/phy_init.c | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index 626f509b66..3e5bf77a2f 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -121,4 +121,28 @@ menu "PHY" help If enabled, you can use RF certification test APIs. + choice ESP_PHY_CALIBRATION_MODE + prompt "Calibration mode" + default ESP_PHY_RF_CAL_PARTIAL + help + Select PHY calibration mode. During RF initialization, the partial calibration + method is used by default for RF calibration. Full calibration takes about 100ms + more than partial calibration. If boot duration is not critical, it is suggested + to use the full calibration method. No calibration method is only used when the + device wakes up from deep sleep. + + config ESP_PHY_RF_CAL_PARTIAL + bool "Calibration partial" + config ESP_PHY_RF_CAL_NONE + bool "Calibration none" + config ESP_PHY_RF_CAL_FULL + bool "Calibration full" + endchoice #ESP_PHY_CALIBRATION_MODE + + config ESP_PHY_CALIBRATION_MODE + int + default 0 if ESP_PHY_RF_CAL_PARTIAL + default 1 if ESP_PHY_RF_CAL_NONE + default 2 if ESP_PHY_RF_CAL_FULL + endmenu # PHY diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index 6011bb236a..b32f6b11f7 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -780,7 +780,7 @@ void esp_phy_load_cal_and_init(void) #endif #ifdef CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE - esp_phy_calibration_mode_t calibration_mode = PHY_RF_CAL_PARTIAL; + esp_phy_calibration_mode_t calibration_mode = CONFIG_ESP_PHY_CALIBRATION_MODE; uint8_t sta_mac[6]; if (esp_rom_get_reset_reason(0) == RESET_REASON_CORE_DEEP_SLEEP) { calibration_mode = PHY_RF_CAL_NONE;