Skip to content

A LoRa header raises HeaderValid alone - #5

Merged
A13xB0 merged 2 commits into
mainfrom
header-valid-alone
Oct 14, 2026
Merged

A13xB0 merged 2 commits into
mainfrom
header-valid-alone

Conversation

@A13xB0

@A13xB0 A13xB0 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4.

What this changes

  • The header is raised as HeaderValid alone. SyncWordValid is the GFSK modem's interrupt (DS_SX1261-2, table 13-29: bit 3, FSK); a LoRa receiver reports the header through HeaderValid. This model only has a LoRa data path, so there is no FSK case to keep. The carrier-gone clear drops the bit too, since nothing raises it now.
  • vsx_counters.irq_suppressed says what it counts: one per event, however many of that event's bits were masked.
  • Two comments from HeaderValid waits for the preamble, the SFD and the header block #3 now give the right figures: for MeshCore's 32-symbol preamble the fixed twelve symbols were 32.25 symbols early and left a fifth of the PreambleDetected-to-HeaderValid stretch, not a third. The test comment's sixteen-symbol preamble is the chip's default, not MeshCore's.

No ABI change.

Effect on the #745 figures

Expected, from the per-frame counts in the new test and not yet rerun end to end: on the three-node link (12 packets), 1.17 (IrqMask 0x0276) should count 0 suppressed rather than 12, and 1.16 (0x0272) 12 (PreambleDetected) rather than 24.

Verification

  • STRICT=1 ./build.sh: 7 test binaries, 0 failures. ./build.sh sanitize: 7, 0 failures. STRICT=1 ./build.sh shared: builds.
  • clang-format 18.1.8 --dry-run --Werror include/*.h src/*.h src/*.cpp test/*: clean.
  • New case in test_interrupts.cpp, two frames each: mask 0x0276 leaves irq_suppressed at 0, mask 0x0272 counts exactly 2. Both fail against main.
  • test_reception.cpp now asserts SyncWordValid is clear while HeaderValid is set. Fails against main.

CI

house rules fails on main already: src/VirtualSX1262.h is 512 lines, over the 500 limit, since #2. This PR does not touch that file. consumers are up to date fails until meshcore-native moves its pin.

SyncWordValid is the GFSK modem's interrupt; a LoRa receiver reports its
header through HeaderValid. Raising both made every header count as
suppressed on a firmware that correctly leaves the FSK bit out of its
mask, so MeshCore 1.17, whose receive mask misses nothing on a frame it
takes, reported one suppressed event per packet.

irq_suppressed is documented as one per event rather than one per
masked bit, and the comments on the header timing say how early the old
fixed twelve symbols were for the preamble each one names.
@A13xB0
A13xB0 merged commit f0261f3 into main Oct 14, 2026
7 of 8 checks passed
@A13xB0
A13xB0 deleted the header-valid-alone branch October 14, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SyncWordValid raised with HeaderValid in LoRa mode inflates irq_suppressed

1 participant