fix(sdmmc): Multi-block read/writes support refactor + tests and documentation added

This commit is contained in:
Adam Múdry
2026-03-16 13:33:03 +01:00
parent 6c24854436
commit 653cea9c94
17 changed files with 248 additions and 53 deletions
@@ -1,5 +1,5 @@
idf_component_register(SRCS "test_sdmmc_app.c"
PRIV_INCLUDE_DIRS "."
PRIV_REQUIRES esp_blockdev unity sdmmc esp_driver_sdmmc sdmmc_tests
PRIV_REQUIRES esp_blockdev unity sdmmc esp_driver_sdmmc sdmmc_tests common_test_flows
WHOLE_ARCHIVE
)
@@ -12,6 +12,7 @@
#include "sd_protocol_defs.h"
#include "sdmmc_cmd.h"
#include "sdmmc_test_begin_end_sd.h"
#include "sdmmc_test_rw_common.h"
#include "esp_blockdev.h"
TEST_GROUP(sdmmc);
@@ -69,9 +70,22 @@ TEST(sdmmc, test_bdl_interface)
sdmmc_test_sd_end(&card);
}
TEST(sdmmc, test_multiblock_unaligned_rw)
{
sdmmc_card_t card;
int slot = 1;
int width = 1;
int freq_khz = SDMMC_FREQ_DEFAULT;
sdmmc_test_sd_skip_if_board_incompatible(slot, width, freq_khz, 0, 0);
sdmmc_test_sd_begin(slot, width, freq_khz, 0, &card);
sdmmc_test_rw_unaligned_buffer_multiblock(&card, 4);
sdmmc_test_sd_end(&card);
}
TEST_GROUP_RUNNER(sdmmc)
{
RUN_TEST_CASE(sdmmc, test_bdl_interface)
RUN_TEST_CASE(sdmmc, test_multiblock_unaligned_rw)
}
void app_main(void)
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytest_embedded import Dut
@@ -6,6 +6,7 @@ from pytest_embedded_idf.utils import idf_parametrize
@pytest.mark.sdcard
@idf_parametrize('config', ['default'], indirect=['config'])
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_sdmmc_extra(dut: Dut) -> None:
dut.expect_unity_test_output()