RTOS & Firmware Stacks
ESP-IDF CI simulation for ESP32, S3 & C3
Test ESP-IDF peripheral drivers, FreeRTOS tasks and sensor error paths inside Docker CI without physical devkits.
ESP-IDF projects combine FreeRTOS, vendor HAL drivers and custom sensor or telemetry logic. Running the compiled ELF inside the official espressif/idf Docker image paired with CircuitTwin lets every pull request verify UART, SPI, I2C and application state machines deterministically.
Remember the explicit boundary: native Wi-Fi and BLE radio stacks are not modelled in CircuitTwin today. Isolate Wi-Fi/BLE transport behind an interface or use an ESP-AT UART twin so hardware-level peripheral tests stay clean and never hit exit code 4.
ESP-IDF targets in board-dashboard.json
| Board slug | IDF target | CPU core |
|---|---|---|
esp32-devkitc | esp32 | Xtensa LX6 |
esp32s3-devkitc | esp32s3 | Xtensa LX7 |
esp32c3-devkitm | esp32c3 | RISC-V RV32IMC |
esp32c6-devkitc | esp32c6 | RISC-V RV32IMAC |
Local CLI workflow
idf.py set-target esp32s3 && idf.py build
ct run --json --board esp32s3-devkitc build/app.elfSuite & fault configuration
version: 1
board: esp32s3-devkitc
firmware: build/app.elf
tests:
- name: i2c-driver-boot-check
timeout_ms: 3000
expect:
console_contains: "SENSORS_INIT_DONE"
exit_code: 0
- name: i2c-stuck-sensor-recovery
faults:
- at_ms: 120
bus: I2C0
kind: nack
address: 0x76
count: 4
expect:
console_contains: "I2C_BUS_RESET_OK"CI pipeline integration
esp-idf-twin-ci:
image: espressif/idf:v5.3
parallel:
matrix:
- TARGET: [esp32, esp32s3, esp32c3]
script:
- idf.py set-target $TARGET && idf.py build
- ct test run --json tests/esp-idf.suite.yamlESP-IDF v5 peripheral driver CI without devkits
Test ESP-IDF v5 i2c_master, spi_master and UART driver migrations inside espressif/idf Docker containers.
ESP-IDF v5 replaced the legacy driver/i2c.h API with driver/i2c_master.h and tightened interrupt allocation rules. Porting drivers across ESP32, S3 and C3 routinely introduces timeout and pull-up bugs.
CircuitTwin runs the compiled Xtensa LX6/LX7 or RISC-V RV32IMC ELF directly in CI while keeping radio boundaries clear: native Wi-Fi and BLE RF stacks are not modelled, so test bus drivers and application logic cleanly without RF mocks.
ESP-IDF v5 targets in CI
| Board slug | SoC / ISA | Verified cross-vendor buses |
|---|---|---|
esp32c3-devkitm | ESP32-C3 (RV32IMC) | I2C BME280, SPI W25Q, I2C EEPROM, UART passing |
esp32s3-devkitc | ESP32-S3 (Xtensa LX7) | 3,334/3,372 silicon reset-register match on Qualia S3 |
esp32-devkitc | ESP32-D0WD-V3 (Xtensa LX6) | UART, SPI, I2C, TWAI and FreeRTOS kernel |
idf.py set-target esp32c3 && idf.py build
ct run --json --board esp32c3-devkitm --device bme280 build/app.elfversion: 1
board: esp32c3-devkitm
firmware: build/app.elf
tests:
- name: i2c-master-v5-nack-retry
timeout_ms: 3000
faults:
- at_ms: 200
bus: I2C0
kind: nack
address: 0x76
count: 2
expect:
console_contains: "I2C_V5_RECOVERY_OK"
exit_code: 0Troubleshooting checklist
| Symptom | Fix |
|---|---|
| Boot stalls waiting on flash encryption / eFuse | Use a development sdkconfig.ci overlay with flash encryption disabled for headless logic runs. |
| Exit code 4 inside Wi-Fi/BLE init | Compile CI peripheral suite with CONFIG_TEST_OFFLINE_TRANSPORT=y so RF baseband registers are skipped. |
| I2C master timeout in IDF v5.x new driver | Check pull-up configuration and timeout_ms in i2c_master_transmit_receive(). |
| Task WDT fires during startup | Increase timeout_ms or check for tight busy-wait loops on unconfigured GPIO pins. |
| Exit code 4 inside esp_wifi_init() | Native Wi-Fi/BLE PHY is not modelled; guard Wi-Fi init behind a build flag or test with an ESP-AT UART transport. |
| i2c_master_transmit() returns ESP_ERR_TIMEOUT | Verify SCL/SDA GPIO matrix routing matches the board twin pins. |
Frequently asked questions
| Question | Answer |
|---|---|
| Does CircuitTwin simulate ESP32 Wi-Fi or BLE radio packets? | No. Native ESP32 Wi-Fi and BLE RF stacks are not modelled. Use CircuitTwin for ESP32 CPU, FreeRTOS, I2C, SPI, UART, TWAI and sensor driver CI. |