From 00c1f4ea4d82b7c500178e30896d483557d22cf0 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 29 May 2024 17:36:43 +0200 Subject: [PATCH] cpu/cortexm_common: print last active thread on stack corruption --- cpu/cortexm_common/vectors_cortexm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu/cortexm_common/vectors_cortexm.c b/cpu/cortexm_common/vectors_cortexm.c index e06ffdfca3..f70419bc64 100644 --- a/cpu/cortexm_common/vectors_cortexm.c +++ b/cpu/cortexm_common/vectors_cortexm.c @@ -353,6 +353,7 @@ __attribute__((used)) void hard_fault_handler(uint32_t* sp, uint32_t corrupted, /* Sanity check stack pointer and give additional feedback about hard fault */ if (corrupted) { puts("Stack pointer corrupted, reset to top of stack"); + printf("active thread: %"PRIkernel_pid"\n", thread_getpid()); } else { uint32_t r0 = sp[0];