Skip to content

Commit

Permalink
soc: esp32: add SPIRAM memory test kconfig option
Browse files Browse the repository at this point in the history
Add kconfig to disable SPIRAM memory test. Allows
faster SoC initialization when disabled.

Signed-off-by: Sylvio Alves <[email protected]>
  • Loading branch information
sylvioalves authored and mmahadevan108 committed Sep 28, 2024
1 parent 1596ee0 commit 0d118ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions soc/espressif/common/Kconfig.spiram
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ config ESP_SPIRAM_HEAP_SIZE
help
Specify size of SPIRAM heap.

config ESP_SPIRAM_MEMTEST
bool "Run memory test on SPI RAM initialization"
default y
help
Runs a memory test on initialization. Disable this for faster startup.

choice SPIRAM_MODE
prompt "Mode (QUAD/OCT) of SPI RAM chip in use"
default SPIRAM_MODE_QUAD
Expand Down
10 changes: 6 additions & 4 deletions soc/espressif/common/psram.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ void esp_init_psram(void)
ets_printf("External RAM size is less than configured.\n");
}

if (esp_psram_is_initialized()) {
if (!esp_psram_extram_test()) {
ets_printf("External RAM failed memory test!");
return;
if (IS_ENABLED(CONFIG_ESP_SPIRAM_MEMTEST)) {
if (esp_psram_is_initialized()) {
if (!esp_psram_extram_test()) {
ets_printf("External RAM failed memory test!");
return;
}
}
}

Expand Down

0 comments on commit 0d118ec

Please sign in to comment.