MCU Testing & CI

# STM32F7 firmware CI without a bench

Gate STM32F7 pull requests on the same Cortex-M7 ELF you flash to NUCLEO-F767ZI, including I2C/SPI sensor faults and exit code 4 unmodelled-register checks.

STM32F7 firmware fails in two ways that unit tests on x86 never see: misconfigured RCC peripheral clocks causing precise BusFaults, and DMA/cache coherency bugs on the Cortex-M7 data cache. Running the cross-compiled ARMv7E-M ELF on a deterministic STM32F767ZI twin exercises your real startup vector table, CubeHAL or LL register writes, and sensor drivers.

NUCLEO-F767ZI is the reference host for all 10 published vendor-driver oracles (MCP9808, HDC1080, INA219, PCA9685, AT24C256C, ADXL345, MPU-6050, SHT31-DIS, LSM6DSO, MAX31855). Attach any of them in your suite config and assert exact console markers or fault recovery.

## STM32F767ZI twin checkpoints

| Subsystem          | What the twin verifies                          | Common regression caught                               |
| ------------------ | ----------------------------------------------- | ------------------------------------------------------ |
| RCC + APB1/APB2    | Peripheral clock enable bits before MMIO writes | Writing I2C1->CR1 before RCC\_APB1ENR returns BusFault |
| Cortex-M7 FPv5-D16 | 2.2M-case ARMv7E-M differential instruction set | Wrong -mfpu flag or unenabled CPACR CP10/CP11          |
| I2C / SPI / USART  | Real driver framing, ACKs, baud dividers        | APB1 vs APB2 clock mismatch halving USART baud         |
| Unmodelled regs    | Exit code 4 (inconclusive) with peripheral + PC | Silent pass when code touches unmodelled ETH/USB bits  |

## Local CLI workflow

Shell — build & run STM32F7 ELF

```
arm-none-eabi-gcc -mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard ... -o build/app.elf
ct run --json --board nucleo-f767zi --timeout-ms 3000 build/app.elf
ct test run --json --junit results/f7.xml tests/stm32f7.suite.yaml
```

## Suite & fault configuration

tests/stm32f7.suite.yaml

```
version: 1
board: nucleo-f767zi
firmware: build/app.elf
tests:
  - name: boot-and-imu-read
    timeout_ms: 2500
    expect:
      console_contains: "IMU_OK"
      exit_code: 0
  - name: i2c1-nack-recovery
    faults:
      - at_ms: 80
        bus: I2C1
        kind: nack
        address: 0x68
        count: 3
    expect:
      console_contains: "I2C_RETRY_OK"
```

## CI pipeline integration

.github/workflows/stm32f7-ci.yml

```
name: STM32F7 Twin CI
on: [push, pull_request]
jobs:
  test-f767:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: cmake --preset stm32f7 && cmake --build --preset stm32f7
      - uses: circuittwin/action@v1
        with:
          suite: tests/stm32f7.suite.yaml
          junit-out: results/stm32f7.xml
```

## Troubleshooting checklist

| Symptom                                             | Fix                                                                                                                    |
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Exit code 4 naming RCC\_DCKCFGR2 or an ETH register | Inspect the JSON diagnostic; isolate unmodelled register paths or pass --unmodelled warn only for non-critical probes. |
| HardFault with CFSR=0x00080000 (NOCP) at boot       | Enable CP10/CP11 in SCB->CPACR inside SystemInit() before any C++ static constructor uses floating point.              |
| UART output missing in CI log                       | Verify USART3 (ST-LINK VCP on PD8/PD9 for NUCLEO-F767ZI) baud divider against APB1 clock.                              |
| Timeout waiting for HSE ready                       | Check whether your CubeMX clock init expects HSE bypass mode (8 MHz MCO from ST-LINK) vs crystal.                      |

## Related boards & component twins

[Board: nucleo-f767zi](https://circuittwin.ai/boards/nucleo-f767zi) [Board: nucleo-h743zi2](https://circuittwin.ai/boards/nucleo-h743zi2) [Twin: BMI088](https://circuittwin.ai/twins/bmi088) [Twin: MPU-6050](https://circuittwin.ai/twins/mpu-6050) [Twin: LSM6DSO](https://circuittwin.ai/twins/lsm6dso) [CI integration reference](https://circuittwin.ai/docs/ci) [Board dashboard](https://circuittwin.ai/docs/board-dashboard)

## More in MCU Testing & CI

[STM32F4 firmware testing without hardware](https://circuittwin.ai/guides/stm32f4-firmware-testing) [STM32H7 digital twin CI for H743 & H747](https://circuittwin.ai/guides/stm32h7-digital-twin-ci) [STM32F103 Blue Pill & NUCLEO-F103RB simulation](https://circuittwin.ai/guides/stm32f103-bluepill-simulation) [Nordic nRF52840 firmware CI without hardware](https://circuittwin.ai/guides/nrf52840-firmware-ci)

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