diff --git a/components/esp_driver_sdmmc/test_apps/sd_test_utils/components/common_test_flows/sdmmc_test_rw_common.c b/components/esp_driver_sdmmc/test_apps/sd_test_utils/components/common_test_flows/sdmmc_test_rw_common.c index 360928efd8..b883e00435 100644 --- a/components/esp_driver_sdmmc/test_apps/sd_test_utils/components/common_test_flows/sdmmc_test_rw_common.c +++ b/components/esp_driver_sdmmc/test_apps/sd_test_utils/components/common_test_flows/sdmmc_test_rw_common.c @@ -149,7 +149,7 @@ void sdmmc_test_rw_performance(sdmmc_card_t *card, FILE *perf_log) do_single_rw_perf_test(card, offset, 1, 1, perf_log, 0); do_single_rw_perf_test(card, offset, 8, 1, perf_log, 0); do_single_rw_perf_test(card, offset, 128, 1, perf_log, 0); -#if CONFIG_SPIRAM && SOC_SDMMC_PSRAM_DMA_CAPABLE +#if CONFIG_SPIRAM /* spiram */ do_single_rw_perf_test(card, offset, 1, 4, perf_log, MALLOC_CAP_SPIRAM); do_single_rw_perf_test(card, offset, 4, 4, perf_log, MALLOC_CAP_SPIRAM); diff --git a/components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/sdmmc_test_rw_sd.c b/components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/sdmmc_test_rw_sd.c index b8740ff533..942bae84b7 100644 --- a/components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/sdmmc_test_rw_sd.c +++ b/components/esp_driver_sdmmc/test_apps/sdmmc/components/sdmmc_tests/sdmmc_test_rw_sd.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -37,6 +37,11 @@ TEST_CASE("sdmmc read/write performance, slot 0, 8-bit", "[sdmmc]") do_one_sdmmc_perf_test(SLOT_0, 8, SDMMC_FREQ_HIGHSPEED, NO_DDR, NULL); } +TEST_CASE("sdmmc read/write performance, slot 1, 1-bit", "[sdmmc]") +{ + do_one_sdmmc_perf_test(SLOT_1, 1, SDMMC_FREQ_HIGHSPEED, NO_DDR, NULL); +} + TEST_CASE("sdmmc read/write performance, slot 1, 4-bit", "[sdmmc]") { /* Set up in-memory file for collecting performance logs */ diff --git a/components/sdmmc/sdmmc_cmd.c b/components/sdmmc/sdmmc_cmd.c index 08e5cf3d1c..fb18a9d696 100644 --- a/components/sdmmc/sdmmc_cmd.c +++ b/components/sdmmc/sdmmc_cmd.c @@ -408,7 +408,11 @@ esp_err_t sdmmc_write_sectors(sdmmc_card_t* card, const void* src, #ifdef SOC_SDMMC_PSRAM_DMA_CAPABLE dma_mem_info.extra_heap_caps |= MALLOC_CAP_SPIRAM; #endif - if (esp_dma_is_buffer_alignment_satisfied(src, block_size * block_count, dma_mem_info)) { + if (esp_dma_is_buffer_alignment_satisfied(src, block_size * block_count, dma_mem_info) + #if !SOC_SDMMC_PSRAM_DMA_CAPABLE + && !esp_ptr_external_ram(src) + #endif + ) { err = sdmmc_write_sectors_dma(card, src, start_block, block_count, block_size * block_count); } else { // SDMMC peripheral needs DMA-capable buffers. Split the write into @@ -531,7 +535,11 @@ esp_err_t sdmmc_read_sectors(sdmmc_card_t* card, void* dst, size_t block_size = card->csd.sector_size; esp_dma_mem_info_t dma_mem_info; card->host.get_dma_info(card->host.slot, &dma_mem_info); - if (esp_dma_is_buffer_alignment_satisfied(dst, block_size * block_count, dma_mem_info)) { + if (esp_dma_is_buffer_alignment_satisfied(dst, block_size * block_count, dma_mem_info) + #if !SOC_SDMMC_PSRAM_DMA_CAPABLE + && !esp_ptr_external_ram(dst) + #endif + ) { err = sdmmc_read_sectors_dma(card, dst, start_block, block_count, block_size * block_count); } else { // SDMMC peripheral needs DMA-capable buffers. Split the read into