From 02970813b8d2ed706b196ac1fb233f2a6d0cae08 Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Sun, 25 Apr 2021 18:34:37 +0800 Subject: [PATCH 1/2] sdmmc_host: add unit tests and improve documents about using eMMC in 4-line SDR mode --- components/sdmmc/test/test_sd.c | 7 +++++++ docs/en/api-reference/peripherals/sdmmc_host.rst | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/sdmmc/test/test_sd.c b/components/sdmmc/test/test_sd.c index fd7051cbd2..6a896d8b07 100644 --- a/components/sdmmc/test/test_sd.c +++ b/components/sdmmc/test/test_sd.c @@ -138,6 +138,13 @@ TEST_CASE("probe eMMC, slot 0, 4-bit, DDR", "[sd][test_env=EMMC]") probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_HIGHSPEED, 1); } +TEST_CASE("probe eMMC, slot 0, 4-bit", "[sd][test_env=EMMC]") +{ + probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_PROBING, 0); + probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_DEFAULT, 0); + probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_HIGHSPEED, 0); +} + TEST_CASE("probe eMMC, slot 0, 8-bit", "[sd][test_env=EMMC]") { probe_sd(SDMMC_HOST_SLOT_0, 8, SDMMC_FREQ_PROBING, 0); diff --git a/docs/en/api-reference/peripherals/sdmmc_host.rst b/docs/en/api-reference/peripherals/sdmmc_host.rst index a092c9c070..e2898a3bd8 100644 --- a/docs/en/api-reference/peripherals/sdmmc_host.rst +++ b/docs/en/api-reference/peripherals/sdmmc_host.rst @@ -51,8 +51,8 @@ Supported Speed Modes SDMMC Host driver supports the following speed modes: -- Default Speed (20 MHz), 4-line/1-line (with SD cards), and 8-line (with 3.3 V eMMC) -- High Speed (40 MHz), 4-line/1-line (with SD cards), and 8-line (with 3.3 V eMMC) +- Default Speed (20 MHz), 1/4-line (with SD cards), and 1/4/8-line (with 3.3 V eMMC) +- High Speed (40 MHz), 1/4-line (with SD cards), and 1/4/8-line (with 3.3 V eMMC) - High Speed DDR (40 MHz), 4-line (with 3.3 V eMMC) Speed modes not supported at present: From cfa4beb661cfd062d9184d42805214a3ac28634f Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Mon, 26 Apr 2021 09:55:39 +0800 Subject: [PATCH 2/2] test_sd: merge emmc SDR/DDR test cases of 4-bit mode --- components/sdmmc/test/test_sd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/sdmmc/test/test_sd.c b/components/sdmmc/test/test_sd.c index 6a896d8b07..2a5653d517 100644 --- a/components/sdmmc/test/test_sd.c +++ b/components/sdmmc/test/test_sd.c @@ -133,20 +133,19 @@ TEST_CASE("probe SD, slot 1, 1-bit", "[sd][test_env=UT_T1_SDMODE]") } #ifdef WITH_EMMC_TEST -TEST_CASE("probe eMMC, slot 0, 4-bit, DDR", "[sd][test_env=EMMC]") -{ - probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_HIGHSPEED, 1); -} - TEST_CASE("probe eMMC, slot 0, 4-bit", "[sd][test_env=EMMC]") { + //Test with SDR probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_PROBING, 0); probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_DEFAULT, 0); probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_HIGHSPEED, 0); + //Test with DDR + probe_sd(SDMMC_HOST_SLOT_0, 4, SDMMC_FREQ_HIGHSPEED, 1); } TEST_CASE("probe eMMC, slot 0, 8-bit", "[sd][test_env=EMMC]") { + //8-bit DDR not supported yet, test with SDR only probe_sd(SDMMC_HOST_SLOT_0, 8, SDMMC_FREQ_PROBING, 0); probe_sd(SDMMC_HOST_SLOT_0, 8, SDMMC_FREQ_DEFAULT, 0); probe_sd(SDMMC_HOST_SLOT_0, 8, SDMMC_FREQ_HIGHSPEED, 0);