From 4aec3d04f9a4341df03f44ab8a1022c294dc1732 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 25 Jul 2022 23:12:13 +0200 Subject: [PATCH] esp32: fix WDT reset on the MCH2022 badge --- src/runtime/runtime_esp32.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/runtime_esp32.go b/src/runtime/runtime_esp32.go index 3075744c..0543a4bd 100644 --- a/src/runtime/runtime_esp32.go +++ b/src/runtime/runtime_esp32.go @@ -13,6 +13,10 @@ import ( // set. //export main func main() { + // Disable the protection on the watchdog timer (needed when started from + // the bootloader). + esp.RTCCNTL.WDTWPROTECT.Set(0x050D83AA1) + // Disable both watchdog timers that are enabled by default on startup. // Note that these watchdogs can be protected, but the ROM bootloader // doesn't seem to protect them.