From 9a428c40197d0f8b75bd8e5c1c90dae5c7d8f529 Mon Sep 17 00:00:00 2001 From: Armando Date: Tue, 7 Nov 2023 10:35:04 +0800 Subject: [PATCH] fix(mmap): fix esp32s3 mmap test wrong assertion --- components/spi_flash/test/test_mmap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/spi_flash/test/test_mmap.c b/components/spi_flash/test/test_mmap.c index 489fc4e3c2..251419b631 100644 --- a/components/spi_flash/test/test_mmap.c +++ b/components/spi_flash/test/test_mmap.c @@ -368,7 +368,12 @@ TEST_CASE("phys2cache/cache2phys basic checks", "[spi_flash][mmap]") uint32_t phys = spi_flash_cache2phys(esp_partition_find); TEST_ASSERT_NOT_EQUAL(SPI_FLASH_CACHE2PHYS_FAIL, phys); TEST_ASSERT_EQUAL_PTR(esp_partition_find, spi_flash_phys2cache(phys, SPI_FLASH_MMAP_INST)); +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 + /** + * Only esp32 and esp32s2 is I or D take up a bus exclusively + */ TEST_ASSERT_EQUAL_PTR(NULL, spi_flash_phys2cache(phys, SPI_FLASH_MMAP_DATA)); +#endif /* Read the flash @ 'phys' and compare it to the data we get via regular cache access */ spi_flash_read_maybe_encrypted(phys, buf, sizeof(buf)); @@ -384,7 +389,12 @@ TEST_CASE("phys2cache/cache2phys basic checks", "[spi_flash][mmap]") TEST_ASSERT_NOT_EQUAL(SPI_FLASH_CACHE2PHYS_FAIL, phys); TEST_ASSERT_EQUAL_PTR(&constant_data, spi_flash_phys2cache(phys, SPI_FLASH_MMAP_DATA)); +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 + /** + * Only esp32 and esp32s2 is I or D take up a bus exclusively + */ TEST_ASSERT_EQUAL_PTR(NULL, spi_flash_phys2cache(phys, SPI_FLASH_MMAP_INST)); +#endif /* Read the flash @ 'phys' and compare it to the data we get via normal cache access */ spi_flash_read_maybe_encrypted(phys, buf, sizeof(constant_data));