Skip to content

Commit 35db5e7

Browse files
andreagilardonipennam
authored andcommitted
Ota H7 unmount filesystem before reset hotfix
1 parent 249bae3 commit 35db5e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ota/implementation/OTASTM32H7.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ OTACloudProcessInterface::State STM32H7OTACloudProcess::flashOTA() {
8383
return OtaStorageOpenFail;
8484
}
8585

86+
storageClean();
87+
8688
// this sets the registries in RTC to load the firmware from the storage selected at the next reboot
8789
STM32H747::writeBackupRegister(RTCBackup::DR0, 0x07AA);
8890
STM32H747::writeBackupRegister(RTCBackup::DR1, storage);
@@ -113,7 +115,9 @@ void STM32H7OTACloudProcess::storageClean() {
113115
DEBUG_VERBOSE(F("storage clean"));
114116

115117
if(decompressed != nullptr) {
116-
fclose(decompressed);
118+
int res = fclose(decompressed);
119+
DEBUG_VERBOSE("error on fclose %d", res);
120+
117121
decompressed = nullptr;
118122
}
119123

0 commit comments

Comments
 (0)