37#include "ra8_io_roundtrip.h"
42typedef enum : uint32_t {
60static const char*
const s_tag =
"ra8_io_demo";
66 .volume_label =
"RAIO",
68 .root_file =
"HELLO.TXT",
69 .root_path =
"ram:/HELLO.TXT",
71 .subdir_path =
"ram:/SUB",
72 .subdir_file =
"ram:/SUB/NOTE.TXT",
120 uint32_t cpuclk0_hz = 0U;
void main(void)
Secure fallback main entry point.
static void internal_demo_print(const char *s)
Convenience wrapper to write a NUL-terminated string to SCI8.
static void internal_demo_setup_or_halt(void)
Bring CGC + the J-Link OB VCOM console + on-board Ethernet + RSIP up.
static ra8_err_t internal_demo_run(uint32_t *out_blob_len)
Bind both backends and run the transparent round-trip on each.
static uint8_t s_disk[(size_t) k_demo_disk_blocks *(size_t) k_ra8_io_block_size_bytes]
256 KiB RAM-disk backing buffer (in SRAM .bss) for the "ram" mount.
demo_const_t
Console + volume + payload knobs (no magic numbers).
@ k_demo_payload
Source bytes (compressible).
@ k_demo_disk_blocks
256 KiB per volume (FAT12).
@ k_demo_uart_baud
Console baud.
static ra8_io_stream_t s_uart
UART output stream + its sink state.
static ra8_fs_backend_t s_be
ra8_fs backend bridged onto the cached block device.
static const ra8_io_roundtrip_params_t s_params
Shared round-trip parameters for this RAM-backed FAT12 volume.
@ k_demo_note_len
Bytes round-tripped in the subdir.
static ra8_io_blockdev_ram_state_t s_bstate
static ra8_io_blockdev_t s_bd
Block-device handle + its RAM backend state.
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.
EK-RA8D2 debug console as an ra8_io_stream byte sink.
ra8_err_t ra8_board_console_stream(ra8_io_stream_t *out)
Bind the J-Link OB VCOM console into a caller-owned stream handle.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
ra8_err_t ra8_board_uart_console_flush(void)
Block until every byte queued on the J-Link OB VCOM console has finished clocking out on the wire.
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_RETURN_ON_ERROR(err, tag, message)
Early return on error, propagating the code upward.
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.
@ k_ra8_fs_type_fat12
count_of_clusters < 4085.
ra8_io – unified peripheral-agnostic I/O fabric (umbrella header).
@ k_ra8_io_block_size_bytes
Bytes per logical block (the only size).
ra8_err_t ra8_io_blockdev_ram_init(ra8_io_blockdev_t *bd, ra8_io_blockdev_ram_state_t *state, uint8_t *storage, uint32_t block_count, bool read_only)
Bind a RAM block-device backend into a caller-owned handle.
ra8_err_t ra8_io_roundtrip_root_file(ra8_fs_mount_t *mnt, const ra8_io_roundtrip_params_t *p)
Whole-file write at the volume root, VFS read-back, and byte-compare.
ra8_err_t ra8_io_roundtrip_mount(ra8_io_blockdev_t *bd, const ra8_io_roundtrip_params_t *p, ra8_fs_backend_t *be, ra8_fs_mount_t **out_mount)
Bridge a bound block device to ra8_fs, format + mount FAT, VFS-register.
ra8_err_t ra8_io_roundtrip_subdir_file(const ra8_io_roundtrip_params_t *p)
mkdir a subdirectory via the VFS, then round-trip a nested file.
ra8_err_t ra8_io_log_attach(ra8_io_stream_t *s)
Route ra8_log output to a bound ra8_io stream.
ra8_err_t ra8_io_stream_puts(ra8_io_stream_t *s, const char *str)
Write a NUL-terminated string (without the NUL) to the bound sink.
Lightweight Logging Interface for ra8-firmware.
void ra8_log_init(void)
Initialise the logging backend.
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.
Block-device interface that ra8_fs runs on top of.
Cached parse of one mounted FAT volume.
Caller-owned private state for a RAM block device.
Caller-allocated block-device handle binding a backend to its context.
Per-demo knobs for the shared ra8_io round-trip.
Caller-allocated byte-stream handle binding a sink to its context.