67static const char*
s_tag =
"dotf_demo";
70typedef enum : uint32_t {
76typedef enum : uint8_t {
82typedef enum : uint32_t {
157 __asm__
volatile(
"wfi");
180 uint32_t cpuclk0_hz = 0U;
292 const uint8_t good = (err ==
k_ra8_ok && ok != 0U) ? 1U : 0U;
void main(void)
Secure fallback main entry point.
volatile uint32_t g_dotf_reg00
Last REG00 snapshot from ra8_dotf_get_status(ch0).
static void internal_dotf_demo_setup_or_halt(void)
Bring CGC, SysTick, SCI8, LEDs, and MSTP up.
volatile uint32_t g_dotf_ok
1 when both channels' self-test + status calls returned k_ra8_ok.
static void internal_dotf_demo_panic_halt(void)
Park the processor after an unrecoverable DOTF demo failure.
static const uint8_t s_dotf_demo_bad_msg[]
static ra8_err_t internal_dotf_demo_sample(uint8_t *out_ok)
Self-test both channels and read REG00 back; fold into the verdict.
volatile uint32_t g_dotf_st0_snap
Channel-0 self-test REG00 snapshot (opaque on host / off-target).
volatile uint32_t g_dotf_st1_snap
Channel-1 self-test REG00 snapshot (opaque on host / off-target).
dotf_demo_config_t
Compile-time settings.
@ k_dotf_demo_period_ms
Delay between self-tests.
@ k_dotf_demo_baud
Console baud rate.
dotf_demo_chan_t
DOTF channels exercised by the demo.
@ k_dotf_demo_ch0
DOTF0 (paired with XSPI0).
@ k_dotf_demo_ch1
DOTF1 (paired with XSPI1).
static uint8_t internal_dotf_demo_verdict(ra8_err_t st0_err, ra8_err_t st1_err, ra8_err_t status_err)
Verdict: both channels' self-test + status calls succeeded.
static const uint8_t s_dotf_demo_ok_msg[]
Output line tags.
volatile uint32_t g_dotf_init_err
ra8_err_t from ra8_dotf_init (0 == k_ra8_ok).
dotf_demo_sentinel_t
Sentinel for "ra8_dotf_init has not run yet" in g_dotf_init_err.
@ k_dotf_demo_err_unset
Distinct from any ra8_err_t code.
volatile uint32_t g_dotf_heartbeat
Bumps once per main-loop pass – liveness for headless probes.
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
ra8_err_t ra8_board_led_init(ra8_board_led_id_t led)
Configure led as a digital output, initial level low (off).
@ k_ra8_board_led2
LED2, GREEN, P303 (jumper E26).
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
Boot entry points shared between a vector table and its startup code.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Decryption On The Fly (DOTF) HAL driver public API.
ra8_err_t ra8_dotf_get_status(uint8_t channel, uint32_t *out_mask)
Read REG00 (raw control / status snapshot).
ra8_err_t ra8_dotf_init(void)
Power on the DOTF block and reset both channels.
ra8_err_t ra8_dotf_run_self_test(uint8_t channel, uint32_t *out_status)
Trigger the built-in self-test (REG00 bit 20) for a channel.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
SysTick-based tick counter, delay and timestamp helpers.
ra8_err_t ra8_time_init(uint32_t cpu_hz)
Initialise SysTick for a 1 kHz tick interrupt.
void ra8_delay_ms(uint32_t ms)
Busy-wait for at least ms milliseconds.