diff --git a/cores/esp32/esp32-hal-psram.c b/cores/esp32/esp32-hal-psram.c index d0c0504a..7a8cc0be 100644 --- a/cores/esp32/esp32-hal-psram.c +++ b/cores/esp32/esp32-hal-psram.c @@ -51,6 +51,11 @@ bool psramInit(){ log_w("PSRAM not supported!"); return false; } +#elif CONFIG_IDF_TARGET_ESP32S2 + extern void esp_config_data_cache_mode(void); + esp_config_data_cache_mode(); + Cache_Enable_DCache(0); +#endif if (esp_spiram_init() != ESP_OK) { spiramFailed = true; log_w("PSRAM init failed!"); @@ -61,11 +66,6 @@ bool psramInit(){ return false; } esp_spiram_init_cache(); -#elif CONFIG_IDF_TARGET_ESP32S2 - extern void esp_config_data_cache_mode(void); - esp_config_data_cache_mode(); - Cache_Enable_DCache(0); -#endif if (!esp_spiram_test()) { spiramFailed = true; log_e("PSRAM test failed!");