Skip to content

Commit 194c95c

Browse files
committed
Moving the delete step of any previous update file to after where the file system is initialised.
1 parent 66ce560 commit 194c95c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,6 @@ void ArduinoIoTCloudTCP::onOTARequest()
481481
#endif /* OTA_STORAGE_SNU */
482482

483483
#if OTA_STORAGE_PORTENTA_QSPI
484-
/* Just to be safe delete any remains from previous updates. */
485-
remove("/fs/UPDATE.BIN.LZSS");
486-
487484
Arduino_Portenta_OTA::Error ota_portenta_err = Arduino_Portenta_OTA::Error::None;
488485
/* Use 2nd partition of QSPI (1st partition contains WiFi firmware) */
489486
Arduino_Portenta_OTA_QSPI ota_portenta_qspi(QSPI_FLASH_FATFS_MBR, 2);
@@ -494,6 +491,9 @@ void ArduinoIoTCloudTCP::onOTARequest()
494491
return;
495492
}
496493

494+
/* Just to be safe delete any remains from previous updates. */
495+
remove("/fs/UPDATE.BIN.LZSS");
496+
497497
/* Download the OTA file from the web storage location. */
498498
int const ota_portenta_qspi_download_ret_code = ota_portenta_qspi.download((char*)(_ota_url.c_str()));
499499
DEBUG_VERBOSE("Arduino_Portenta_OTA_QSPI::download(%s) returns %d", _ota_url.c_str(), ota_portenta_qspi_download_ret_code);

0 commit comments

Comments
 (0)