From cbafe67ee1fd0bc31a4c98e2ae52cb322ab0ef81 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Tue, 17 Nov 2020 01:13:23 +0200 Subject: [PATCH] Fix PSRAM on S2 --- cores/esp32/esp32-hal-psram.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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!");