|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Shared tunables + host-side worker seam for the writable-OSPI self-loop. More...
Go to the source code of this file.
Functions | |
| ra8_err_t | ospirw_ospi_provision (void) |
| Bring the OSPI flash up and erase the writable window. | |
| VOID | ospirw_host_worker (ULONG arg) |
| Host-side worker: retry the full pass until it succeeds. | |
Shared tunables + host-side worker seam for the writable-OSPI self-loop.
Splits the usb_selftest_ospi_rw application across two translation units to keep each below the 1000-line file-size cap. This header carries the compile-time tunables (threads, pool, console cadence, LUN geometry, text-formatter sizing, host-ladder phase markers) that BOTH main.c (device + board bring-up side) and the host-side step routines in usb_selftest_ospi_rw_steps.c reference, plus the prototype for the single host worker that tx_application_define (in main.c) spawns.
The enums are defined here – not duplicated – so the two TUs share one authoritative definition. The console formatters, the per-(LUN,LBA) pattern generator, and the host READ/WRITE verifier all live in the sibling and are file-private there; only ospirw_host_worker crosses the TU boundary, so it is the only function prototype exported here.
Definition in file usb_selftest_ospi_rw_steps.h.
| enum ospirw_config_t : uint32_t |
Compile-time settings: threads, pool, console, cadence.
Definition at line 48 of file usb_selftest_ospi_rw_steps.h.
| enum ospirw_geom_t : uint32_t |
LUN geometry + verification constants.
Definition at line 86 of file usb_selftest_ospi_rw_steps.h.
| enum ospirw_hex_t : uint8_t |
Hex/decimal text-formatter sizing constants.
Definition at line 65 of file usb_selftest_ospi_rw_steps.h.
| enum ospirw_mask_t : uint32_t |
Bit-mask constants used by the text formatters.
| Enumerator | |
|---|---|
| k_ospirw_nibble_mask | 4-bit nibble mask. |
| k_ospirw_dec_radix | Base for decimal conversion. |
Definition at line 77 of file usb_selftest_ospi_rw_steps.h.
| enum ospirw_phase_t : uint32_t |
J-Link probe values marking host-ladder progress.
Definition at line 108 of file usb_selftest_ospi_rw_steps.h.
| VOID ospirw_host_worker | ( | ULONG | arg | ) |
Host-side worker: retry the full pass until it succeeds.
Waits for the device side to attach, then loops the full host pass (enumerate + WRITE(10) + read-verify) with a retry pause until the writable LUN verifies; afterwards parks so the verdict stays on the wire. Spawned by tx_application_define in main.c; the body and all of its helpers live in usb_selftest_ospi_rw_steps.c.
| [in] | arg | ThreadX entry argument (unused). |
Definition at line 565 of file usb_selftest_ospi_rw_steps.c.
References k_ospirw_boot_wait_ticks, k_ospirw_idle_ticks, k_ospirw_retry_ticks, k_ra8_ok, ospirw_host_pass(), and tx_thread_sleep.
Referenced by tx_application_define().
|
nodiscard |
Bring the OSPI flash up and erase the writable window.
Mirrors the read-only OSPI self-loop's bring-up: U15 expander courtesy write, ra8_board_xspi_pins_init (OCTA pins + RESET pulse), ra8_xspi_init 1S-1S-1S, JEDEC-id readback, then a one-shot erase of the k_ospirw_sectors window at k_ospirw_offset so the per-write path is fast program-only. The host owns the data. The body lives in usb_selftest_ospi_rw_device.c; ospirw_device_worker in main.c calls it once before USB attach.
| k_ra8_ok | OSPI is up and the write window is erased. |
| (other) | A pins / init / erase step failed. |
Definition at line 45 of file usb_selftest_ospi_rw_device.c.
References k_ospirw_block_size, k_ospirw_erase_sector, k_ospirw_instance, k_ospirw_offset, k_ospirw_sectors, k_ra8_ok, k_ra8_xspi_lio_1s1s1s, ra8_board_io_expander_set_octospi_active(), ra8_board_xspi_pins_init(), ra8_xspi_flash_erase_sector(), ra8_xspi_flash_read_id(), ra8_xspi_init(), s_dbg_ospi_id, and s_dbg_ospi_prov.
Referenced by ospirw_device_worker().