Print crash record optionally

This commit is contained in:
cpq authored and robert committed 2026-10-01 14:42:16 +03:00
1 parent 1b0906510b
commit 3aa5f2a1fd
9 files changed
+119 -76

No files matched your search

+5 -3
View File
@@ -4967,14 +4967,15 @@ enum mg_health_reason {
MG_HEALTH_RESET_FAULT // Fault handler ran, see regs[] and saved_stack
};
#ifndef MG_HEALTH_BACKTRACE
#define MG_HEALTH_BACKTRACE 20 // Return addresses in mg_health::backtrace
#ifndef MG_HEALTH_DATA_SIZE
#define MG_HEALTH_DATA_SIZE 20
#endif
struct mg_health {
char magic[4]; // MG_HEALTH_MAGIC when the record holds valid data
uint32_t reset_reason; // enum mg_health_reason that started this boot
uint32_t backtrace[MG_HEALTH_BACKTRACE]; // Crash backtrace, frame 0 first
uint32_t cpuid; // ARM CPU ID
uint32_t data[MG_HEALTH_DATA_SIZE];
};
extern struct mg_health mg_health_record; // Defined in health.c
@@ -5056,6 +5057,7 @@ static inline void mg_health_init(void) {
void mg_mdash_init(struct mg_mgr *);
void mg_mdash_poll(struct mg_mgr *);
void mg_mdash_free(struct mg_mgr *);