From 3e40d7896ba26e755bfdb16706277ba6cc07618d Mon Sep 17 00:00:00 2001 From: Jason P Date: Wed, 5 Nov 2025 10:07:28 -0600 Subject: [PATCH] Revert "nrf52: add watchdog (#8485)" (#8554) This reverts commit 83954293d8b52068750f40ae633ae7ccaf39b9c0. --- arch/nrf52/nrf52.ini | 2 +- src/platform/nrf52/main-nrf52.cpp | 33 ------------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index e60d47ce7..36effe017 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -7,7 +7,7 @@ extends = arduino_base platform_packages = ; our custom Git version until they merge our PR # TODO renovate - platformio/framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino#c770c8a16a351b55b86e347a3d9d7b74ad0bbf39 + platformio/framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino#e13f5820002a4fb2a5e6754b42ace185277e5adf ; Don't renovate toolchain-gccarmnoneeabi platformio/toolchain-gccarmnoneeabi@~1.90301.0 diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index 7eea46f6e..8ce74d5f7 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -4,13 +4,6 @@ #include #include #include - -#define NRFX_WDT_ENABLED 1 -#define NRFX_WDT0_ENABLED 1 -#define NRFX_WDT_CONFIG_NO_IRQ 1 -#include -#include - #include #include #include @@ -26,9 +19,6 @@ #include "BQ25713.h" #endif -static nrfx_wdt_t nrfx_wdt = NRFX_WDT_INSTANCE(0); -static nrfx_wdt_channel_id nrfx_wdt_channel_id_nrf52_main; - static inline void debugger_break(void) { __asm volatile("bkpt #0x01\n\t" @@ -212,15 +202,6 @@ void checkSDEvents() void nrf52Loop() { - { - static bool watchdog_running = false; - if (!watchdog_running) { - nrfx_wdt_enable(&nrfx_wdt); - watchdog_running = true; - } - } - nrfx_wdt_channel_feed(&nrfx_wdt, nrfx_wdt_channel_id_nrf52_main); - checkSDEvents(); reportLittleFSCorruptionOnce(); } @@ -288,20 +269,6 @@ void nrf52Setup() LOG_DEBUG("Set random seed %u", seed.seed32); randomSeed(seed.seed32); nRFCrypto.end(); - - // Set up nrfx watchdog. Do not enable the watchdog yet (we do that - // the first time through the main loop), so that other threads can - // allocate their own wdt channel to protect themselves from hangs. - nrfx_wdt_config_t wdt0_config = { - .behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP, .reload_value = 2000, - // Note: Not using wdt interrupts. - // .interrupt_priority = NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY - }; - nrfx_err_t r = nrfx_wdt_init(&nrfx_wdt, &wdt0_config, - nullptr // Watchdog event handler, not used, we just reset. - ); - - r = nrfx_wdt_channel_alloc(&nrfx_wdt, &nrfx_wdt_channel_id_nrf52_main); } void cpuDeepSleep(uint32_t msecToWake)