From 84e3d7de85a5b74386f1b0893c3b753940398374 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 | 4 +--- 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(+), 3 deletions(-) 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 fea64b358a8..833d174d69d 100644 --- a/components/esp_psram/esp32/esp_psram_impl_quad.c +++ b/components/esp_psram/esp32/esp_psram_impl_quad.c @@ -362,9 +362,7 @@ static int psram_cmd_config(psram_spi_num_t spi_num, psram_cmd_t* pInData) // Load send buffer 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]); - } + memcpy((void*)SPI_W0_REG(spi_num), p_tx_val, len * 4); } // Set data send buffer length.Max data length 64 bytes. SET_PERI_REG_BITS(SPI_MOSI_DLEN_REG(spi_num), SPI_USR_MOSI_DBITLEN, (pInData->txDataBitLen - 1), diff --git a/components/esp_psram/test_apps/psram/pytest_psram.py b/components/esp_psram/test_apps/psram/pytest_psram.py index ed7d205499b..e086f7f27ff 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 @@ '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 00000000000..5a873663dc6 --- /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