1#ifndef SBL_COMMON_FAULT_HPP_
2#define SBL_COMMON_FAULT_HPP_
48 __asm
volatile(
"cpsid i");
54 "\r\n!!! HARD FAULT\r\n"
55 " PC = 0x%08lX (faulting instruction)\r\n"
56 " LR = 0x%08lX (return address)\r\n"
58 frame[6], frame[5], frame[7]);
61 " R0 = 0x%08lX R1 = 0x%08lX\r\n"
62 " R2 = 0x%08lX R3 = 0x%08lX\r\n"
64 frame[0], frame[1], frame[2], frame[3], frame[4]);
66 SBL_FAULT_OUTPUT::write(buf);
69 __asm
volatile(
"bkpt #1");
86inline void sbl_on_hard_fault(
const uint32_t* frame) {
Assert and panic for embedded firmware.
__attribute__((used)) inline void sbl_on_hard_fault(const uint32_t *frame)
void on_hard_fault(const uint32_t *frame)
Format and output the Cortex-M exception stack frame.
int format(char *buf, size_t size, const char *fmt,...)
Format a string into a buffer (snprintf-style)