Fault Injection & Debugging

Seeded LoRa and sub-GHz RF packet-loss testing in CI

Inject 45 dB path fades and seeded packet errors between two LoRa nodes and verify retransmission backoff in CI.

Sub-GHz LoRaWAN and custom SX1262/SX1276/SX1280 protocols fail in the field when ACK packets drop during deep fades or drivers poll SPI while the radio BUSY pin is still high.

CircuitTwin radio scenes model time-on-air to 1 ns, Friis link budgets, BUSY-pin gating and seeded PER determinism (accuracy/radio-twins-2026-11-14.json) so two real MCU ELFs test link recovery automatically.

Radio twin acceptance behaviors

BehaviorModelled fidelityBug caught
Time-on-Air (ToA)Exact LoRa SF/BW/CR formula to 1 nsPremature RX window close before preamble arrives
BUSY pin gatingSX1280/SX1262 command busy holdSPI write dropped because firmware skipped BUSY poll
Seeded attenuationattenuation_db fault at fixed msInfinite retry loop or missed ADR backoff

Local CLI workflow

Shell - run two-node LoRa fade test
ct test run --json --junit results/lora.xml tests/lora-fade.suite.yaml

Suite & fault configuration

tests/lora-fade.suite.yaml
version: 1
scene: scenes/sx1276-two-node.scene.json
tests:
  - name: lora-45db-fade-retransmit
    seed: 42
    timeout_ms: 6000
    faults:
      - at_ms: 400
        link: rf0
        kind: attenuation_db
        delta_db: 45.0
        duration_ms: 1000
    expect:
      console_contains: "RETRANSMIT_ACK_OK"
      exit_code: 0

CI pipeline integration

.github/workflows/lora-ci.yml
name: LoRa Link Recovery CI
on: [push, pull_request]
jobs:
  lora:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: circuittwin/action@v1
        with:
          suite: tests/lora-fade.suite.yaml

Troubleshooting checklist

SymptomFix
SX1280/SX1262 ignores SetTx commandWait for the BUSY pin to go low before asserting NSS on every opcode transaction.
RX node never triggers RxDone IRQVerify both nodes configure matching sync word, spreading factor, bandwidth and IQ inversion.

Frequently asked questions

QuestionAnswer
Which radio transceivers have published acceptance records in CircuitTwin?Semtech SX1276 and SX1280 have published clean-tree radio-twin acceptance records under /docs/accuracy, alongside corpus definitions for SX1262, CC1101 and nRF24L01+.

Related boards & component twins

More in Fault Injection & Debugging