From 8f682c0782ce2224f2fd62e48be944afece37797 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Nov 2020 08:52:01 +1100 Subject: [PATCH] HAL_ChibiOS: check all memory at 10Hz --- libraries/AP_HAL_ChibiOS/Scheduler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/Scheduler.cpp b/libraries/AP_HAL_ChibiOS/Scheduler.cpp index 2998267876..509133ca34 100644 --- a/libraries/AP_HAL_ChibiOS/Scheduler.cpp +++ b/libraries/AP_HAL_ChibiOS/Scheduler.cpp @@ -366,6 +366,10 @@ void Scheduler::_monitor_thread(void *arg) if (using_watchdog) { stm32_watchdog_save((uint32_t *)&hal.util->persistent_data, (sizeof(hal.util->persistent_data)+3)/4); } + + // if running memory guard then check all allocations + malloc_check(nullptr); + uint32_t now = AP_HAL::millis(); uint32_t loop_delay = now - sched->last_watchdog_pat_ms; if (loop_delay >= 200) {