Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Namespaces | Functions
sbl::fault Namespace Reference

Namespaces

namespace  detail
 

Functions

void panic (const char *msg, const char *file, int line)
 Halt with a diagnostic message. Does not return.
 
void on_hard_fault (const uint32_t *frame)
 Format and output the Cortex-M exception stack frame.
 

Function Documentation

◆ on_hard_fault()

void sbl::fault::on_hard_fault ( const uint32_t *  frame)
inline

Format and output the Cortex-M exception stack frame.

The Cortex-M exception entry pushes these registers onto the active stack (MSP or PSP): [0] R0 [1] R1 [2] R2 [3] R3 [4] R12 [5] LR [6] PC [7] xPSR

The faulting instruction address is frame[6] (stacked PC). frame[5] (stacked LR) shows where the faulting function would have returned to.

Parameters
framePointer to the exception stack frame

Definition at line 45 of file fault.hpp.

References sbl::log::format().

Referenced by __attribute__().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ panic()

void sbl::fault::panic ( const char *  msg,
const char *  file,
int  line 
)
inline

Halt with a diagnostic message. Does not return.

Disables interrupts, formats the message with file/line info, outputs it, then enters an infinite loop with a debug breakpoint.

Safe to call from any context (main loop, ISR, fault handler).

Definition at line 68 of file assert.hpp.

References sbl::log::format().

Here is the call graph for this function: