43typedef enum : uint32_t {
49typedef enum : uint32_t {
58typedef enum : uint8_t {
100 __asm__
volatile(
"wfi");
119 return (uint8_t)(
'0' + n);
138 const uint8_t shift =
173 for (uint32_t i = 0U; i < len; ++i) {
174 crc ^= (uint32_t)data[i];
189 uint32_t cpuclk0_hz = 0U;
251 *out_match = (hw == sw) ? 1U : 0U;
252 if (*out_match != 0U) {
void main(void)
Secure fallback main entry point.
static const uint8_t k_crc_demo_sw_tag[]
static const uint8_t k_crc_demo_prefix[]
Output line tags.
crc_demo_sw_const_t
Software CRC-32 polynomial + bit constants (reflected).
@ k_crc_demo_byte_mask
CRC demo byte mask.
@ k_crc_demo_sw_init
CRC demo sw init.
@ k_crc_demo_sw_xor_out
CRC demo sw xor out.
@ k_crc_demo_lsb_mask
CRC demo lsb mask.
@ k_crc_demo_sw_poly_rev
CRC demo sw poly rev.
crc_demo_config_t
Compile-time settings.
@ k_crc_demo_baud
CRC demo baud.
@ k_crc_demo_period_ms
CRC demo period ms.
static void crc_demo_setup_or_halt(void)
Bring CGC + SysTick + SCI8 + LEDs + CRC unit up.
static uint32_t crc_demo_sw_crc32(const uint8_t *data, uint32_t len)
Software reference CRC-32 (IEEE 802.3, reflected).
static const uint8_t k_crc_demo_ok_tag[]
static ra8_err_t crc_demo_one_iter(uint8_t *out_match)
One iteration: compute hw + sw CRC and emit the comparison line.
static const uint8_t k_crc_demo_payload[k_crc_demo_payload_len]
Fixed 16-byte test payload.
static void crc_demo_panic_halt(void)
Park the CPU forever after a fatal init failure.
static void crc_demo_word_to_hex(uint32_t v, uint8_t *dst)
Render a 32-bit value as 8 ASCII hex chars (big-endian).
static uint8_t crc_demo_nibble_to_hex(uint8_t nibble)
Convert the low nibble of n to its ASCII hex char.
crc_demo_byte_t
Inner-loop bit count for the software CRC.
@ k_crc_demo_bits_per_byte
CRC demo bits per byte.
@ k_crc_demo_payload_len
CRC demo payload length.
@ k_crc_demo_alpha_thresh
CRC demo alpha thresh.
@ k_crc_demo_hex_per_word
CRC demo hex per word.
@ k_crc_demo_nibble_shift
CRC demo nibble shift.
@ k_crc_demo_nibble_mask
CRC demo nibble mask.
static const uint8_t k_crc_demo_pass_msg[]
Self-test verdict emitted only on a hw==sw match (success-only).
static const uint8_t k_crc_demo_bad_tag[]
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.
CRC hardware calculator driver header.
ra8_err_t ra8_crc_init(ra8_crc_poly_t poly)
Configure the CRC block for a given polynomial.
ra8_err_t ra8_crc_compute(const uint8_t *data, uint32_t len, uint32_t *out_crc)
Compute a CRC over a byte buffer.
void ra8_crc_reset(void)
Clear the running CRC state.
CRC calculator register layout for the Renesas RA8D2.
@ k_ra8_crc_poly_32_ieee802_3
GPS=100 CRC-32 (IEEE 802.3).
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).
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.