RTOS & Firmware Stacks

Apache NuttX RTOS boot and driver CI

Execute real Apache NuttX nuttx ELFs in CI to verify NSH startup, POSIX /dev sensor drivers and board pinmux changes.

NuttX sim builds run on Linux host threads and skip STM32/RP2040 board bring-up, GPIO alternate functions and SPI/I2C character drivers.

Running the cross-compiled nuttx ELF on CircuitTwin boots into NSH over virtual UART, mounts virtual I2C/SPI devices under /dev, and verifies driver ioctl error paths deterministically.

NuttX subsystems tested on twins

NuttX subsystemVerification targetRegression caught
NSH consoleSerial login prompt nsh>Broken up_earlyserialinit() or clock prescaler
/dev/i2c0 & /dev/spi0Sensor register probingWrong Kconfig pin alternate function or bus speed
OSTestPOSIX pthread/sem/timer kernel suiteSysTick or PendSV priority misconfiguration

Local CLI workflow

Shell - run NuttX ELF on STM32F4 twin
ct run --json --board stm32f4-discovery --timeout-ms 4000 nuttx

Suite & fault configuration

tests/nuttx.suite.yaml
version: 1
board: stm32f4-discovery
firmware: nuttx
tests:
  - name: nsh-boot-and-sensor-probe
    timeout_ms: 4000
    expect:
      console_contains: "nsh>"
      exit_code: 0

CI pipeline integration

.github/workflows/nuttx-ci.yml
name: Apache NuttX Twin CI
on: [push, pull_request]
jobs:
  nuttx:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: make -j
      - uses: circuittwin/action@v1
        with:
          suite: tests/nuttx.suite.yaml

Troubleshooting checklist

SymptomFix
Boot stops before nsh> promptCheck CONFIG_STM32_USART2_SERIAL_CONSOLE and HSE crystal frequency in board.h.
Exit code 4 on unmodelled USB/OTG initDisable unused USB console in defconfig or isolate serial console tests.

Frequently asked questions

QuestionAnswer
Does CircuitTwin run PX4 NuttX binaries as well as upstream Apache NuttX?Yes. Both upstream Apache NuttX and PX4 NuttX ELF builds run directly on supported STM32, RP2040 and ESP32 board twins.

Related boards & component twins

More in RTOS & Firmware Stacks