MCU Testing & CI

ESP32-S3 firmware CI on Xtensa LX7 twins

Run ESP32-S3 binaries headlessly on esp32s3-devkitc and adafruit-qualia-esp32s3 twins to test drivers, state machines and bus faults.

ESP32-S3 runs dual-core Xtensa LX7 at 240 MHz with a flexible GPIO matrix and SPI/I2C/UART/TWAI controllers. In CI, flashing USB boards across runners creates serial port contention and brittle resets.

CircuitTwin executes Xtensa LX7 instructions (160,000 differential cases, 0 disagreements on clean-tree records) and reports any access to unmodelled Wi-Fi/BLE baseband registers explicitly with exit code 4 rather than faking a pass.

ESP32-S3 simulation scope

AreaStatus on twinPractical guidance
Xtensa LX7 CPU core160,000 diff cases, 0 disagreesRun full C/C++ firmware and FreeRTOS tasks
UART / SPI / I2CActive peripheral modelsTest sensor drivers, displays and fault recovery
Native Wi-Fi / BLE PHYNot modelled (exit code 4)Use mocked/transport seam or ESP-AT UART module twin
Tracked boardsesp32s3-devkitc, adafruit-qualia-esp32s3See board-dashboard.json for live suite breakdown

Local CLI workflow

Shell — run ESP32-S3 ELF
idf.py set-target esp32s3 && idf.py build
ct run --json --board esp32s3-devkitc build/app.elf

Suite & fault configuration

tests/esp32s3.suite.yaml
version: 1
board: esp32s3-devkitc
firmware: build/app.elf
tests:
  - name: sensor-poll-and-watchdog
    timeout_ms: 3000
    expect:
      console_contains: "APP_MAIN_OK"
      exit_code: 0
  - name: spi-display-disconnect
    faults:
      - at_ms: 150
        part: bmi270
        kind: bus_disconnect
        duration_ms: 40
    expect:
      console_contains: "IMU_REINIT_OK"

CI pipeline integration

.github/workflows/esp32s3-ci.yml
name: ESP32-S3 Twin CI
on: [push, pull_request]
jobs:
  esp32s3:
    runs-on: ubuntu-latest
    container: espressif/idf:v5.3
    steps:
      - uses: actions/checkout@v4
      - run: idf.py set-target esp32s3 && idf.py build
      - uses: circuittwin/action@v1
        with:
          suite: tests/esp32s3.suite.yaml

Troubleshooting checklist

SymptomFix
Exit code 4 inside esp_wifi_init()Guard Wi-Fi startup behind a build flag or test your protocol/driver layer with the ESP-AT UART twin.
UART0 console silent at 115200 bpsVerify CONFIG_ESP_CONSOLE_UART_DEFAULT=y (USB-Serial-JTAG console does not emit on UART0).
SPI clock divider off on 80 MHz APBCheck integer divider math with the SPI Clock Divider Calculator.
Watchdog triggers during heavy initInspect virtual elapsed time in ct run --json output to see which loop stalled.

Related boards & component twins

More in MCU Testing & CI