2#include "utils/logging.h"
3#include <CrashReport.h>
28 msg::Log::get().println(
"ALERT: Previous System crash detected. Post Mortem Report:");
29 msg::Log::get().println(CrashReport);
47 "b hard_fault_handler_c \n"
53 Serial.println(
"\n=== HARD FAULT ===");
54 Serial.printf(
"R0 = 0x%08X\n", frame[0]);
55 Serial.printf(
"R1 = 0x%08X\n", frame[1]);
56 Serial.printf(
"R2 = 0x%08X\n", frame[2]);
57 Serial.printf(
"R3 = 0x%08X\n", frame[3]);
58 Serial.printf(
"R12 = 0x%08X\n", frame[4]);
59 Serial.printf(
"LR = 0x%08X\n", frame[5]);
60 Serial.printf(
"PC = 0x%08X\n", frame[6]);
61 Serial.printf(
"PSR = 0x%08X\n", frame[7]);
64 Serial.printf(
"CFSR = 0x%08X\n", *(
volatile uint32_t*)0xE000ED28);
65 Serial.printf(
"HFSR = 0x%08X\n", *(
volatile uint32_t*)0xE000ED2C);
66 Serial.printf(
"MMFAR = 0x%08X\n", *(
volatile uint32_t*)0xE000ED34);
67 Serial.printf(
"BFAR = 0x%08X\n", *(
volatile uint32_t*)0xE000ED38);
71 SCB_AIRCR = 0x05FA0004;
void hard_fault_handler_c(uint32_t *frame)
void check_and_log_crash()
Logs out what has been captured by the Teensy CrashReport tooling, cf.
__attribute__((naked)) void hard_fault_isr(void)