|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Bring-up Helpers Called Before Any Driver Init. More...
#include "ra8_err.h"Go to the source code of this file.
Functions | |
| void | ra8_infrastructure_init (void) |
| Run every piece of infrastructure init that a driver may assume. | |
| ra8_err_t | ra8_stack_canary_check (void) |
| Verify the SRAM stack canary sentinel pattern. | |
Bring-up Helpers Called Before Any Driver Init.
ra8_infrastructure_init() is the one place every piece of pre-driver state is brought up: the logging backend, the pin validator, and any CPU-core configuration that the rest of the HAL assumes is already in place (I-cache, D-cache, FPU enable, etc.).
Call order for a typical main:
Definition in file ra8_infrastructure.h.
| void ra8_infrastructure_init | ( | void | ) |
Run every piece of infrastructure init that a driver may assume.
Run every piece of infrastructure init that a driver may assume.
Initialises the log backend, resets the pin validator, and seeds the stack canary region.
Definition at line 86 of file ra8_infrastructure.c.
References internal_write_stack_canary(), ra8_log_info, ra8_log_init(), and ra8_pin_validator_reset().
|
nodiscard |
Verify the SRAM stack canary sentinel pattern.
Walks the linker-defined .stack_canary region (32 bytes just below the stack top) and confirms every word still holds the seed value written by ra8_infrastructure_init. A mismatch means the main stack has overflowed into the sentinel; callers typically log a fatal error and reboot.
| k_ra8_ok | Sentinel still intact. |
| k_ra8_err_validation_failed | One or more words corrupted. |
Verify the SRAM stack canary sentinel pattern.
Walks the linker-defined region and compares each word to k_ra8_stack_canary_pattern.
| k_ra8_ok | Sentinel intact. |
| k_ra8_err_validation_failed | At least one word was corrupted. |
Definition at line 120 of file ra8_infrastructure.c.
References g_ra8_ls_stack_canary_end, g_ra8_ls_stack_canary_start, k_ra8_err_validation_failed, k_ra8_ok, and k_ra8_stack_canary_pattern.