Skip to main content
EVCore uses a stable numeric fault-code catalog to describe instrument, safety, configuration, and operator events. Faults are recorded in the firmware, surfaced to the host through the communications protocol, and mapped to human-readable diagnostic codes in the knowledge base. This page lists every code, explains how faults latch and clear, and shows how to read the evidence fields that accompany each record.

Fault categories and severities

Every fault has a category, a severity, and an action that the firmware takes automatically.

Safety-manager fault codes (1 to 12)

These codes map one-to-one to the latched safety bits managed by the Safety Manager. Each bit set in the safety flags produces a corresponding fault record. See Safety Manager for the state machine, interlock rules, and reset behavior. The evidence field for codes 1 to 12 contains the full latched safety mask at the time the fault was recorded. This mask is the same value returned by EV_SafetyGetLatchedFaults.

Test-runner fault codes (32 to 41)

These codes are produced by the diagnostic engine and application modules during a test sequence. They describe instrument behavior, measurement problems, and operator actions rather than safety interlocks. Codes 32 to 41 are defined in firmware/src/evcore_fault.c and surfaced through the fault list API in firmware/include/evcore_fault.h.

How faults latch and clear

The Safety Manager latches faults into a retained bitmask. Once any fault condition is detected, the state transitions to FAULT, outputs are commanded off, and the fault bits remain set until an explicit reset. Calling EV_SafetyResetFault requires all current inputs to be healthy and fresh; it clears the latch and returns the manager to DISARMED with outputs still off. Reset does not re-arm or restore prior outputs. Disarm does not clear a fault. New faults that arrive while already in FAULT are added to the same latched bitmask. The fault list stores the first record for each unique code and drops duplicates. The list holds up to EV_FAULT_RECORDS (8) entries. If the list is full, additional distinct codes are counted in dropped and discarded. The list is cleared by EV_FaultListClear and populated by EV_FaultListAdd or EV_FaultListAddSafetyBits, which maps each set safety bit to its matching code automatically.

Diagnostic code mapping

The knowledge base file knowledge/diagnostic-codes.json maps firmware fault codes to human-readable diagnostic codes used in EVCore Studio reports. E-series codes describe the instrument, its interlocks, setup, or operator actions. M-series and S-series codes describe findings about the device under test and are documented separately in the measurement and sensor modules. All diagnostic codes in the E series are marked draft in knowledge/diagnostic-codes.json and have not yet been reviewed by a technician.

Record structure

A fault record contains the following fields: The record is defined in firmware/include/evcore_fault.h as EV_FaultRecord. The list EV_FaultList holds up to 8 records plus a dropped counter.

API reference

The fault module provides catalog lookup and list management. All names use the EV_Fault prefix.

Implementation status

The fault-code catalog, lookup functions, list management, and diagnostic-code mapping are fully implemented and host-testable. The host simulator exercises fault recording, deduplication, list saturation, safety-bit expansion, and category queries. STM32H743 target integration, on-device safety-bit latching from physical inputs, and field-validated diagnostic-code descriptions remain future work.