Skip to content

Commit

Permalink
Merge pull request #460 from arduino-libraries/h7-fclose-issue
Browse files Browse the repository at this point in the history
OTA: STM32H7 unmount filesystem before reset
  • Loading branch information
pennam authored May 20, 2024
2 parents 9e5f513 + ee8e9bb commit faae972
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ jobs:
- name: arduino:mbed_portenta
libraries: |
- name: ArduinoECCX08
- name: Arduino_Portenta_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
Expand All @@ -181,7 +180,6 @@ jobs:
# Install mbed_nicla platform via Boards Manager
- name: arduino:mbed_nicla
libraries: |
- name: Arduino_Portenta_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
Expand All @@ -193,7 +191,6 @@ jobs:
- name: arduino:mbed_opta
libraries: |
- name: ArduinoECCX08
- name: Arduino_Portenta_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
Expand All @@ -205,7 +202,6 @@ jobs:
- name: arduino:mbed_giga
libraries: |
- name: ArduinoECCX08
- name: Arduino_Portenta_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
- examples/utility/Provisioning
Expand All @@ -229,8 +225,6 @@ jobs:
platforms: |
# Install arduino_esp32 platform via Boards Manager
- name: arduino:esp32
libraries: |
- name: Arduino_ESP32_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
# Edge Control
Expand All @@ -257,8 +251,6 @@ jobs:
# Install ESP32 platform via Boards Manager
- name: esp32:esp32
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
libraries: |
- name: Arduino_ESP32_OTA
sketch-paths: |
- examples/ArduinoIoTCloud-DeferredOTA
Expand Down
6 changes: 5 additions & 1 deletion src/ota/implementation/OTASTM32H7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ OTACloudProcessInterface::State STM32H7OTACloudProcess::flashOTA() {
return OtaStorageOpenFail;
}

storageClean();

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

if(decompressed != nullptr) {
fclose(decompressed);
int res = fclose(decompressed);
DEBUG_VERBOSE("error on fclose %d", res);

decompressed = nullptr;
}

Expand Down

0 comments on commit faae972

Please sign in to comment.