|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Centralised fatal-error sink. More...
#include <stdint.h>Go to the source code of this file.
Functions | |
| void | ra8_fatal_error (const char *tag, const char *message, uint32_t err) |
| Report a fatal error, log it, and halt. | |
Centralised fatal-error sink.
ra8_fatal_error() is the single entry point for "stop running and alert the developer". Every RA8_ASSERT and every RA8_ERROR_CHECK that fails eventually lands here.
The default behaviour is:
The loop is deliberate: we do not want to reset silently because that erases the state the developer needs to diagnose the fault. Field deployments can override ra8_fatal_error() with a weak symbol to add a watchdog reset.
Definition in file ra8_error_handler.h.
| void ra8_fatal_error | ( | const char * | tag, |
| const char * | message, | ||
| uint32_t | err ) |
Report a fatal error, log it, and halt.
| [in] | tag | Short tag describing the source ("ASSERT", "ERROR_CHECK", "HARDFAULT", ...). |
| [in] | message | String literal describing the failure. |
| [in] | err | Error code classifying the failure (may be 0 for plain assertion failures). |
Report a fatal error, log it, and halt.
Disables interrupts, emits a best-effort error line plus the numeric err code, then traps via BKPT and an infinite loop (or __builtin_trap on the off-target host so unit tests fail loudly instead of spinning forever).
| [in] | tag | NUL-terminated module/component tag. |
| [in] | message | NUL-terminated short failure description. |
| [in] | err | Numeric error code (typically a ra8_err_t value). |
Definition at line 133 of file ra8_error_handler.c.
References internal_bkpt(), internal_disable_irq(), internal_wfi(), ra8_log_error, and ra8_log_error_val.
Referenced by _sbrk().