diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 0faff7c..3fd0ec9 100755 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -44,6 +44,7 @@ PRIV_REQUIRES "esp_event" "esp_http_server" "esp_netif" + "esp_psram" "esp_timer" "esp_wifi" "json" diff --git a/main/self_test/self_test.c b/main/self_test/self_test.c index 5f6dc2c..d315e07 100644 --- a/main/self_test/self_test.c +++ b/main/self_test/self_test.c @@ -21,6 +21,7 @@ #include "vcore.h" #include "utils.h" #include "TPS546.h" +#include "esp_psram.h" #define GPIO_ASIC_ENABLE CONFIG_GPIO_ASIC_ENABLE @@ -288,6 +289,15 @@ esp_err_t test_init_peripherals(GlobalState * GLOBAL_STATE) { return ESP_OK; } +esp_err_t test_psram(GlobalState * GLOBAL_STATE){ + if(!esp_psram_is_initialized()) { + ESP_LOGE(TAG, "No PSRAM available on ESP32!"); + display_msg("PSRAM:FAIL", GLOBAL_STATE); + return ESP_FAIL; + } + return ESP_OK; +} + /** * @brief Perform a self-test of the system. * @@ -304,6 +314,12 @@ void self_test(void * pvParameters) GLOBAL_STATE->SELF_TEST_MODULE.active = true; + //Run PSRAM test + if(test_psram(GLOBAL_STATE) != ESP_OK) { + ESP_LOGE(TAG, "NO PSRAM on device!"); + tests_done(GLOBAL_STATE, TESTS_FAILED); + } + //Run display tests if (test_display(GLOBAL_STATE) != ESP_OK) { ESP_LOGE(TAG, "Display test failed!");