mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-10-20 13:45:08 +08:00
Merge branch 'feature/add_phy_partial_calibration_v3.2' into 'release/v3.2'
feat(esp8266): set phy cal option according to cal data check (backport v3.2) See merge request sdk/ESP8266_RTOS_SDK!1222
This commit is contained in:
@@ -472,9 +472,12 @@ config ESP_PHY_CALIBRATION_AND_DATA_STORAGE
|
||||
default y
|
||||
help
|
||||
If this option is enabled, NVS will be initialized and calibration data will be loaded from there.
|
||||
PHY calibration will be skipped on deep sleep wakeup. If calibration data is not found, full calibration
|
||||
will be performed and stored in NVS. Normally, only partial calibration will be performed.
|
||||
If this option is disabled, full calibration will be performed.
|
||||
If calibration data is not found, full calibration will be performed and stored in NVS. Normally,
|
||||
only partial calibration will be performed. If this option is disabled, full calibration will be performed.
|
||||
|
||||
Full calibration needs 170 - 180ms.
|
||||
Partial calibration needs 35 - 40ms.
|
||||
No calibration needs 3.260 - 3.264ms.
|
||||
|
||||
If it's easy that your board calibrate bad data, choose 'n'.
|
||||
Two cases for example, you should choose 'n':
|
||||
|
@@ -26,6 +26,8 @@ uint8_t phy_check_data_table(uint32_t *table, uint8_t, uint8_t);
|
||||
|
||||
void phy_afterwake_set_rfoption(uint8_t);
|
||||
|
||||
void phy_set_powerup_option(uint8_t);
|
||||
|
||||
void write_data_to_rtc(uint8_t *);
|
||||
|
||||
void get_data_from_rtc(uint8_t *);
|
||||
|
@@ -76,6 +76,7 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data, esp_phy_calibrat
|
||||
#endif
|
||||
|
||||
memcpy(local_init_data, init_data->params, 128);
|
||||
memcpy(local_init_data + 128, calibration_data->rf_cal_data, 128);
|
||||
|
||||
extern uint32_t* phy_rx_gain_dc_table;
|
||||
phy_rx_gain_dc_table = calibration_data->rx_gain_dc_table;
|
||||
@@ -85,7 +86,10 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data, esp_phy_calibrat
|
||||
phy_afterwake_set_rfoption(1);
|
||||
|
||||
if (!cal_data_check) {
|
||||
phy_set_powerup_option(1);
|
||||
write_data_to_rtc(calibration_data->rf_cal_data);
|
||||
} else {
|
||||
phy_set_powerup_option(3);
|
||||
}
|
||||
|
||||
esp_efuse_mac_get_default(sta_mac);
|
||||
|
Reference in New Issue
Block a user