Skip to content

Commit 5a6507e

Browse files
committed
App rollback should be after PSRAM is initialized
1 parent e343918 commit 5a6507e

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
@@ -249,6 +249,14 @@ extern bool btInUse();
249249

250250
void initArduino()
251251
{
252+
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
253+
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
254+
#ifdef F_CPU
255+
setCpuFrequencyMhz(F_CPU/1000000);
256+
#endif
257+
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
258+
psramInit();
259+
#endif
252260
#ifdef CONFIG_APP_ROLLBACK_ENABLE
253261
if(!verifyRollbackLater()){
254262
const esp_partition_t *running = esp_ota_get_running_partition();
@@ -264,14 +272,6 @@ void initArduino()
264272
}
265273
}
266274
}
267-
#endif
268-
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
269-
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
270-
#ifdef F_CPU
271-
setCpuFrequencyMhz(F_CPU/1000000);
272-
#endif
273-
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
274-
psramInit();
275275
#endif
276276
esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL);
277277
esp_err_t err = nvs_flash_init();

0 commit comments

Comments
 (0)