From bc00b29a64f0c799fff3f4c56e8345c870e7631b Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 22 Jun 2020 20:02:19 +0200 Subject: [PATCH] Deadloop in case of stackoverflow, better than flooding console --- armsrc/appmain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 17893e84b..5c82ebbe8 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -2166,7 +2166,9 @@ void __attribute__((noreturn)) AppMain(void) { WDT_HIT(); if (_stack_start != 0xdeadbeef) { - Dbprintf("Stack overflow detected! Please increase stack size."); + Dbprintf("Stack overflow detected! Please increase stack size, currently %d bytes", (&_stack_end - &_stack_start) << 2); + Dbprintf("Unplug your device now."); + while (1); } // Check if there is a packet available