mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-19 23:45:28 +02:00
fix(startup): move rtc initialization before MSPI timing tuning to improve stability
This commit is contained in:
@@ -541,6 +541,10 @@ void IRAM_ATTR call_start_cpu0(void)
|
||||
// For Octal flash, it's hard to implement a read_id function in OPI mode for all vendors.
|
||||
// So we have to read it here in SPI mode, before entering the OPI mode.
|
||||
bootloader_flash_update_id();
|
||||
|
||||
// Configure the power related stuff. After this the MSPI timing tuning can be done.
|
||||
esp_rtc_init();
|
||||
|
||||
/**
|
||||
* This function initialise the Flash chip to the user-defined settings.
|
||||
*
|
||||
@@ -549,14 +553,9 @@ 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
|
||||
// This function needs to be called when PLL is enabled. Needs to be called after spi_flash_init_chip_state in case
|
||||
// some state of flash is modified.
|
||||
mspi_timing_flash_tuning();
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user