mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 03:16:37 +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);
|
this->reset_pin_->digital_write(true);
|
||||||
} else {
|
} else {
|
||||||
NRF_POWER->GPREGRET = DFU_MAGIC_UF2_RESET;
|
NRF_POWER->GPREGRET = DFU_MAGIC_UF2_RESET;
|
||||||
|
arch_feed_wdt();
|
||||||
App.reboot();
|
App.reboot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,11 @@ void arch_init() {
|
|||||||
if (device_is_ready(WDT)) {
|
if (device_is_ready(WDT)) {
|
||||||
static wdt_timeout_cfg wdt_config{};
|
static wdt_timeout_cfg wdt_config{};
|
||||||
wdt_config.flags = WDT_FLAG_RESET_SOC;
|
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
|
// zboss thread uses a lot of CPU cycles during startup
|
||||||
wdt_config.window.max = 10000;
|
wdt_config.window.max = 10000;
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user