Examples/Storage: sufficient timeout for SD formatting

Too short timeouts often cause useless failures on large-capacity SDs (16GB+)
Fixed by adding 60 sec timeout on new "Filesystem mounted" checkpoint

JIRA IDF-3741
This commit is contained in:
Martin Vychodil 2021-08-20 13:47:25 +02:00
parent 6b9cc71931
commit a866779070
4 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,7 @@ void app_main(void)
// connected on the bus. This is for debug / example purpose only.
slot_config.flags |= SDMMC_SLOT_FLAG_INTERNAL_PULLUP;
ESP_LOGI(TAG, "Mounting filesystem");
ret = esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card);
if (ret != ESP_OK) {
@ -83,6 +84,7 @@ void app_main(void)
}
return;
}
ESP_LOGI(TAG, "Filesystem mounted");
// Card has been initialized, print its properties
sdmmc_card_print_info(stdout, card);

View File

@ -12,6 +12,9 @@ def test_examples_sd_card(env, extra_data): # type: (ttfw_idf.Env.Env, None ) -
dut.expect('example: Initializing SD card', timeout=20)
dut.expect('example: Using SDMMC peripheral', timeout=10)
# 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
name = dut.expect(re.compile(r'Name: (\w+)'), timeout=10)[0]
_type = dut.expect(re.compile(r'Type: (\S+)'), timeout=10)[0]

View File

@ -88,6 +88,7 @@ void app_main(void)
slot_config.gpio_cs = PIN_NUM_CS;
slot_config.host_id = host.slot;
ESP_LOGI(TAG, "Mounting filesystem");
ret = esp_vfs_fat_sdspi_mount(mount_point, &host, &slot_config, &mount_config, &card);
if (ret != ESP_OK) {
@ -100,6 +101,7 @@ void app_main(void)
}
return;
}
ESP_LOGI(TAG, "Filesystem mounted");
// Card has been initialized, print its properties
sdmmc_card_print_info(stdout, card);

View File

@ -12,6 +12,9 @@ def test_examples_sd_card(env, extra_data): # type: (ttfw_idf.Env.Env, None ) -
dut.expect('example: Initializing SD card', timeout=20)
dut.expect('example: Using SPI peripheral', timeout=20)
# 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
name = dut.expect(re.compile(r'Name: (\w+)'), timeout=20)[0]
_type = dut.expect(re.compile(r'Type: (\S+)'), timeout=20)[0]