File tree 2 files changed +15
-9
lines changed 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -940,13 +940,18 @@ endmenu # Wi-Fi
940
940
menu PHY
941
941
942
942
config ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
943
- bool "Do phy calibration and store calibration data in NVS"
943
+ bool "Store phy calibration data in NVS"
944
944
default y
945
945
help
946
946
If this option is enabled, NVS will be initialized and calibration data will be loaded from there.
947
947
PHY calibration will be skipped on deep sleep wakeup. If calibration data is not found, full calibration
948
- will be performed and stored in NVS. In all other cases, only partial calibration will be performed.
948
+ will be performed and stored in NVS. Normally, only partial calibration will be performed.
949
+ If this option is disabled, full calibration will be performed.
949
950
951
+ If it's easy that your board calibrate bad data, choose 'n'.
952
+ Two cases for example, you should choose 'n':
953
+ 1.If your board is easy to be booted up with antenna disconnected.
954
+ 2.Because of your board design, each time when you do calibration, the result are too unstable.
950
955
If unsure, choose 'y'.
951
956
952
957
config ESP32_PHY_INIT_DATA_IN_PARTITION
Original file line number Diff line number Diff line change @@ -266,17 +266,17 @@ void esp_phy_load_cal_and_init(void)
266
266
abort ();
267
267
}
268
268
269
- #ifdef CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
270
- esp_phy_calibration_mode_t calibration_mode = PHY_RF_CAL_PARTIAL ;
271
- if (rtc_get_reset_reason (0 ) == DEEPSLEEP_RESET ) {
272
- calibration_mode = PHY_RF_CAL_NONE ;
273
- }
274
269
const esp_phy_init_data_t * init_data = esp_phy_get_init_data ();
275
270
if (init_data == NULL ) {
276
271
ESP_LOGE (TAG , "failed to obtain PHY init data" );
277
272
abort ();
278
273
}
279
274
275
+ #ifdef CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
276
+ esp_phy_calibration_mode_t calibration_mode = PHY_RF_CAL_PARTIAL ;
277
+ if (rtc_get_reset_reason (0 ) == DEEPSLEEP_RESET ) {
278
+ calibration_mode = PHY_RF_CAL_NONE ;
279
+ }
280
280
esp_err_t err = esp_phy_load_cal_data_from_nvs (cal_data );
281
281
if (err != ESP_OK ) {
282
282
ESP_LOGW (TAG , "failed to load RF calibration data (0x%x), falling back to full calibration" , err );
@@ -290,11 +290,12 @@ void esp_phy_load_cal_and_init(void)
290
290
} else {
291
291
err = ESP_OK ;
292
292
}
293
- esp_phy_release_init_data (init_data );
294
293
#else
295
- esp_phy_rf_init (NULL , PHY_RF_CAL_FULL , cal_data );
294
+ esp_phy_rf_init (init_data , PHY_RF_CAL_FULL , cal_data );
296
295
#endif
297
296
297
+ esp_phy_release_init_data (init_data );
298
+
298
299
free (cal_data ); // PHY maintains a copy of calibration data, so we can free this
299
300
}
300
301
You can’t perform that action at this time.
0 commit comments