42typedef enum : uint32_t {
52typedef enum : uint8_t {
67typedef enum : uint32_t {
97 "ra8_crashlog_record_t must fit the linker NOINIT region (LENGTH(NOINIT))");
126 if (data ==
nullptr) {
130 for (uint32_t i = 0U; i < len; i++) {
131 crc ^= (uint32_t)data[i];
133 const uint32_t mask = 0U - (crc & 1U);
206 if (decoded ==
nullptr) {
227 if (out ==
nullptr) {
267void ra8_crashlog_test_wipe(
void)
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
void ra8_crashlog_claim(void)
Implementation of ra8_crashlog_claim() – clear magic + reset the guard.
static bool internal_crashlog_is_valid(void)
Whether the stored record is a trustworthy post-mortem.
static volatile ra8_crashlog_record_t s_ra8_crashlog_record
The one cross-reset crash-log record instance.
bool ra8_crashlog_peek(ra8_crashlog_record_t *out)
Implementation of ra8_crashlog_peek() – validate then copy out.
bool ra8_crashlog_safe_mode_requested(void)
Implementation of ra8_crashlog_safe_mode_requested() – count vs threshold.
static uint32_t internal_crashlog_payload_crc(void)
CRC-32 over the integrity-protected payload of the record.
void ra8_crashlog_record_fault(const volatile ra8_exception_last_t *decoded)
Implementation of ra8_crashlog_record_fault() – write payload, magic last.
ra8_crashlog_crc_iter_t
Per-byte iteration count for the bitwise CRC-32.
@ k_ra8_crashlog_crc_bits
Bits consumed per input byte.
void ra8_crashlog_install(void)
Implementation of ra8_crashlog_install() – register the persist hook.
static uint32_t internal_crashlog_crc32(const volatile uint8_t *data, uint32_t len)
Compute a reflected CRC-32 over a byte span.
ra8_crashlog_crc_const_t
Constants for the self-contained bitwise CRC-32.
@ k_ra8_crashlog_crc_poly
Reflected CRC-32 polynomial.
@ k_ra8_crashlog_crc_seed
Initial value and final XOR mask.
ra8_crashlog_loops_const_t
Saturation ceiling for the reset-loop counter.
@ k_ra8_crashlog_loops_max
boot_loops never grows past this.
Cross-reset crash-log: persist the last fault + a reset-loop guard.
@ k_ra8_crashlog_loop_threshold
Safe mode when boot_loops exceeds this.
@ k_ra8_crashlog_reserve_bytes
Bytes reserved for .noinit at SRAM top.
void ra8_crashlog_record_fault(const volatile ra8_exception_last_t *decoded)
Persist a decoded fault snapshot into the cross-reset record.
@ k_ra8_crashlog_magic_valid
"SAFE-BOOT": record is valid.
Cross-TU surface for ra8_crashlog (host-test white-box access only).
Cortex-M85 CPU exception diagnostic helpers.
void ra8_exception_set_persist_hook(ra8_exception_persist_fn hook)
Register (or clear) the post-decode fault-persistence hook.
The .noinit cross-reset post-mortem record.
uint32_t boot_loops
Monotonic recorded-fault counter; cleared by a claim.
Fixed-SRAM post-mortem snapshot of the most recent fault or NMI.