Compliance & Verification

# IEC 61508 SIL-3 diagnostic coverage fault testing

Verify your Flash CRC self-test, watchdog window and dual-channel sensor discrepancy checks fire every time a fault is injected.

Safety diagnostics often rot silently because normal benches never corrupt Flash bytes or freeze one of two redundant sensors. Months later, a linker edit shifts the CRC end symbol and breaks the self-test.

CircuitTwin runs diagnostic negative controls on every commit: flip a byte, stall a task or freeze channel B, and assert your safety firmware enters its safe state within the fault-tolerant time interval.

## SIL-3 diagnostic tests in CI

| Diagnostic mechanism   | Negative-control test                 | Expected verdict                        |
| ---------------------- | ------------------------------------- | --------------------------------------- |
| Flash CRC-32 self-test | Corrupt 1 byte in test image copy     | POST rejects image and halts safely     |
| Window watchdog (WWDG) | Trigger early refresh or starvation   | Hardware watchdog resets MCU cleanly    |
| Dual-sensor voting     | Override register on channel B sensor | Discrepancy threshold trips safe output |

## Local CLI workflow

Shell - run diagnostic coverage matrix

```
ct test matrix run --json --junit results/sil3-diag.xml tests/sil3-diagnostics.yaml
```

## Suite & fault configuration

tests/sil3-diagnostics.yaml

```
version: 1
board: nucleo-f446re
firmware: build/safety_plc.elf
matrix:
  - name: dual-sensor-discrepancy-trip
    faults:
      - at_ms: 200
        part: ads1115
        kind: frozen_reading
    expect:
      console_contains: "SAFE_OUTPUT_OFF"
```

## CI pipeline integration

.gitlab-ci.yml - SIL diagnostic matrix

```
sil-diagnostics:
  script:
    - ct test matrix run --json --junit results/sil3-diag.xml tests/sil3-diagnostics.yaml
  artifacts:
    reports:
      junit: results/sil3-diag.xml
```

## Troubleshooting checklist

| Symptom                                              | Fix                                                                                                      |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Hardware CRC-32 self-test mismatches linker checksum | Verify STM32 hardware CRC-32 (no reflection, no final XOR) vs IEEE 802.3 in the Embedded CRC Calculator. |
| Watchdog does not fire during hang test              | Confirm DBGMCU freeze bits are not masking watchdog counters in release builds.                          |

## Frequently asked questions

| Question                                              | Answer                                                                                                                                          |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Why run negative-control tests on safety diagnostics? | A diagnostic test that only checks the happy path cannot prove the alarm actually works. Injecting a real fault proves the safe state triggers. |

## Related boards & component twins

[Board: nucleo-f446re](https://circuittwin.ai/boards/nucleo-f446re) [Board: s32k144-evb](https://circuittwin.ai/boards/s32k144-evb) [Board: aurix-tc375-lite](https://circuittwin.ai/boards/aurix-tc375-lite) [Twin: ADS1115](https://circuittwin.ai/twins/ads1115) [Twin: TLF35584](https://circuittwin.ai/twins/tlf35584) [Twin: INA228](https://circuittwin.ai/twins/ina228) [Compliance & provenance](https://circuittwin.ai/docs/compliance)

## More in Compliance & Verification

[EU Cyber Resilience Act (CRA) firmware testing evidence](https://circuittwin.ai/guides/eu-cra-firmware-testing-evidence) [ISO 26262 firmware fault-injection & traceability support](https://circuittwin.ai/guides/iso-26262-firmware-verification) [DO-178C firmware testing and traceability workflows](https://circuittwin.ai/guides/do-178c-firmware-traceability) [FDA Section 524B medical device firmware testing support](https://circuittwin.ai/guides/fda-524b-medical-device-cybersecurity-testing)

> ## Run this workflow on your own ELF
>
> Start free on CircuitTwin to run local board twins, fault matrices and CI checks with zero per-run credits.
>
> [Start now](https://app.circuittwin.ai/try) [Read the quickstart](https://circuittwin.ai/docs/quickstart) [Connect a coding agent](https://circuittwin.ai/docs/agents)
