mirror of
https://github.com/esphome/esphome.git
synced 2026-09-28 15:30:21 +00:00
[nrf52] set WDT timeout to 30sec for Adafruit bootloader (#19596)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
This commit is contained in:
co-authored by
J. Nick Koston
parent
4a2f17bc8b
commit
8db901cbfc
@@ -28,6 +28,7 @@ void DeviceFirmwareUpdate::setup() {
|
||||
this->reset_pin_->digital_write(true);
|
||||
} else {
|
||||
NRF_POWER->GPREGRET = DFU_MAGIC_UF2_RESET;
|
||||
arch_feed_wdt();
|
||||
App.reboot();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,11 @@ void arch_init() {
|
||||
if (device_is_ready(WDT)) {
|
||||
static wdt_timeout_cfg wdt_config{};
|
||||
wdt_config.flags = WDT_FLAG_RESET_SOC;
|
||||
#ifdef USE_ZIGBEE
|
||||
#ifndef USE_BOOTLOADER_MCUBOOT
|
||||
// Adafruit bootloader doesn't feed the WDT while
|
||||
// erasing flash during a firmware update, so a shorter timeout can break the update.
|
||||
wdt_config.window.max = 30000;
|
||||
#elif defined(USE_ZIGBEE)
|
||||
// zboss thread uses a lot of CPU cycles during startup
|
||||
wdt_config.window.max = 10000;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user