Skip to content

Commit 1c4d75d

Browse files
Jason2866me-no-dev
andauthored
App rollback should be after PSRAM is initialized (#228)
Co-authored-by: me-no-dev <[email protected]>
1 parent 38097a1 commit 1c4d75d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cores/esp32/esp32-hal-misc.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ extern bool btInUse();
251251

252252
void initArduino()
253253
{
254+
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
255+
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
256+
#ifdef F_CPU
257+
setCpuFrequencyMhz(F_CPU/1000000);
258+
#endif
259+
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
260+
psramInit();
261+
#endif
254262
#ifdef CONFIG_APP_ROLLBACK_ENABLE
255263
if(!verifyRollbackLater()){
256264
const esp_partition_t *running = esp_ota_get_running_partition();
@@ -266,14 +274,6 @@ void initArduino()
266274
}
267275
}
268276
}
269-
#endif
270-
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
271-
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
272-
#ifdef F_CPU
273-
setCpuFrequencyMhz(F_CPU/1000000);
274-
#endif
275-
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
276-
psramInit();
277277
#endif
278278
esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL);
279279
esp_err_t err = nvs_flash_init();

0 commit comments

Comments
 (0)