Skip to content

Commit 94ff897

Browse files
committed
Replace mount() with reformat() which results in a reformatted and mounted file-format - now we can be super sure to have a clean set-up.
https://os.mbed.com/docs/mbed-os/v6.11/mbed-os-api-doxy/classmbed_1_1_f_a_t_file_system.html#a6bb5160b6665359b9411ebc65aaa5308
1 parent 06267fb commit 94ff897

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/utility/ota/OTA-nano-rp2040.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ int rp2040_connect_onOTARequest(char const * ota_url)
101101
mbed_watchdog_reset();
102102

103103
mbed::FATFileSystem fs("ota");
104-
if ((err = fs.mount(&flash)) != 0)
104+
if ((err = fs.reformat(&flash)) != 0)
105105
{
106-
DEBUG_ERROR("%s: fs.mount() failed with %d", __FUNCTION__, err);
107-
return static_cast<int>(OTAError::RP2040_ErrorMount);
106+
DEBUG_ERROR("%s: fs.reformat() failed with %d", __FUNCTION__, err);
107+
return static_cast<int>(OTAError::RP2040_ErrorReformat);
108108
}
109109

110110
mbed_watchdog_reset();

src/utility/ota/OTA.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ enum class OTAError : int
4646
RP2040_ErrorWriteUpdateFile = RP2040_OTA_ERROR_BASE - 5,
4747
RP2040_ErrorParseHttpHeader = RP2040_OTA_ERROR_BASE - 6,
4848
RP2040_ErrorFlashInit = RP2040_OTA_ERROR_BASE - 7,
49-
RP2040_ErrorMount = RP2040_OTA_ERROR_BASE - 8,
49+
RP2040_ErrorReformat = RP2040_OTA_ERROR_BASE - 8,
5050
RP2040_ErrorUnmount = RP2040_OTA_ERROR_BASE - 9,
5151
};
5252

0 commit comments

Comments
 (0)