@@ -583,24 +583,34 @@ void ArduinoIoTCloudTCP::onOTARequest()
583
583
#endif /* OTA_STORAGE_SNU */
584
584
585
585
#if OTA_STORAGE_PORTENTA_QSPI
586
+ mbed_watchdog_reset ();
587
+
586
588
Arduino_Portenta_OTA::Error ota_portenta_err = Arduino_Portenta_OTA::Error::None;
587
589
/* Use 2nd partition of QSPI (1st partition contains WiFi firmware) */
588
590
Arduino_Portenta_OTA_QSPI ota_portenta_qspi (QSPI_FLASH_FATFS_MBR, 2 );
589
591
592
+ mbed_watchdog_reset ();
593
+
590
594
/* Initialize the QSPI memory for OTA handling. */
591
595
if ((ota_portenta_err = ota_portenta_qspi.begin ()) != Arduino_Portenta_OTA::Error::None) {
592
596
DEBUG_ERROR (" Arduino_Portenta_OTA_QSPI::begin() failed with %d" , static_cast <int >(ota_portenta_err));
593
597
return ;
594
598
}
595
599
600
+ mbed_watchdog_reset ();
601
+
596
602
/* Just to be safe delete any remains from previous updates. */
597
603
remove (" /fs/UPDATE.BIN" );
598
604
remove (" /fs/UPDATE.BIN.LZSS" );
599
605
606
+ mbed_watchdog_reset ();
607
+
600
608
/* Download the OTA file from the web storage location. */
601
609
int const ota_portenta_qspi_download_ret_code = ota_portenta_qspi.download ((char *)(_ota_url.c_str ()), true /* is_https */ );
602
610
DEBUG_VERBOSE (" Arduino_Portenta_OTA_QSPI::download(%s) returns %d" , _ota_url.c_str (), ota_portenta_qspi_download_ret_code);
603
611
612
+ mbed_watchdog_reset ();
613
+
604
614
/* Decompress the LZSS compressed OTA file. */
605
615
int const ota_portenta_qspi_decompress_ret_code = ota_portenta_qspi.decompress ();
606
616
DEBUG_VERBOSE (" Arduino_Portenta_OTA_QSPI::decompress() returns %d" , ota_portenta_qspi_decompress_ret_code);
@@ -610,6 +620,8 @@ void ArduinoIoTCloudTCP::onOTARequest()
610
620
return ;
611
621
}
612
622
623
+ mbed_watchdog_reset ();
624
+
613
625
/* Schedule the firmware update. */
614
626
if ((ota_portenta_err = ota_portenta_qspi.update ()) != Arduino_Portenta_OTA::Error::None) {
615
627
DEBUG_ERROR (" Arduino_Portenta_OTA_QSPI::update() failed with %d" , static_cast <int >(ota_portenta_err));
0 commit comments