Skip to content

OTA: STM32H7 unmount filesystem before reset #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading