ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
usb_selftest_host.h File Reference

Host-side entry point of the soak self-test. More...

#include "ra8_err.h"
Include dependency graph for usb_selftest_host.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ra8_err_t selftest_host_pass (void)
 Run one full soak pass and print the verdict.

Detailed Description

Host-side entry point of the soak self-test.

One full host pass over the loop cable: enumerate the device, mount its FAT16 volume, repeat the 1 MiB integrity sweep k_selftest_soak_iters times, confirm the RO write rejection, and print the aggregate throughput + SOAK PASS banner. Driven by the host worker thread in main.c. Defined in usb_selftest_host.c.

Since
0.1.0

Definition in file usb_selftest_host.h.

Function Documentation

◆ selftest_host_pass()

ra8_err_t selftest_host_pass ( void )
nodiscard

Run one full soak pass and print the verdict.

Returns
k_ra8_ok if every iteration matched and SOAK PASS was printed; otherwise the first failing step's error (host controller closed).
Precondition
The device-side class is registered and attached (other thread).
The self-loop cable connects J7 to J11.
Postcondition
On success LED2 is on and the aggregate + PASS lines are queued.
Since
0.1.0

Run one full soak pass and print the verdict.

One full host-side pass: enumerate, mount, verify, WP.

One full host-side pass: enumerate, mount, browse, verify, WP.

Run one full soak pass and print the verdict.

One full host-side pass: enumerate, mount, verify, WP.

Drives the host-side ladder over the self-loop cable: brings the USBHS host up and enumerates the FS device, mounts and parses the FAT16 volume, browses the root directory, raw-verifies the 1 MiB MRAM data region with multi-block READ(10) bursts, then probes the write-protect rejection. Phases are mirrored into the J-Link progress probe for readout. On any failure the host controller is closed so the next retry starts from a clean attach. The host worker thread (in main.c) loops this until it returns k_ra8_ok.

Returns
First failing step's error, or k_ra8_ok.
Return values
k_ra8_okThe pass printed the BROWSE PASS banner.
Precondition
Device-side class is registered and attached (other thread).
The self-loop cable connects J7 to J11.
Postcondition
On success the pass counter advanced and LED2 is on.
On failure the host controller is deinitialized again.
Note
Blocking; runs on the low-priority host thread.
Since
0.1.0

One full host-side pass: enumerate, mount, browse, verify, WP.

Run one full soak pass and print the verdict.

One full host-side pass: enumerate, mount, verify, WP.

One full host-side pass: enumerate, mount, browse, verify, WP.

Enumerates and mounts to prove FAT parse, then runs selftest_verify_mram_raw k_selftest_soak_iters times back to back – every burst is still memcmp'd vs MRAM, so a single corrupted transfer anywhere in the soak fails the run. Aggregates volume + time for a stable throughput benchmark, then confirms the RO write rejection once. s_dbg_pass_count mirrors the completed-iteration count for J-Link.

Returns
First failing step's error, or k_ra8_ok.
Return values
k_ra8_okAll iterations matched; SOAK PASS printed.
Precondition
Device-side class is registered and attached (other thread).
The self-loop cable connects J7 to J11.
Postcondition
On success LED2 is on and the aggregate + PASS lines are queued.
On failure the host controller is closed for a clean retry.
Note
Blocking; ~k_selftest_soak_iters MiB over the loop.
Since
0.1.0

Definition at line 738 of file usb_host_msc_browse_host.c.

References k_ra8_board_led2, k_ra8_ok, k_selftest_phase_mount, k_selftest_phase_pass, k_selftest_phase_verify, k_selftest_phase_wp, k_selftest_soak_iters, ra8_board_led_on(), ra8_fs_unmount(), ra8_usb_hmsc_close(), s_dbg_pass_count, s_dbg_phase, s_dbg_verified_bytes, s_dbg_verify_ms, selftest_host_enumerate(), selftest_host_enumerate(), selftest_host_enumerate(), selftest_mount_volume(), selftest_mount_volume(), selftest_mount_volume(), selftest_print(), selftest_print(), selftest_print_soak_verdict(), selftest_print_verify_verdict(), selftest_print_verify_verdict(), selftest_verify_mram_raw(), selftest_verify_mram_raw(), selftest_verify_ospi_raw(), selftest_write_protect_probe(), selftest_write_protect_probe(), and selftest_write_protect_probe().