From 858d6f8b562a6e0596b75c14f1aabc3c0af4c377 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 10 Jun 2021 22:20:21 +0200 Subject: [PATCH 1/4] pass wdog feed function to Arduino_Portenta_OTA library so it can be called during decompression phase --- src/utility/ota/OTA-portenta-h7.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utility/ota/OTA-portenta-h7.cpp b/src/utility/ota/OTA-portenta-h7.cpp index 7c6a01eb9..ca645ad28 100644 --- a/src/utility/ota/OTA-portenta-h7.cpp +++ b/src/utility/ota/OTA-portenta-h7.cpp @@ -40,6 +40,10 @@ int portenta_h7_onOTARequest(char const * ota_url) /* Use 2nd partition of QSPI (1st partition contains WiFi firmware) */ Arduino_Portenta_OTA_QSPI ota_portenta_qspi(QSPI_FLASH_FATFS_MBR, 2); +#if defined (PORTENTA_OTA_HAS_WATCHDOG_FEED) + ota_portenta_qspi.setFeedWatchdogFunc(watchdog_reset); +#endif + watchdog_reset(); /* Initialize the QSPI memory for OTA handling. */ From 34752c687dcf1caf6224791eef984b459fe8958e Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 10 Jun 2021 22:22:12 +0200 Subject: [PATCH 2/4] Remove stray newline --- src/ArduinoIoTCloudTCP.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index e65da587e..b42edaa7f 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -289,7 +289,6 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress, WiFi.setFeedWatchdogFunc(watchdog_reset); #endif } - #endif return 1; From 95e960ced3b84d6a412f76dfa9f14de794e66004 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 11 Jun 2021 10:19:30 +0200 Subject: [PATCH 3/4] align defines with Arduino_Portenta_OTA and ArduinoCore-mbed --- src/ArduinoIoTCloudTCP.cpp | 2 +- src/utility/ota/OTA-portenta-h7.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index b42edaa7f..12f66e416 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -285,7 +285,7 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress, #if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED) if (enable_watchdog) { watchdog_enable(); -#ifdef WIFI_HAS_FEED_WATCHDOG_FUNC +#if defined (WIFI_HAS_FEED_WATCHDOG_FUNC) || defined (ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC) WiFi.setFeedWatchdogFunc(watchdog_reset); #endif } diff --git a/src/utility/ota/OTA-portenta-h7.cpp b/src/utility/ota/OTA-portenta-h7.cpp index ca645ad28..52faf73f8 100644 --- a/src/utility/ota/OTA-portenta-h7.cpp +++ b/src/utility/ota/OTA-portenta-h7.cpp @@ -40,7 +40,7 @@ int portenta_h7_onOTARequest(char const * ota_url) /* Use 2nd partition of QSPI (1st partition contains WiFi firmware) */ Arduino_Portenta_OTA_QSPI ota_portenta_qspi(QSPI_FLASH_FATFS_MBR, 2); -#if defined (PORTENTA_OTA_HAS_WATCHDOG_FEED) +#if defined (ARDUINO_PORTENTA_OTA_HAS_WATCHDOG_FEED) ota_portenta_qspi.setFeedWatchdogFunc(watchdog_reset); #endif From af311913624e584acecc99a7e221be235d65a3de Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 11 Jun 2021 10:51:56 +0200 Subject: [PATCH 4/4] Add WiFi.h include for ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC --- src/ArduinoIoTCloudTCP.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index 12f66e416..4cac10c6d 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -37,6 +37,7 @@ # include # include "tls/utility/SHA256.h" # include +# include #endif #include "utility/ota/OTA.h"