RTOS & Firmware Stacks

# Eclipse ThreadX deterministic RTOS CI

Verify ThreadX preemption-threshold scheduling, byte pools and STM32/NXP peripheral drivers without a hardware rack.

Eclipse ThreadX is standard across STM32U5, STM32H7 and Renesas RA projects. Host Linux ports skip PendSV context switching, NVIC interrupt nesting and hardware timer tick accuracy.

Running your compiled ThreadX ELF on CircuitTwin exercises \_tx\_initialize\_low\_level, real Cortex-M33/M7 exception frames and deterministic sensor error injection on every pull request.

## ThreadX CI checks

| Component                  | Behavior checked                          | Common regression                                               |
| -------------------------- | ----------------------------------------- | --------------------------------------------------------------- |
| tx\_initialize\_low\_level | SysTick/PendSV vectors and RAM pool start | Linker symbol \_\_RAM\_segment\_used\_end\_\_ overlapping stack |
| Priority inheritance       | TX\_INHERIT mutex under contention        | Deadlock when high-priority sensor task blocks                  |
| Event flags & queues       | ISR-to-thread signaling                   | Missing tx\_thread\_interrupt\_control around shared state      |

## Local CLI workflow

Shell - run ThreadX ELF on STM32U5 twin

```
ct run --json --board b-u585i-iot02a build/threadx_app.elf
```

## Suite & fault configuration

tests/threadx.suite.yaml

```
version: 1
board: b-u585i-iot02a
firmware: build/threadx_app.elf
tests:
  - name: threadx-sensor-queue-and-nack
    timeout_ms: 3000
    faults:
      - at_ms: 250
        bus: I2C2
        kind: nack
        address: 0x6A
        count: 3
    expect:
      console_contains: "TX_APP_HEALTHY"
      exit_code: 0
```

## CI pipeline integration

.github/workflows/threadx-ci.yml

```
name: Eclipse ThreadX Twin CI
on: [push, pull_request]
jobs:
  threadx:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: cmake --build build
      - uses: circuittwin/action@v1
        with:
          suite: tests/threadx.suite.yaml
```

## Troubleshooting checklist

| Symptom                                     | Fix                                                                                                      |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Crash immediately after tx\_kernel\_enter() | Verify PendSV\_Handler and SysTick\_Handler link to ThreadX assembly handlers rather than CubeHAL stubs. |
| Byte pool allocation fails at runtime       | Inspect TX\_BYTE\_POOL size and unused RAM boundary in the linker map file.                              |

## Frequently asked questions

| Question                                                       | Answer                                                                                                              |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Does CircuitTwin support STM32U5 and STM32H7 ThreadX binaries? | Yes. Both B-U585I-IOT02A (STM32U585 Cortex-M33) and NUCLEO-H743ZI2 (STM32H743 Cortex-M7) run ThreadX ELFs natively. |

## Related boards & component twins

[Board: b-u585i-iot02a](https://circuittwin.ai/boards/b-u585i-iot02a) [Board: nucleo-h743zi2](https://circuittwin.ai/boards/nucleo-h743zi2) [Board: ek-ra6m5](https://circuittwin.ai/boards/ek-ra6m5) [Twin: LSM6DSO](https://circuittwin.ai/twins/lsm6dso) [Twin: LSM6DSOX](https://circuittwin.ai/twins/lsm6dsox) [Twin: W25Q128JV](https://circuittwin.ai/twins/w25q128jv) [Determinism & suites](https://circuittwin.ai/docs/testing)

## More in RTOS & Firmware Stacks

[Zephyr RTOS CI without hardware benches](https://circuittwin.ai/guides/zephyr-rtos-ci-without-hardware) [FreeRTOS headless testing in CI](https://circuittwin.ai/guides/freertos-headless-testing) [ESP-IDF CI simulation for ESP32, S3 & C3](https://circuittwin.ai/guides/esp-idf-ci-simulation) [PX4 Pixhawk 6C simulation on real ARM ELF](https://circuittwin.ai/guides/px4-pixhawk-6c-simulation)

> ## Run this workflow on your own ELF
>
> Start free on CircuitTwin to run local board twins, fault matrices and CI checks with zero per-run credits.
>
> [Start now](https://app.circuittwin.ai/try) [Read the quickstart](https://circuittwin.ai/docs/quickstart) [Connect a coding agent](https://circuittwin.ai/docs/agents)
