Merge branch 'bugfix/sdcard_example_format_timeout_v4.2' into 'release/v4.2'

CI: [Examples/Storage] provide sufficient timeout for SD card formatting (v4.2)

See merge request espressif/esp-idf!14912
This commit is contained in:
Mahavir Jain
2021-10-29 09:44:04 +00:00
2 changed files with 10 additions and 5 deletions

View File

@@ -103,6 +103,7 @@ void app_main(void)
gpio_set_pull_mode(12, GPIO_PULLUP_ONLY); // D2, needed in 4-line mode only gpio_set_pull_mode(12, GPIO_PULLUP_ONLY); // D2, needed in 4-line mode only
gpio_set_pull_mode(13, GPIO_PULLUP_ONLY); // D3, needed in 4- and 1-line modes gpio_set_pull_mode(13, GPIO_PULLUP_ONLY); // D3, needed in 4- and 1-line modes
ESP_LOGI(TAG, "Mounting filesystem");
ret = esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card); ret = esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card);
#else #else
ESP_LOGI(TAG, "Using SPI peripheral"); ESP_LOGI(TAG, "Using SPI peripheral");
@@ -141,6 +142,7 @@ void app_main(void)
} }
return; return;
} }
ESP_LOGI(TAG, "Filesystem mounted");
// Card has been initialized, print its properties // Card has been initialized, print its properties
sdmmc_card_print_info(stdout, card); sdmmc_card_print_info(stdout, card);

View File

@@ -13,6 +13,9 @@ def test_examples_sd_card(env, extra_data):
Utility.console_log('peripheral {} detected'.format(peripheral)) Utility.console_log('peripheral {} detected'.format(peripheral))
assert peripheral in ('SDMMC', 'SPI') assert peripheral in ('SDMMC', 'SPI')
# Provide enough time for possible SD card formatting
dut.expect('Filesystem mounted', timeout=60)
# These lines are matched separately because of ASCII color codes in the output # These lines are matched separately because of ASCII color codes in the output
name = dut.expect(re.compile(r'Name: (\w+)'), timeout=5)[0] name = dut.expect(re.compile(r'Name: (\w+)'), timeout=5)[0]
_type = dut.expect(re.compile(r'Type: (\S+)'), timeout=5)[0] _type = dut.expect(re.compile(r'Type: (\S+)'), timeout=5)[0]