Skip to content

Commit d501eba

Browse files
committed
Merge branch 'feature/set_phy_cal_option_according_to_cal_data_check' into 'master'
feat(esp8266): set phy cal option according to cal data check See merge request sdk/ESP8266_RTOS_SDK!1096
2 parents e7cfc98 + 0f4a396 commit d501eba

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

components/esp8266/Kconfig

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -560,39 +560,17 @@ endmenu
560560

561561
menu PHY
562562

563-
choice ESP8266_PHY_CALIBRATION
564-
prompt "RF calibration"
565-
default ESP8266_PHY_FULL_CALIBRATION
566-
help
567-
If calibration data is not found, full calibration will be performed. To ensure better RF performance,
568-
it is recommend to set RF_calibration to ESP8266_PHY_FULL_CALIBRATION, otherwise the RF performance may become poor.
569-
570-
Full calibration needs 170 - 180ms.
571-
Partial calibration needs 35 - 40ms.
572-
No calibration needs 3.260 - 3.264ms.
573-
574-
config ESP8266_PHY_FULL_CALIBRATION
575-
bool "RF full calibration"
576-
config ESP8266_PHY_NO_CALIBRATION
577-
bool "RF no calibration"
578-
config ESP8266_PHY_PARTIAL_CALIBRATION
579-
bool "RF partial calibration"
580-
endchoice
581-
582-
config ESP8266_PHY_CALIBRATION
583-
int
584-
default 3 if ESP8266_PHY_FULL_CALIBRATION
585-
default 2 if ESP8266_PHY_PARTIAL_CALIBRATION
586-
default 1 if ESP8266_PHY_NO_CALIBRATION
587-
588563
config ESP_PHY_CALIBRATION_AND_DATA_STORAGE
589564
bool "Store phy calibration data in NVS"
590565
default y
591566
help
592567
If this option is enabled, NVS will be initialized and calibration data will be loaded from there.
593-
PHY calibration will be skipped on deep sleep wakeup. If calibration data is not found, full calibration
594-
will be performed and stored in NVS. Normally, only partial calibration will be performed.
595-
If this option is disabled, full calibration will be performed.
568+
If calibration data is not found, full calibration will be performed and stored in NVS. Normally,
569+
only partial calibration will be performed. If this option is disabled, full calibration will be performed.
570+
571+
Full calibration needs 170 - 180ms.
572+
Partial calibration needs 35 - 40ms.
573+
No calibration needs 3.260 - 3.264ms.
596574

597575
If it's easy that your board calibrate bad data, choose 'n'.
598576
Two cases for example, you should choose 'n':

components/esp8266/source/phy_init.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data, esp_phy_calibrat
8585
phy_check_data_table(phy_rx_gain_dc_table, 125, 1);
8686

8787
phy_afterwake_set_rfoption(1);
88-
phy_set_powerup_option(CONFIG_ESP8266_PHY_CALIBRATION);
8988

9089
if (!cal_data_check) {
90+
phy_set_powerup_option(1);
9191
write_data_to_rtc(calibration_data->rf_cal_data);
92+
} else {
93+
phy_set_powerup_option(3);
9294
}
9395

9496
esp_efuse_mac_get_default(sta_mac);

0 commit comments

Comments
 (0)