From 76ee450c3dc6eeb7203d4db2516edb4c47014f6b Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 11 Jul 2018 07:47:41 +0300 Subject: [PATCH] Erase flash before the first use added. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Пожалуйста, введите сообщение коммита для ваших изменений. Строки, --- components/fatfs/test/test_fatfs_sdmmc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/fatfs/test/test_fatfs_sdmmc.c b/components/fatfs/test/test_fatfs_sdmmc.c index c523c0e0e..2ab31f087 100644 --- a/components/fatfs/test/test_fatfs_sdmmc.c +++ b/components/fatfs/test/test_fatfs_sdmmc.c @@ -214,6 +214,11 @@ TEST_CASE("(SD) mount two FAT partitions, SDMMC and WL, at the same time", "[fat const char* str_sd = "this is sd\n"; const char* str_wl = "this is spiflash\n"; + /* Erase flash before the firs use */ + const esp_partition_t *test_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "flash_test"); + esp_partition_erase_range(test_partition, 0, test_partition->size); + printf("Partition erased: addr- 0x%08x, size- 0x%08x\n", test_partition->address, test_partition->size); + /* Mount FATFS in SD can WL at the same time. Create a file on each FS */ wl_handle_t wl_handle = WL_INVALID_HANDLE; test_setup();