From 9d6809bc9953a9975f8ded9a7df627aa0b60889c Mon Sep 17 00:00:00 2001 From: Armando Date: Wed, 29 Mar 2023 14:59:35 +0800 Subject: [PATCH] psram: fixed esp32 2t mode fail issue --- components/esp_psram/esp32/esp_psram_impl_quad.c | 2 +- components/esp_psram/test_apps/psram/pytest_psram.py | 1 + components/esp_psram/test_apps/psram/sdkconfig.ci.esp32_2t | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 components/esp_psram/test_apps/psram/sdkconfig.ci.esp32_2t diff --git a/components/esp_psram/esp32/esp_psram_impl_quad.c b/components/esp_psram/esp32/esp_psram_impl_quad.c index eba105e11f..39ac6e0736 100644 --- a/components/esp_psram/esp32/esp_psram_impl_quad.c +++ b/components/esp_psram/esp32/esp_psram_impl_quad.c @@ -363,7 +363,7 @@ static int psram_cmd_config(psram_spi_num_t spi_num, psram_cmd_t* pInData) int len = (pInData->txDataBitLen + 31) / 32; if (p_tx_val != NULL) { for (int i = 0; i < len; i++) { - WRITE_PERI_REG(SPI_W0_REG(spi_num), p_tx_val[i]); + WRITE_PERI_REG(SPI_W0_REG(spi_num) + i * 4, p_tx_val[i]); } } // Set data send buffer length.Max data length 64 bytes. diff --git a/components/esp_psram/test_apps/psram/pytest_psram.py b/components/esp_psram/test_apps/psram/pytest_psram.py index e000de1434..b83eb513a8 100644 --- a/components/esp_psram/test_apps/psram/pytest_psram.py +++ b/components/esp_psram/test_apps/psram/pytest_psram.py @@ -11,6 +11,7 @@ from pytest_embedded import Dut 'config', [ 'esp32_release', + 'esp32_2t', ], indirect=True, ) diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32_2t b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32_2t new file mode 100644 index 0000000000..5a873663dc --- /dev/null +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32_2t @@ -0,0 +1,4 @@ +CONFIG_IDF_TARGET="esp32" +CONFIG_SPIRAM=y +CONFIG_SPIRAM_2T_MODE=y +CONFIG_SPIRAM_BANKSWITCH_ENABLE=n