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
| Area | Status on twin | Practical guidance |
|---|---|---|
Xtensa LX7 CPU core | 160,000 diff cases, 0 disagrees | Run full C/C++ firmware and FreeRTOS tasks |
UART / SPI / I2C | Active peripheral models | Test sensor drivers, displays and fault recovery |
Native Wi-Fi / BLE PHY | Not modelled (exit code 4) | Use mocked/transport seam or ESP-AT UART module twin |
Tracked boards | esp32s3-devkitc, adafruit-qualia-esp32s3 | See 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.elfSuite & 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.yamlTroubleshooting checklist
| Symptom | Fix |
|---|---|
| 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 bps | Verify CONFIG_ESP_CONSOLE_UART_DEFAULT=y (USB-Serial-JTAG console does not emit on UART0). |
| SPI clock divider off on 80 MHz APB | Check integer divider math with the SPI Clock Divider Calculator. |
| Watchdog triggers during heavy init | Inspect virtual elapsed time in ct run --json output to see which loop stalled. |