49typedef enum : uint32_t {
55typedef enum : uint8_t {
90 __asm__
volatile(
"wfi");
117 return (uint8_t)(
'0' + n);
137 uint32_t cpuclk0_hz = 0U;
189 const uint32_t hex_len =
200 bool all_same =
true;
202 if (rng[i] != rng[0]) {
208 const uint8_t fail_banner[] =
"rng_demo: FAIL stuck\r\n";
void main(void)
Secure fallback main entry point.
rng_demo_byte_t
Per-emit byte counts.
@ k_rng_demo_bytes_per_line
Rng demo bytes per line.
@ k_rng_demo_nibble_mask
Rng demo nibble mask.
@ k_rng_demo_alpha_threshold
Rng demo alpha threshold.
@ k_rng_demo_hex_per_byte
Rng demo hex per byte.
@ k_rng_demo_nibble_shift
Rng demo nibble shift.
static const uint8_t s_rng_demo_pass_msg[]
Verdict line emitted only after a non-stuck sample is dumped.
rng_demo_config_t
Compile-time settings for the demo.
@ k_rng_demo_baud
Rng demo baud.
@ k_rng_demo_period_ms
Rng demo period ms.
static const uint8_t s_rng_demo_prefix[]
Fixed prefix and CR/LF tail used on every emit.
static void internal_rng_demo_panic_halt(void)
Park the processor after a fatal setup or entropy-path failure.
static void internal_rng_demo_setup_or_halt(void)
Bring CGC, SysTick, SCI8, LED1, and PSA crypto up.
static uint8_t internal_rng_demo_nibble_to_hex(uint8_t nibble)
Convert a nibble to its ASCII hex representation.
static ra8_err_t internal_rng_demo_emit_one_line(void)
Emit one hex line of TRNG output.
static const uint8_t s_rng_demo_eol[]
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_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.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_hw_error
Generic hardware fault detected (error flag set, fault interrupt).
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).
Application-level PSA Crypto facade over tf-psa-crypto.
ra8_err_t ra8_psa_crypto_init(void)
One-shot facade initialisation.
ra8_err_t ra8_psa_crypto_random(uint8_t *out, size_t out_len)
Fill out[0..out_len-1] with cryptographically secure bytes.
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.