Skip to content

soc_rp2040::test_status

Machine-observable completion for ARM on-target tests.

Passing returns to ROM BOOTSEL, which a host can identify as USB 2e8a:0003. Failure never enters BOOTSEL; the LED repeats the failure code for a human while the host reaches its deadline. This avoids calling a silent board a pass merely because serial output was unavailable.

unsafe fn arm_expected_fault()

Arm the one deliberate HardFault in the ARM target suite.

Call immediately before the injected fault with interrupts masked or from the sole running test task. Any intervening fault is deliberately rejected.

fn fail(code: u8) -> !

Halt with a repeating, one-to-15 pulse failure code and stay out of BOOTSEL so the host reports a bounded failure.

fn hard_fault() -> !

Terminal status for the self-test HardFault vector.

The host observes failure by the deliberate absence of BOOTSEL; pulse 15 distinguishes the injected fault from ordinary assertion codes on a bench.

unsafe fn pass_live() -> !

Publish a passing status for an attached SWD harness and remain readable.

The harness consumes the status and then uses the watchdog registers to return the target to BOOTSEL, so this path needs no unreliable live ROM call.

Terminates application execution and exposes the final result through a volatile global. Call only after all test output has drained.

unsafe fn pass_to_bootsel() -> !

Report a passing suite and enter ROM USB BOOTSEL through a full watchdog reset.

Terminates normal execution. A hardware reset stops both cores before the pre-RAM recovery handler calls ROM, avoiding a live dual-core ROM handoff. Call only after all test result writes are complete.

fn take_expected_fault_arm() -> bool

Consume and validate the deliberate-fault arm token.