|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
End-to-end demo of the ra8_io fabric (epic #155) over a RAM block device. More...
#include <stddef.h>#include <stdint.h>#include "ra8_attributes.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_board_ek_ra8d2_console_stream.h"#include "ra8_boot_entry.h"#include "ra8_cgc.h"#include "ra8_check.h"#include "ra8_err.h"#include "ra8_io.h"#include "ra8_io_roundtrip.h"#include "ra8_log.h"#include "ra8_time.h"Go to the source code of this file.
Enumerations | |
| enum | demo_const_t : uint32_t { k_demo_uart_baud = 115200U , k_demo_disk_blocks = 512U , k_demo_payload = 128U , k_demo_note_len = 64U } |
| Console + volume knobs (no magic numbers). More... | |
Functions | |
| static void | internal_demo_print (const char *msg) |
| Print a NUL-terminated string on the demo's UART stream. | |
| static void | internal_demo_setup_or_halt (void) |
| Bring up CGC + SysTick + the board console; halt forever on failure. | |
| static ra8_err_t | internal_demo_run (ra8_fs_mount_t **out_mount) |
| Bind the RAM block device, then run the shared FAT round-trip. | |
| void | main (void) |
| Firmware entry point. | |
Variables | |
| 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). | |
| static ra8_io_blockdev_t | s_bd |
| Block-device handle + its RAM backend state. | |
| static ra8_io_blockdev_ram_state_t | s_bstate |
| static ra8_fs_backend_t | s_be |
| ra8_fs backend bridged onto the block device. | |
| static ra8_io_stream_t | s_uart |
| Console output stream; the board owns the sink behind it. | |
| static const char *const | s_tag = "ra8_io_demo" |
| Module log tag. | |
| static const ra8_io_roundtrip_params_t | s_params |
| Shared round-trip parameters for this RAM-backed FAT12 volume. | |
End-to-end demo of the ra8_io fabric (epic #155) over a RAM block device.
Exercises the whole fabric in one app, with no external hardware. The fabric round-trip (bridge -> format -> mount -> VFS -> write/read/verify -> mkdir + nested round-trip) lives in this app's self-contained ra8_io_roundtrip.{h,c} (the SDRAM, OSPI/xSPI, and SD demos carry their own copy under the hw_pending tree); this app differs only by the ONE backend bind line – here ra8_io_blockdev_ram_init over an in-SRAM buffer (Phase 1, #156) – plus its own PASS banners.
The ra8_emulator captures the SCI8 console, so the PASS/FAIL line and the byte counts are observable headlessly: a successful run prints ra8_io_demo: wrote/read 128 bytes ram:/HELLO.TXT PASS followed by ra8_io_demo: mkdir+nested ram:/SUB/NOTE.TXT PASS.
Definition in file main.c.
| enum demo_const_t : uint32_t |
|
static |
Print a NUL-terminated string on the demo's UART stream.
Thin wrapper over ra8_io_stream_puts bound to s_uart, so call sites do not repeat the sink handle.
| [in] | msg | NUL-terminated ASCII string (CR/LF supplied by the caller). |
msg is non-NULL and NUL-terminated. msg are queued on the UART stream. Definition at line 94 of file main.c.
References RA8_INTERNAL, ra8_io_stream_puts(), and s_uart.
|
static |
Bind the RAM block device, then run the shared FAT round-trip.
Binds the in-SRAM RAM backend (the single per-demo bind line), mounts the FAT12 volume through the shared helper, runs the root-file round-trip, and – on success – reports the result through mnt for the subsequent subdir round-trip in main.
| [out] | out_mount | Receives the mount handle on success, nullptr on error. |
| k_ra8_ok | The RAM volume mounted and the root file round-tripped. |
| k_ra8_err_* | The first failing bind / mount / round-trip step's code. |
out_mount is non-NULL. Definition at line 153 of file main.c.
References k_demo_disk_blocks, RA8_INTERNAL, ra8_io_blockdev_ram_init(), ra8_io_roundtrip_mount(), ra8_io_roundtrip_root_file(), RA8_RETURN_ON_ERROR, s_bd, s_be, s_bstate, s_disk, s_params, and s_tag.
|
static |
Bring up CGC + SysTick + the board console; halt forever on failure.
Initialises clocks, reads the CPU rate, starts the millisecond time base, and hands the console over to the BSP – which owns the channel, the PD02 / PD03 routing and the live-PCLKA bit-rate solve. Any failure spins forever so a debugger can inspect the halt.
Definition at line 118 of file main.c.
References k_demo_uart_baud, k_ra8_clock_id_cpuclk0, k_ra8_ok, ra8_board_console_stream(), ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), RA8_INTERNAL, ra8_time_init(), and s_uart.
| void main | ( | void | ) |
Firmware entry point.
The application entry point Reset_Handler hands control to.
Definition at line 168 of file main.c.
References internal_demo_print(), internal_demo_run(), internal_demo_setup_or_halt(), k_ra8_ok, ra8_board_uart_console_flush(), ra8_io_log_attach(), ra8_io_roundtrip_subdir_file(), ra8_log_init(), s_params, and s_uart.
|
static |
Block-device handle + its RAM backend state.
Definition at line 52 of file main.c.
Referenced by demo_checkpoint(), demo_open(), demo_reopen_naive(), demo_restore(), demo_run(), demo_run(), demo_wear_phase(), internal_demo_open(), internal_demo_probe_fat(), internal_demo_roundtrip(), internal_demo_run(), internal_sd_demo_roundtrip(), and sdhi_demo_mount_via_io().
|
static |
|
static |
Definition at line 53 of file main.c.
Referenced by demo_run(), internal_demo_probe_fat(), and internal_demo_run().
|
static |
|
static |
Shared round-trip parameters for this RAM-backed FAT12 volume.
Definition at line 63 of file main.c.
Referenced by demo_run(), demo_run(), internal_demo_run(), internal_sd_demo_roundtrip(), and main().
|
static |
|
static |