Skip to content

Commit

Permalink
Merge pull request #261 from pennam/wdog_portenta
Browse files Browse the repository at this point in the history
Wdog trigger during binary download decompressio for portenta
  • Loading branch information
aentinger authored Jun 15, 2021
2 parents c5e5d49 + af31191 commit df474bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# include <algorithm>
# include "tls/utility/SHA256.h"
# include <stm32h7xx_hal_rtc_ex.h>
# include <WiFi.h>
#endif

#include "utility/ota/OTA.h"
Expand Down Expand Up @@ -285,11 +286,10 @@ 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
}

#endif

return 1;
Expand Down
4 changes: 4 additions & 0 deletions src/utility/ota/OTA-portenta-h7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 (ARDUINO_PORTENTA_OTA_HAS_WATCHDOG_FEED)
ota_portenta_qspi.setFeedWatchdogFunc(watchdog_reset);
#endif

watchdog_reset();

/* Initialize the QSPI memory for OTA handling. */
Expand Down

0 comments on commit df474bc

Please sign in to comment.