Skip to content

Commit df474bc

Browse files
authored
Merge pull request #261 from pennam/wdog_portenta
Wdog trigger during binary download decompressio for portenta
2 parents c5e5d49 + af31191 commit df474bc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/ArduinoIoTCloudTCP.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
# include <algorithm>
3838
# include "tls/utility/SHA256.h"
3939
# include <stm32h7xx_hal_rtc_ex.h>
40+
# include <WiFi.h>
4041
#endif
4142

4243
#include "utility/ota/OTA.h"
@@ -285,11 +286,10 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,
285286
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
286287
if (enable_watchdog) {
287288
watchdog_enable();
288-
#ifdef WIFI_HAS_FEED_WATCHDOG_FUNC
289+
#if defined (WIFI_HAS_FEED_WATCHDOG_FUNC) || defined (ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC)
289290
WiFi.setFeedWatchdogFunc(watchdog_reset);
290291
#endif
291292
}
292-
293293
#endif
294294

295295
return 1;

src/utility/ota/OTA-portenta-h7.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ int portenta_h7_onOTARequest(char const * ota_url)
4040
/* Use 2nd partition of QSPI (1st partition contains WiFi firmware) */
4141
Arduino_Portenta_OTA_QSPI ota_portenta_qspi(QSPI_FLASH_FATFS_MBR, 2);
4242

43+
#if defined (ARDUINO_PORTENTA_OTA_HAS_WATCHDOG_FEED)
44+
ota_portenta_qspi.setFeedWatchdogFunc(watchdog_reset);
45+
#endif
46+
4347
watchdog_reset();
4448

4549
/* Initialize the QSPI memory for OTA handling. */

0 commit comments

Comments
 (0)