|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ra8_io fabric over the external SDRAM backend (epic #155) on EK-RA8D2. More...
#include <stdint.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_port_constants.h"#include "ra8_port_utils.h"#include "ra8_sci.h"#include "ra8_time.h"Go to the source code of this file.
Enumerations | |
| enum | demo_const_t : uint32_t { k_demo_uart_chan = 8U , k_demo_uart_baud = 115200U , k_demo_disk_blocks = 512U , k_demo_payload = 128U , k_demo_pin_shift = 8U , k_demo_note_len = 64U } |
| Console + volume knobs (no magic numbers). More... | |
Functions | |
| static void | demo_print (const char *msg) |
| Print a NUL-terminated string on the demo's UART stream. | |
| static void | demo_setup_or_halt (void) |
| Bring up CGC + SysTick + the SCI8 console; halt forever on any failure. | |
| static ra8_err_t | demo_run (ra8_fs_mount_t **out_mount) |
| Bind the SDRAM block device, then run the shared FAT round-trip. | |
| void | main (void) |
| Firmware entry point. | |
Variables | |
| static const ra8_port_pin_t | k_demo_txd |
| SCI8 console TXD = PD02. | |
| static const ra8_port_pin_t | k_demo_rxd |
| SCI8 console RXD = PD03. | |
| static ra8_io_blockdev_t | s_bd |
| Block-device handle + its SDRAM backend state (storage is the SDRAM). | |
| 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 |
| UART output stream + its sink state. | |
| static ra8_io_stream_uart_state_t | s_ust |
| static const char *const | s_tag = "ra8_io_sdram_demo" |
| Module log tag. | |
| static const ra8_io_roundtrip_params_t | s_params |
| Shared round-trip parameters for this SDRAM-backed FAT12 volume. | |
ra8_io fabric over the external SDRAM backend (epic #155) on EK-RA8D2.
The same fabric as ra8_io_demo, but the block device is backed by the 64 MiB external SDRAM (at 0x68000000) instead of an in-SRAM buffer – the swappable backend differs, the ra8_fs + VFS layers above are identical and implemented in this app's ra8_io_roundtrip.{h,c}. This app differs only by the ONE backend bind line (ra8_io_blockdev_sdram_init, which brings the controller up with ra8_sdramc_init and presents the window as 512-byte logical blocks) plus its own PASS banners.
ra8_emulator maps the SDRAM region and models the SDRAM controller bring-up, so the PASS/FAIL line is observable headlessly: a successful run prints ra8_io_sdram_demo: mkdir+nested dr:/SUB/NOTE.TXT PASS.
Definition in file main.c.
| enum demo_const_t : uint32_t |
Console + volume knobs (no magic numbers).
| Enumerator | |
|---|---|
| k_demo_uart_chan | SCI8 J-Link OB console. |
| k_demo_uart_baud | Console baud. |
| k_demo_disk_blocks | 256 KiB SDRAM window (FAT12). |
| k_demo_payload | Bytes written + read back at root. |
| k_demo_pin_shift | Port byte position in ra8_port_pin_t. |
| k_demo_note_len | Bytes round-tripped in the subdir. |
|
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 100 of file main.c.
References ra8_io_stream_puts(), and s_uart.
Referenced by demo_echo_loop(), demo_file_ops(), demo_fs_format_mount(), demo_fs_format_or_panic(), demo_list_entry(), demo_log_echo(), demo_lx_format_or_panic(), demo_lx_open(), demo_lx_open_or_panic(), demo_print_stat(), demo_print_u32(), demo_print_wear_stats(), demo_read_test_file(), demo_read_verify(), demo_report(), demo_report_map(), demo_report_rw_once(), demo_report_wear(), demo_run(), demo_run_tls(), demo_thread_entry(), demo_write_test_file(), main(), and tx_application_define().
|
static |
Bind the SDRAM block device, then run the shared FAT round-trip.
Binds the external-SDRAM backend over a 256 KiB window (the single per-demo bind line), mounts the FAT12 volume through the shared helper, runs the root-file round-trip, and – on success – returns the mount handle through out_mount for the subdir round-trip.
| [out] | out_mount | Receives the mount handle on success, nullptr on error. |
| k_ra8_ok | The SDRAM 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 and the SDRAM pins/clocks allow bring-up. Definition at line 169 of file main.c.
References k_demo_disk_blocks, ra8_io_blockdev_sdram_init(), ra8_io_roundtrip_mount(), ra8_io_roundtrip_root_file(), RA8_RETURN_ON_ERROR, s_bd, s_be, s_bstate, s_params, and s_tag.
|
static |
Bring up CGC + SysTick + the SCI8 console; halt forever on any failure.
Initialises clocks, reads CPU/PCLKA rates, starts the millisecond time base, routes the SCI8 console pins, and opens the SCI8 UART. Any failure spins forever so a debugger can inspect the halt (there is no console yet to report on).
Definition at line 123 of file main.c.
References k_demo_rxd, k_demo_txd, k_demo_uart_baud, k_demo_uart_chan, k_ra8_clock_id_cpuclk0, k_ra8_clock_id_pclka, k_ra8_ok, k_ra8_psel_sci_async, k_ra8_sci_data_8, k_ra8_sci_parity_none, k_ra8_sci_stop_1, ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_pfs_route_peripheral(), ra8_sci_init(), and ra8_time_init().
Referenced by main().
| void main | ( | void | ) |
Firmware entry point.
The application entry point Reset_Handler hands control to.
Definition at line 183 of file main.c.
References demo_print(), demo_run(), demo_setup_or_halt(), k_demo_uart_chan, k_ra8_ok, ra8_io_log_attach(), ra8_io_roundtrip_subdir_file(), ra8_io_stream_uart_init(), ra8_log_init(), ra8_sci_flush(), s_params, s_uart, and s_ust.
|
static |
SCI8 console RXD = PD03.
Definition at line 53 of file main.c.
Referenced by demo_setup_or_halt().
|
static |
SCI8 console TXD = PD02.
Definition at line 50 of file main.c.
Referenced by demo_setup_or_halt().
|
static |
|
static |
|
static |
|
static |
Shared round-trip parameters for this SDRAM-backed FAT12 volume.
|
static |
|
static |
|
static |