forked from espressif/esp-idf
Merge branch 'bugfix/sdspi_tests' into 'master'
sdspi: test-related fixes Closes IDF-8750 See merge request espressif/esp-idf!30612
This commit is contained in:
@@ -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
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -18,6 +18,7 @@ static void do_one_sdspi_probe(int slot, int freq_khz)
|
|||||||
sdmmc_card_print_info(stdout, &card);
|
sdmmc_card_print_info(stdout, &card);
|
||||||
uint8_t* buffer = heap_caps_calloc(512, 1, MALLOC_CAP_DMA);
|
uint8_t* buffer = heap_caps_calloc(512, 1, MALLOC_CAP_DMA);
|
||||||
TEST_ESP_OK(sdmmc_read_sectors(&card, buffer, 0, 1));
|
TEST_ESP_OK(sdmmc_read_sectors(&card, buffer, 0, 1));
|
||||||
|
free(buffer);
|
||||||
sdmmc_test_spi_end(slot, &card);
|
sdmmc_test_spi_end(slot, &card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,21 +33,16 @@ TEST_CASE("sdspi probe, slot 0, HS", "[sdspi]")
|
|||||||
do_one_sdspi_probe(SLOT_0, SDMMC_FREQ_HIGHSPEED);
|
do_one_sdspi_probe(SLOT_0, SDMMC_FREQ_HIGHSPEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32S3
|
|
||||||
//TODO: IDF-8750. Leaks too much memory, needs check
|
|
||||||
TEST_CASE("sdspi probe, slot 1", "[sdspi]")
|
TEST_CASE("sdspi probe, slot 1", "[sdspi]")
|
||||||
{
|
{
|
||||||
do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_PROBING);
|
do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_PROBING);
|
||||||
do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_DEFAULT);
|
do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_DEFAULT);
|
||||||
do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_CUSTOM_10M);
|
do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_CUSTOM_10M);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32S3
|
|
||||||
//TODO: IDF-8749
|
|
||||||
//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749
|
|
||||||
TEST_CASE("sdspi probe, slot 1, HS", "[sdspi]")
|
TEST_CASE("sdspi probe, slot 1, HS", "[sdspi]")
|
||||||
{
|
{
|
||||||
|
//TODO: IDF-8749
|
||||||
|
//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749
|
||||||
do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_DEFAULT);
|
do_one_sdspi_probe(SLOT_1, SDMMC_FREQ_DEFAULT);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@@ -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
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -26,14 +26,12 @@ TEST_CASE("sdspi read/write performance, slot 0", "[sdspi]")
|
|||||||
do_one_sdspi_perf_test(SLOT_0, SDMMC_FREQ_HIGHSPEED);
|
do_one_sdspi_perf_test(SLOT_0, SDMMC_FREQ_HIGHSPEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32S3
|
|
||||||
//TODO: IDF-8749
|
|
||||||
//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749
|
|
||||||
TEST_CASE("sdspi read/write performance, slot 1", "[sdspi]")
|
TEST_CASE("sdspi read/write performance, slot 1", "[sdspi]")
|
||||||
{
|
{
|
||||||
|
//TODO: IDF-8749
|
||||||
|
//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749
|
||||||
do_one_sdspi_perf_test(SLOT_1, SDMMC_FREQ_DEFAULT);
|
do_one_sdspi_perf_test(SLOT_1, SDMMC_FREQ_DEFAULT);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ========== Read/write tests with offset, SPI ========== */
|
/* ========== Read/write tests with offset, SPI ========== */
|
||||||
|
|
||||||
@@ -52,14 +50,12 @@ TEST_CASE("sdspi read/write performance with offset, slot 0", "[sdspi]")
|
|||||||
do_one_sdspi_rw_test_with_offset(SLOT_0, SDMMC_FREQ_HIGHSPEED);
|
do_one_sdspi_rw_test_with_offset(SLOT_0, SDMMC_FREQ_HIGHSPEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32S3
|
|
||||||
//TODO: IDF-8749
|
|
||||||
//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749
|
|
||||||
TEST_CASE("sdspi read/write performance with offset, slot 1", "[sdspi]")
|
TEST_CASE("sdspi read/write performance with offset, slot 1", "[sdspi]")
|
||||||
{
|
{
|
||||||
|
//TODO: IDF-8749
|
||||||
|
//here freq should be changed to SDMMC_FREQ_HIGHSPEED after fixing IDF-8749
|
||||||
do_one_sdspi_rw_test_with_offset(SLOT_1, SDMMC_FREQ_DEFAULT);
|
do_one_sdspi_rw_test_with_offset(SLOT_1, SDMMC_FREQ_DEFAULT);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ========== Read/write tests with unaligned source/destination buffer, SPI ========== */
|
/* ========== Read/write tests with unaligned source/destination buffer, SPI ========== */
|
||||||
|
|
||||||
|
@@ -13,11 +13,13 @@
|
|||||||
|
|
||||||
void setUp(void)
|
void setUp(void)
|
||||||
{
|
{
|
||||||
|
printf("%s", ""); /* sneakily lazy-allocate the reent structure for this test task */
|
||||||
unity_utils_record_free_mem();
|
unity_utils_record_free_mem();
|
||||||
}
|
}
|
||||||
|
|
||||||
void tearDown(void)
|
void tearDown(void)
|
||||||
{
|
{
|
||||||
|
esp_reent_cleanup();
|
||||||
unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD);
|
unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
from pytest_embedded_idf import IdfDut
|
from pytest_embedded_idf import IdfDut
|
||||||
|
|
||||||
|
|
||||||
def test_sdspi(dut: IdfDut) -> None:
|
def test_sdspi(dut: IdfDut) -> None:
|
||||||
dut.run_all_single_board_cases()
|
dut.run_all_single_board_cases(reset=True)
|
||||||
|
Reference in New Issue
Block a user