Fault Injection & Debugging

# Multi-board ECU scene orchestration over CAN, SPI and UART

Test host-coprocessor UART links, dual-ECU CAN-FD networks and AVR-to-STM32 SPI bridges in a single lockstep run.

Real embedded products rarely run on one MCU. A Linux or STM32H7 main controller talks to an STM32G0 power supervisor over I2C, an nRF52 over UART, or another ECU over CAN-FD.

CircuitTwin scenes run multiple compiled ELFs across heterogeneous ISAs (ARM + RISC-V + AVR + Xtensa) on one shared virtual timeline so cross-board protocol bugs surface before hardware integration.

## Multi-board link types supported in scenes

| Shared link      | Example mixed-MCU pair                 | Faults injectable                         |
| ---------------- | -------------------------------------- | ----------------------------------------- |
| CAN / CAN-FD bus | STM32H743 + NXP S32K144/S32K344        | Node mute, ACK drop, frame corruption     |
| UART cross-link  | STM32F767 + nRF52840 or ATmega328P     | Baud mismatch, byte drop, link disconnect |
| I2C / SPI link   | Master MCU + slave MCU or shared flash | NACK burst, wrong chip-select wiring      |

## Local CLI workflow

Shell - run multi-board scene

```
ct scene run --json --junit results/scene.xml scenes/dual-ecu-canfd.scene.json
```

## Suite & fault configuration

scenes/dual-ecu-canfd.scene.json

```
{
  "schemaVersion": "ct.scene/1",
  "nodes": [
    { "id": "gw", "board": "nucleo-h743zi2", "firmware": "build/gw.elf" },
    { "id": "ecu", "board": "s32k144-evb", "firmware": "build/ecu.elf" }
  ],
  "links": [
    { "kind": "can", "name": "can0", "endpoints": ["gw:FDCAN1", "ecu:CAN0"] }
  ]
}
```

## CI pipeline integration

.github/workflows/multi-board-scene.yml

```
name: Multi-Board Scene CI
on: [push, pull_request]
jobs:
  scene:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: ct scene run --json --junit results/scene.xml scenes/dual-ecu-canfd.scene.json
```

## Troubleshooting checklist

| Symptom                                             | Fix                                                                                                          |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| One node prints before the other finishes boot init | Add explicit handshake retries in firmware; scenes run both MCUs from t=0 with their real boot clock speeds. |

## Frequently asked questions

| Question                                                       | Answer                                                                                                                                 |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Can one scene combine an 8-bit AVR and a 32-bit ARM Cortex-M7? | Yes. CircuitTwin scenes step every node on a unified virtual clock, as verified by our avr-f767-uart and esp32s3-f767-can test scenes. |

## Related boards & component twins

[Board: nucleo-h743zi2](https://circuittwin.ai/boards/nucleo-h743zi2) [Board: s32k144-evb](https://circuittwin.ai/boards/s32k144-evb) [Board: nucleo-f767zi](https://circuittwin.ai/boards/nucleo-f767zi) [Board: arduino-uno](https://circuittwin.ai/boards/arduino-uno) [Twin: TJA1051](https://circuittwin.ai/twins/tja1051) [Twin: MAX3485](https://circuittwin.ai/twins/max3485) [Scene schema reference](https://circuittwin.ai/docs/scenes)

## More in Fault Injection & Debugging

[I2C NACK and stuck-bus fault injection in CI](https://circuittwin.ai/guides/i2c-nack-fault-injection) [SPI bus fault testing and chip-select verification](https://circuittwin.ai/guides/spi-bus-fault-testing) [Debugging UART baud mismatches and framing errors](https://circuittwin.ai/guides/uart-baud-mismatch-debugging) [Cortex-M HardFault triage in CI and reverse GDB](https://circuittwin.ai/guides/cortex-m-hardfault-ci-triage)

> ## 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)
