fix(rtc): fixed bbpll not calibrated from bootloader issue

This commit is contained in:
Xiao Xufeng
2023-11-07 16:16:23 +08:00
committed by Michael (XIAO Xufeng)
parent 8775b99d93
commit c204f418ef
7 changed files with 96 additions and 0 deletions
+9
View File
@@ -564,6 +564,15 @@ menu "ESP System Settings"
This config allows to trigger a panic interrupt when Stack Pointer register goes out of allocated stack
memory bounds.
config ESP_SYSTEM_BBPLL_RECALIB
bool "Re-calibration BBPLL at startup"
depends on IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32H2
default y
help
This configuration helps to address an BBPLL inaccurate issue when boot from certain bootloader version,
which may increase about the boot-up time by about 200 us. Disable this when your bootloader is built with
ESP-IDF version v5.2 and above.
endmenu # ESP System Settings
menu "IPC (Inter-Processor Call)"
+7
View File
@@ -544,7 +544,14 @@ void IRAM_ATTR call_start_cpu0(void)
* In this stage, we re-configure the Flash (and MSPI) to required configuration
*/
spi_flash_init_chip_state();
// In earlier version of ESP-IDF, the PLL provided by bootloader is not stable enough.
// Do calibration again here so that we can use better clock for the timing tuning.
#if CONFIG_ESP_SYSTEM_BBPLL_RECALIB
rtc_clk_recalib_bbpll();
#endif
#if SOC_MEMSPI_SRC_FREQ_120M
// This function needs to be called when PLL is enabled
mspi_timing_flash_tuning();
#endif