52typedef enum : uint32_t {
58typedef enum : uint8_t {
72typedef enum : uint32_t {
144 __asm__
volatile(
"wfi");
161 uint32_t cpuclk0_hz = 0U;
void main(void)
Secure fallback main entry point.
static void internal_setup_or_halt(void)
Bring up clocks, MSTP, delay timing, and the board console.
static void internal_panic_halt(void)
Park the core after an unrecoverable ADC demo failure.
static const uint8_t s_aes_demo_aad[k_aes_demo_aad_bytes]
AAD (additional authenticated data).
static const uint8_t s_aes_demo_nonce[k_ra8_psa_gcm_nonce_len]
Fixed 12-byte nonce (deterministic for the demo).
aes_demo_usage_t
Combined AEAD usage flag (encrypt + decrypt).
@ k_aes_demo_usage_aead
AES demo usage aead.
aes_demo_const_t
Demo tunables.
@ k_aes_demo_baud
AES demo baud.
@ k_aes_demo_period_ms
AES demo period ms.
aes_demo_layout_t
AES-128 key + plaintext sizing.
@ k_aes_demo_key_bytes
AES demo key bytes.
@ k_aes_demo_aad_bytes
AES demo aad bytes.
@ k_aes_demo_plain_bytes
AES demo plain bytes.
static const uint8_t s_aes_demo_key[k_aes_demo_key_bytes]
Fixed 128-bit AES key.
static const uint8_t s_aes_demo_plain[k_aes_demo_plain_bytes]
Plaintext "RA8D2_OK" – 8 ASCII bytes.
static ra8_err_t internal_one_round_trip(void)
Single AES-128-GCM encrypt -> decrypt -> compare round-trip.
static const uint8_t s_aes_demo_msg_ok[]
static const uint8_t s_aes_demo_msg_fail[]
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.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_crc_mismatch
CRC mismatch detected on received data.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_invalid_size
Invalid size parameter (too large, too small, or misaligned).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
int memcmp(const void *a, const void *b, size_t n)
Compare bytes in two memory areas.
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_psa_key_usage_t
Bitmask of allowed operations on an imported key.
@ k_ra8_psa_usage_encrypt
Allow ra8_psa_aead_encrypt.
@ k_ra8_psa_usage_decrypt
Allow ra8_psa_aead_decrypt.
ra8_err_t ra8_psa_key_destroy(ra8_psa_key_t handle)
Destroy a previously-imported key.
ra8_err_t ra8_psa_aead_decrypt(ra8_psa_key_t handle, ra8_psa_alg_t alg, const uint8_t *nonce, size_t nonce_len, const uint8_t *aad, size_t aad_len, const uint8_t *cipher, size_t cipher_len, uint8_t *out, size_t out_cap, size_t *out_len)
Decrypt + verify-tag an AES-GCM buffer.
ra8_err_t ra8_psa_crypto_init(void)
One-shot facade initialisation.
ra8_err_t ra8_psa_key_import(ra8_psa_key_t *out_handle, const ra8_psa_key_attr_t *attr, const uint8_t *data, size_t data_len)
Import a raw-byte key into the static pool.
struct ra8_psa_key_handle * ra8_psa_key_t
Opaque PSA key handle (typed pointer into the static pool).
@ k_ra8_psa_key_type_aes
Symmetric AES key.
@ k_ra8_psa_alg_aes_gcm
AES-GCM AEAD (NIST SP 800-38D).
@ k_ra8_psa_gcm_tag_len
AES-GCM authentication tag length (16 octets).
@ k_ra8_psa_gcm_nonce_len
AES-GCM nonce length used by ra8_psa_aead_* (NIST SP 800-38D).
ra8_err_t ra8_psa_aead_encrypt(ra8_psa_key_t handle, ra8_psa_alg_t alg, const uint8_t *nonce, size_t nonce_len, const uint8_t *aad, size_t aad_len, const uint8_t *plain, size_t plain_len, uint8_t *out, size_t out_cap, size_t *out_len)
Encrypt + authenticate a buffer with AES-GCM.
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.
Attributes describing a key being imported.