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.
Functions
Section titled “Functions”arm_expected_fault
Section titled “arm_expected_fault”unsafe fn arm_expected_fault()Arm the one deliberate HardFault in the ARM target suite.
Safety
Section titled “Safety”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.
hard_fault
Section titled “hard_fault”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.
pass_live
Section titled “pass_live”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.
Safety
Section titled “Safety”Terminates application execution and exposes the final result through a volatile global. Call only after all test output has drained.
pass_to_bootsel
Section titled “pass_to_bootsel”unsafe fn pass_to_bootsel() -> !Report a passing suite and enter ROM USB BOOTSEL through a full watchdog reset.
Safety
Section titled “Safety”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.
take_expected_fault_arm
Section titled “take_expected_fault_arm”fn take_expected_fault_arm() -> boolConsume and validate the deliberate-fault arm token.