RTOS & Firmware Stacks

PlatformIO headless firmware CI without hardware

Point suite.yaml straight at .pio/build/<env>/firmware.elf and run deterministic sensor and bus fault tests in CI.

PlatformIO builds cleanly across dozens of embedded frameworks (Arduino, STM32Cube, ESP-IDF, Zephyr), yet pio test -e native only checks pure host logic without real peripherals.

By running .pio/build/<env>/firmware.elf on CircuitTwin, you keep your exact platformio.ini environments while testing real I2C, SPI, UART and CAN drivers headlessly.

PlatformIO environment to CircuitTwin mapping

platformio.ini boardELF output pathCircuitTwin board slug
nucleo_f446re.pio/build/nucleo_f446re/firmware.elfnucleo-f446re
esp32-c3-devkitm-1.pio/build/esp32c3/firmware.elfesp32c3-devkitm
megaatmega2560.pio/build/mega2560/firmware.elfarduino-mega2560
teensy41.pio/build/teensy41/firmware.elfteensy-4-1

Local CLI workflow

Shell - build with PlatformIO and execute twin suite
pio run -e nucleo_f446re
ct test run --json --junit results/pio.xml tests/pio-f446.suite.yaml

Suite & fault configuration

tests/pio-f446.suite.yaml
version: 1
board: nucleo-f446re
firmware: .pio/build/nucleo_f446re/firmware.elf
tests:
  - name: pio-sensor-smoke
    timeout_ms: 2500
    expect:
      console_contains: "BOOT_READY"
      exit_code: 0

CI pipeline integration

.github/workflows/platformio-twin-ci.yml
name: PlatformIO Twin CI
on: [push, pull_request]
jobs:
  pio:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: pip install platformio && pio run -e nucleo_f446re
      - uses: circuittwin/action@v1
        with:
          suite: tests/pio-f446.suite.yaml

Troubleshooting checklist

SymptomFix
PlatformIO only outputs firmware.bin or firmware.hexPlatformIO always emits firmware.elf inside .pio/build/<env>/ right beside .bin/.hex.
Symbols missing during ct debug GDB sessionsAdd build_type = debug or build_flags = -g3 in platformio.ini for source-line debugging.

Frequently asked questions

QuestionAnswer
Does PlatformIO require any special library to run on CircuitTwin?No. Build your normal PlatformIO environment and point CircuitTwin at .pio/build/<env>/firmware.elf.

Related boards & component twins

More in RTOS & Firmware Stacks