Engineering Guides

# Embedded CI, RTOS & fault-injection guides

56 hands-on engineering playbooks with copy-paste `ct` CLI commands, `suite.yaml` fault definitions, CI workflows and troubleshooting tables.

## MCU Testing & CI (10)

| Guide                                                                                                              | Summary                                                                                                                                                      | Targets                                   |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------- |
| [**STM32F7 firmware CI without a bench**](https://circuittwin.ai/guides/stm32f7-firmware-ci)                       | 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. | nucleo-f767zi , nucleo-h743zi2            |
| [**STM32F4 firmware testing without hardware**](https://circuittwin.ai/guides/stm32f4-firmware-testing)            | Run your STM32F4 Cortex-M4F ELF across NUCLEO-F446RE, NUCLEO-F411RE, Black Pill and STM32F4-Discovery twins in under three seconds per suite.                | stm32f4-discovery , nucleo-f446re         |
| [**STM32H7 digital twin CI for H743 & H747**](https://circuittwin.ai/guides/stm32h7-digital-twin-ci)               | Run 480 MHz STM32H7 binaries on NUCLEO-H743ZI2, Arduino Portenta H7 and Arduino GIGA R1 twins—with 7 of 8 board-dashboard suites passing.                    | nucleo-h743zi2 , arduino-portenta-h7      |
| [**STM32F103 Blue Pill & NUCLEO-F103RB simulation**](https://circuittwin.ai/guides/stm32f103-bluepill-simulation)  | Test STM32F103 Cortex-M3 firmware without flashing ST-LINK dongles—backed by passing HAL ADC, DMA, EXTI, I2C, SPI, TIM and UART oracles.                     | blue-pill-f103c8 , nucleo-f103rb          |
| [**Nordic nRF52840 firmware CI without hardware**](https://circuittwin.ai/guides/nrf52840-firmware-ci)             | Test nRF52 EasyDMA peripheral logic, Zephyr RTOS threads and sensor fault recovery on deterministic Nordic board twins.                                      | nrf52840-dk , feather-nrf52840-express    |
| [**ESP32-S3 firmware CI on Xtensa LX7 twins**](https://circuittwin.ai/guides/esp32-s3-firmware-ci)                 | Run ESP32-S3 binaries headlessly on esp32s3-devkitc and adafruit-qualia-esp32s3 twins to test drivers, state machines and bus faults.                        | esp32s3-devkitc , adafruit-qualia-esp32s3 |
| [**ESP32-C3 & ESP32-C6 RISC-V firmware simulation**](https://circuittwin.ai/guides/esp32-c3-riscv-simulation)      | Run RISC-V ESP32-C3 and ESP32-C6 ELF targets headlessly—backed by the RV32IMAC differential CPU suite and I2C/SPI sensor twins.                              | esp32c3-devkitm , esp32c6-devkitc         |
| [**Teensy 4.1 (NXP i.MX RT1062) simulation & CI**](https://circuittwin.ai/guides/teensy-4-1-imxrt-simulation)      | Test Teensy 4.1 robotics and flight-control firmware in CI—backed by passing eDMA + timer peripheral oracle and ARMv7E-M differential runs.                  | teensy-4-1 , frdm-k64f                    |
| [**AVR ATmega328P & ATmega2560 firmware CI**](https://circuittwin.ai/guides/avr-atmega-firmware-ci)                | Test 8-bit AVR firmware without physical Arduino benches—backed by AVR CPU differential checks, passing ADC trigger oracle and Mega 2560 silicon capture.    | arduino-uno , arduino-nano                |
| [**Bare-metal ARM GCC startup and linker script CI**](https://circuittwin.ai/guides/bare-metal-arm-gcc-startup-ci) | Catch broken .data LMA-to-VMA copies, misaligned initial MSP and missing FPU CPACR enables before touching a JTAG probe.                                     | stm32f4-discovery , blue-pill-f103c8      |

## RTOS & Firmware Stacks (14)

| Guide                                                                                                               | Summary                                                                                                                                          | Targets                              |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ |
| [**Zephyr RTOS CI without hardware benches**](https://circuittwin.ai/guides/zephyr-rtos-ci-without-hardware)        | Execute your target Zephyr zephyr.elf directly on STM32, nRF52840 and FRDM-K64F board twins instead of porting drivers to native\_sim.           | nucleo-f767zi , nucleo-h743zi2       |
| [**FreeRTOS headless testing in CI**](https://circuittwin.ai/guides/freertos-headless-testing)                      | Test real FreeRTOS scheduler preemption, PendSV/SysTick timing and task check-signals on Cortex-M board twins.                                   | stm32f4-discovery , nucleo-f446re    |
| [**ESP-IDF CI simulation for ESP32, S3 & C3**](https://circuittwin.ai/guides/esp-idf-ci-simulation)                 | Test ESP-IDF peripheral drivers, FreeRTOS tasks and sensor error paths inside Docker CI without physical devkits.                                | esp32-devkitc , esp32s3-devkitc      |
| [**PX4 Pixhawk 6C simulation on real ARM ELF**](https://circuittwin.ai/guides/px4-pixhawk-6c-simulation)            | Go beyond host-compiled PX4 SITL: run the actual px4\_fmu-v6c Cortex-M7 ELF against real SPI/I2C sensor twins including BMI088 and BMP388.       | nucleo-h743zi2 , teensy-4-1          |
| [**Marlin 3D printer firmware testing in CI**](https://circuittwin.ai/guides/marlin-firmware-testing-ci)            | Verify Marlin thermal-runaway shutdowns, endstop trips and stepper-timer ISRs against your real compiled ELF before shipping a release.          | arduino-mega2560 , black-pill-f411ce |
| [**Multi-node CANopen testing without a bus bench**](https://circuittwin.ai/guides/canopen-multi-node-testing)      | Run two real MCU ELF images on a shared virtual CAN bus in one deterministic scene—then inject ACK errors, dropped heartbeats or bus-off states. | nucleo-f767zi , nucleo-h743zi2       |
| [**Rust Embassy async firmware CI without boards**](https://circuittwin.ai/guides/rust-embassy-async-firmware-ci)   | Test real Embassy async executors, WFI sleep loops and DMA futures on STM32, nRF52840 and RP2040 board twins.                                    | nucleo-f767zi , nrf52840-dk          |
| [**MicroPython firmware and C-module CI**](https://circuittwin.ai/guides/micropython-firmware-ci-testing)           | Boot compiled MicroPython firmware.elf images on board twins, drive REPL scripts over UART and inject real bus faults.                           | nucleo-f767zi , rpi-pico             |
| [**STM32CubeHAL clock tree and DMA CI**](https://circuittwin.ai/guides/stm32cubehal-dma-clock-ci)                   | Re-running CubeMX overwrites user clock tweaks or reorders MX\_DMA\_Init(). Catch every broken init order in headless CI.                        | nucleo-f767zi , nucleo-f103rb        |
| [**Apache NuttX RTOS boot and driver CI**](https://circuittwin.ai/guides/apache-nuttx-rtos-ci)                      | Execute real Apache NuttX nuttx ELFs in CI to verify NSH startup, POSIX /dev sensor drivers and board pinmux changes.                            | stm32f4-discovery , nucleo-h743zi2   |
| [**PlatformIO headless firmware CI without hardware**](https://circuittwin.ai/guides/platformio-headless-twin-ci)   | Point suite.yaml straight at .pio/build/<env>/firmware.elf and run deterministic sensor and bus fault tests in CI.                               | nucleo-f446re , esp32c3-devkitm      |
| [**Modbus RTU and RS-485 DE-turnaround testing in CI**](https://circuittwin.ai/guides/modbus-rtu-rs485-firmware-ci) | Catch truncated last bytes from dropping RS-485 DE on TXE instead of TC before shipping industrial fieldbus firmware.                            | nucleo-f446re , blue-pill-f103c8     |
| [**Eclipse ThreadX deterministic RTOS CI**](https://circuittwin.ai/guides/eclipse-threadx-rtos-ci)                  | Verify ThreadX preemption-threshold scheduling, byte pools and STM32/NXP peripheral drivers without a hardware rack.                             | b-u585i-iot02a , nucleo-h743zi2      |
| [**MCUboot A/B image swap and rollback testing in CI**](https://circuittwin.ai/guides/mcuboot-ab-slot-rollback-ci)  | Flash combined bootloader plus slot-0 and slot-1 images into a board twin and prove bad OTA updates revert cleanly.                              | nucleo-f767zi , nrf52840-dk          |

## Fault Injection & Debugging (22)

| Guide                                                                                                                                     | Summary                                                                                                                                                           | Targets                              |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| [**I2C NACK and stuck-bus fault injection in CI**](https://circuittwin.ai/guides/i2c-nack-fault-injection)                                | Most I2C drivers work on a quiet desk and lock up in the field on the first NACK. Automate NACK and stuck-SDA fault injection on every commit.                    | nucleo-f767zi , nucleo-f411re        |
| [**SPI bus fault testing and chip-select verification**](https://circuittwin.ai/guides/spi-bus-fault-testing)                             | SPI has no hardware ACK bit—when a slave drops off the bus, MISO silently reads 0x00 or 0xFF. Test your detection paths automatically in CI.                      | nucleo-f767zi , nucleo-h743zi2       |
| [**Debugging UART baud mismatches and framing errors**](https://circuittwin.ai/guides/uart-baud-mismatch-debugging)                       | When serial output turns into random bytes or stops after one framing error, check divider error math first and verify ORE recovery in CI.                        | nucleo-f446re , arduino-uno          |
| [**Cortex-M HardFault triage in CI and reverse GDB**](https://circuittwin.ai/guides/cortex-m-hardfault-ci-triage)                         | Stop chasing intermittent HardFaults over SWD: reproduce the crash deterministically on a board twin and step backward out of HardFault\_Handler.                 | nucleo-f767zi , stm32f4-discovery    |
| [**Detecting ISR race conditions deterministically**](https://circuittwin.ai/guides/isr-race-condition-detection)                         | Interrupt races hide for weeks on a bench because IRQ arrival phase rarely aligns twice. Sweep arrival phase deterministically and record shared-memory accesses. | nrf52840-dk , nucleo-f767zi          |
| [**Testing CAN bus-off (TEC > 255) and unacked frames**](https://circuittwin.ai/guides/can-bus-off-recovery-testing)                      | Drive TEC past 255 deterministically and prove your CAN driver exits bus-off without rebooting the ECU.                                                           | nucleo-h743zi2 , nucleo-f446re       |
| [**Ethernet link-down and packet-loss testing in CI**](https://circuittwin.ai/guides/ethernet-link-down-packet-loss-ci)                   | Test cable unplug, PHY auto-negotiation flaps and burst packet loss on compiled networking firmware without a switch.                                             | nucleo-f767zi , nucleo-h743zi2       |
| [**Preventing Cortex-M7 D-Cache and DMA coherency bugs**](https://circuittwin.ai/guides/cortex-m7-dcache-dma-coherency)                   | DMA bypasses the Cortex-M7 L1 data cache. Missing cache maintenance or MPU non-cacheable regions silently corrupts packets.                                       | nucleo-h743zi2 , nucleo-f767zi       |
| [**Testing IWDG, WWDG and watchdog starvation resets in CI**](https://circuittwin.ai/guides/watchdog-iwdg-wwdg-starvation-ci)             | Inject a sensor deadlock or infinite loop and verify hardware watchdog reset plus RCC\_CSR reset-cause logging in CI.                                             | nucleo-f446re , nucleo-f767zi        |
| [**Brownout reset and power-rail cycling tests in CI**](https://circuittwin.ai/guides/brownout-power-rail-cycling-ci)                     | Verify firmware waits for regulator power-good pins and re-initializes peripherals cleanly after a power-rail drop.                                               | nucleo-l476rg , nrf52840-dk          |
| [**Catching uninitialized SRAM and nondeterminism with --recheck**](https://circuittwin.ai/guides/uninitialized-sram-determinism-recheck) | Flaky firmware tests hide real silicon bugs. Run --recheck in CI to verify every test trace is bit-for-bit reproducible.                                          | nucleo-f767zi , stm32f4-discovery    |
| [**SPI NOR Flash and EEPROM torn-write testing in CI**](https://circuittwin.ai/guides/spi-nor-flash-power-loss-corruption)                | Catch 64-byte EEPROM page wraps, missing WREN latches and unrecovered LittleFS mounts before bricking customer units.                                             | nrf52840-dk , rpi-pico2              |
| [**Testing ADC Vref drift, open-circuit and shorted thermistors**](https://circuittwin.ai/guides/adc-vref-drift-thermistor-faults)        | Drive exact pin voltages from 0.0 V to Vref in suite.yaml and verify every over-temperature and low-battery threshold.                                            | stm32f4-discovery , arduino-mega2560 |
| [**GDB reverse-step and watchpoint firmware debugging**](https://circuittwin.ai/guides/gdb-reverse-step-firmware-debugging)               | Hit HardFault\_Handler, type reverse-stepi, and walk backwards straight to the instruction that trashed the pointer.                                              | nucleo-f767zi , stm32f4-discovery    |
| [**Capturing SEGGER RTT and ITM/SWO logs in headless CI**](https://circuittwin.ai/guides/rtt-itm-swo-live-logging-ci)                     | Read SEGGER RTT and ARM ITM/SWO telemetry directly from twin SRAM and core trace registers in CI.                                                                 | nrf52840-dk , nucleo-f767zi          |
| [**Importing ODB++ and IPC-2581 manufacturing packages**](https://circuittwin.ai/guides/odbpp-ipc2581-board-import)                       | Reuse the exact ODB++ or IPC-2581 manufacturing release package to keep firmware digital twins locked to production copper.                                       | s32k144-evb , nucleo-h743zi2         |
| [**Running air-gapped offline firmware CI with --network none**](https://circuittwin.ai/guides/air-gapped-offline-ci-network-none)        | Pin your ct binary, board files and local twin catalog inside an air-gapped runner with zero cloud dependency.                                                    | nucleo-f767zi , s32k144-evb          |
| [**Testing PWM dead-time, StallGuard and overcurrent trips in CI**](https://circuittwin.ai/guides/pwm-deadtime-motor-stall-faults)        | Prove your motor controller cuts PWM outputs on an nFAULT or StallGuard trip without smoking real power stages.                                                   | nucleo-g474re , nucleo-f446re        |
| [**Multi-board ECU scene orchestration over CAN, SPI and UART**](https://circuittwin.ai/guides/multi-board-can-uart-scene-testing)        | Test host-coprocessor UART links, dual-ECU CAN-FD networks and AVR-to-STM32 SPI bridges in a single lockstep run.                                                 | nucleo-h743zi2 , s32k144-evb         |
| [**Triaging exit code 4 unmodelled-register diagnostics**](https://circuittwin.ai/guides/unmodelled-register-exit-code-4-triage)          | Silent zero-reads turn real bugs into false green builds. Exit code 4 tells you the exact peripheral, register address and PC.                                    | nucleo-f767zi , esp32s3-devkitc      |
| [**Seeded LoRa and sub-GHz RF packet-loss testing in CI**](https://circuittwin.ai/guides/lora-subghz-packet-loss-per-ci)                  | Inject 45 dB path fades and seeded packet errors between two LoRa nodes and verify retransmission backoff in CI.                                                  | nucleo-l476rg , nucleo-h743zi2       |
| [**GNSS UBX and NMEA fix-loss and checksum fault testing**](https://circuittwin.ai/guides/gnss-ubx-fix-loss-spoof-testing)                | Drop GNSS fix validity or corrupt UBX checksums mid-mission and verify clean failsafe transition in headless CI.                                                  | nucleo-h743zi2 , nucleo-f767zi       |

## Compliance & Verification (10)

| Guide                                                                                                                                       | Summary                                                                                                                                                   | Targets                        |
| ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| [**EU Cyber Resilience Act (CRA) firmware testing evidence**](https://circuittwin.ai/guides/eu-cra-firmware-testing-evidence)               | Support EU Cyber Resilience Act vulnerability-handling and verification documentation with reproducible, SHA-256-hashed firmware twin runs in CI.         | b-u585i-iot02a , nucleo-l552ze |
| [**ISO 26262 firmware fault-injection & traceability support**](https://circuittwin.ai/guides/iso-26262-firmware-verification)              | Run deterministic fault-injection matrices and branch/line coverage exports on compiled automotive MCU binaries in CI.                                    | nucleo-h743zi2 , nucleo-f767zi |
| [**DO-178C firmware testing and traceability workflows**](https://circuittwin.ai/guides/do-178c-firmware-traceability)                      | Shift requirements-based firmware testing and fault-response checks left onto deterministic digital twins before target-hardware rig time.                | nucleo-h743zi2 , nucleo-f767zi |
| [**FDA Section 524B medical device firmware testing support**](https://circuittwin.ai/guides/fda-524b-medical-device-cybersecurity-testing) | Automate sensor fault-handling, watchdog recovery and security-patch regression testing on compiled medical-device MCU binaries with traceable artifacts. | nucleo-l476rg , nucleo-l552ze  |
| [**IEC 62443-4-2 industrial security robustness testing**](https://circuittwin.ai/guides/iec-62443-4-2-embedded-security-testing)           | Verify industrial gateway firmware rejects malformed Ethernet, Modbus RTU and CAN frames without HardFaults or watchdog locks.                            | nucleo-f767zi , nucleo-h743zi2 |
| [**IEC 62304 Class C medical firmware anomaly testing**](https://circuittwin.ai/guides/iec-62304-class-c-firmware-verification)             | Exercise every alarm state and sensor-fault mitigation on your real compiled MCU binary on every pull request.                                            | nucleo-l476rg , nucleo-l552ze  |
| [**IEC 61508 SIL-3 diagnostic coverage fault testing**](https://circuittwin.ai/guides/iec-61508-sil3-diagnostic-coverage)                   | Verify your Flash CRC self-test, watchdog window and dual-channel sensor discrepancy checks fire every time a fault is injected.                          | nucleo-f446re , s32k144-evb    |
| [**EN 50128 deterministic railway firmware regression**](https://circuittwin.ai/guides/en-50128-railway-firmware-regression)                | Guarantee identical execution traces across every test run with pinned seeds, offline execution and SHA-256 artifact manifests.                           | nucleo-h743zi2 , s32k144-evb   |
| [**Pairing MISRA C static checks with runtime ELF fault CI**](https://circuittwin.ai/guides/misra-c-runtime-fault-verification)             | Static analysis checks C syntax and undefined behavior. Digital twin CI catches wrong register masks, unclocked buses and sensor hangs.                   | nucleo-f411re , nucleo-f767zi  |
| [**Generating SHA-256 provenance and JUnit audit bundles**](https://circuittwin.ai/guides/sha256-provenance-audit-bundles)                  | Turn every CI firmware run into a self-contained JSON and JUnit record pinned to exact ELF, board and twin SHA-256 digests.                               | nucleo-f767zi , b-u585i-iot02a |

## Pair guides with live catalogs

[Board & MCU twins](https://circuittwin.ai/boards) [Sensor & bus IC twins](https://circuittwin.ai/twins) [Compare firmware simulators](https://circuittwin.ai/compare)

> ## Run your first firmware suite in under 5 minutes
>
> Install the ct CLI or add circuittwin/action@v1 to your pipeline and run your compiled ELF against deterministic board and sensor twins.
>
> [Start now](https://app.circuittwin.ai/try) [Read the quickstart](https://circuittwin.ai/docs/quickstart) [Connect a coding agent](https://circuittwin.ai/docs/agents)
