Fault Injection & Debugging
GNSS UBX and NMEA fix-loss and checksum fault testing
Drop GNSS fix validity or corrupt UBX checksums mid-mission and verify clean failsafe transition in headless CI.
Navigation parsers frequently crash or feed zeroed latitude/longitude into controllers when a tunnel drops fixType from 3D (3) to No Fix (0) or truncates a UBX-NAV-PVT packet.
CircuitTwin includes u-blox UBX frame modeling (kinds_ubx.rs) so CI can drive trajectories, drop satellite count, and inject UART dropouts deterministically.
GNSS parser fault scenarios
| Fault | UBX / NMEA field | Expected firmware check |
|---|---|---|
Fix loss (tunnel) | UBX-NAV-PVT fixType=0, numSV=2 | Controller rejects stale coordinates and enters failsafe |
Bad Fletcher-8 CRC | Flip CK_A / CK_B on UBX frame | Parser discards packet and re-syncs on 0xB5 0x62 |
UART RX dropout | uart_drop_rx for 2000 ms | GNSS health watchdog flags timeout cleanly |
Local CLI workflow
Shell - run GNSS fix-loss test suite
ct test run --json --junit results/gnss.xml tests/gnss-fixloss.suite.yamlSuite & fault configuration
tests/gnss-fixloss.suite.yaml
version: 1
board: nucleo-h743zi2
firmware: build/nav_ctrl.elf
tests:
- name: ubx-uart-dropout-failsafe
timeout_ms: 4000
faults:
- at_ms: 800
part: neo-m9n
kind: uart_drop_rx
duration_ms: 1500
expect:
console_contains: "GNSS_TIMEOUT_FAILSAFE"
exit_code: 0CI pipeline integration
.github/workflows/gnss-ci.yml
name: GNSS Parser Fault CI
on: [push, pull_request]
jobs:
gnss:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: circuittwin/action@v1
with:
suite: tests/gnss-fixloss.suite.yamlTroubleshooting checklist
| Symptom | Fix |
|---|---|
| Parser stops receiving after one truncated UBX frame | Reset state machine to sync byte 0xB5 whenever payload length exceeds buffer limit or checksum fails. |
Frequently asked questions
| Question | Answer |
|---|---|
| Does CircuitTwin support binary u-blox UBX frames as well as NMEA sentences? | Yes. The u-blox GNSS model supports UBX binary framing (0xB5 0x62 sync + Fletcher checksum) and NMEA sentences over UART. |