diff --git a/CHANGELOG.md b/CHANGELOG.md index 444de7428..3de2a4631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ customers cannot upgrade their bootloader, its changes are recorded separately. - simulator: simulate a Nova device - Add API call to fetch multiple xpubs at once - Add the option for the simulator to write its memory to file. +- Attempt to fix "backup creation failed" while backup creation actually succeeded ### 9.23.2 - Improve touch sensor reliability when the sdcard is inserted diff --git a/src/sd.c b/src/sd.c index 8d0462a4c..645c2de41 100644 --- a/src/sd.c +++ b/src/sd.c @@ -29,6 +29,7 @@ #include "screen.h" #include "sd.h" #include "util.h" +#include #include @@ -311,14 +312,17 @@ void sd_free_list(sd_list_t* list) bool sd_card_inserted(void) { + // The sd card is allowed up to 1s to initialize, therefore the usb processing timeout must also + // be increased by about 1s. + usb_processing_timeout_reset(-10); #ifdef TESTING return true; #else sd_mmc_err_t err = sd_mmc_check(0); /* If initialization is ongoing, wait up to 1 second for it to initialize */ if (err == SD_MMC_INIT_ONGOING) { - for (int i = 0; i < 10; ++i) { - delay_ms(100); + for (int i = 0; i < 100; ++i) { + delay_ms(10); err = sd_mmc_check(0); if (err != SD_MMC_INIT_ONGOING) { break;