Speed up SX1262 profile switching and verify radio lab behavior
Keep TCXO warm during owned dual-profile retunes, batch modulation setup, and enable guarded fast RX with buffered 8 MHz SPI on XIAO S3 WIO and Indicator LoRa. Preserve lifecycle invalidation, packet guards, rollback, and existing scheduling budgets. Add reliable sequence-scoped USB lab transport, native regression coverage, bounded channel and preamble diagnostics, and byte-exact measurement records including failed experiments and qualification limits.
This commit is contained in:
1 parent
25eab1a581
commit
bd30388436
90 files changed
+146200
-20
No files matched your search
@@ -0,0 +1,170 @@
|
||||
# Off-channel preamble investigation
|
||||
|
||||
Measured 2026-09-14. **The SF8 off-channel preamble indication reproduces with
|
||||
a stationary, fully initialized receiver, without profile hopping or fast RX
|
||||
reuse.** Both boards reproduce it when their transmitter/receiver roles are
|
||||
reversed. This is evidence of transmitter-associated off-channel detection in
|
||||
this close-range bench setup, not evidence that the channel jump needs more
|
||||
settling time.
|
||||
|
||||
The earlier SF8 scan's long software guard explains its missed listening
|
||||
opportunity. The earlier SF6 scan miss remains unresolved: its trace had no
|
||||
preamble indication or guard hold. No production guard or acquisition policy
|
||||
was changed during this investigation.
|
||||
|
||||
## Controlled experiment
|
||||
|
||||
- XIAO ESP32-S3 + WIO SX1262 (COM31) and SenseCAP Indicator ESP32-S3 LoRa
|
||||
(COM28). The Indicator RP2040 and RAK4631 were not modified.
|
||||
- Receiver fixed at 910.000 MHz. Transmitter silent, on frequency, or offset
|
||||
by +/-250, +/-500 or +/-1,000 kHz. These are offsets, not bandwidths.
|
||||
- 125 kHz bandwidth, SF8 or SF6, CR4/5, 32 programmed preamble symbols,
|
||||
-9 dBm, one 16-byte sequence-tagged synthetic payload per transmitting case.
|
||||
- Each case fully initializes both radios. RX uses ordinary `startReceive()`;
|
||||
profile-switch optimization and experimental omission masks are disabled.
|
||||
Buffered 8 MHz SPI remains enabled. No hops, warm-retune reuse, CAD, or
|
||||
`isReceiving()` software guard runs during these controls.
|
||||
- TX is prepared before RX is armed. Each receive window lasts 450 ms;
|
||||
all eight cases are shuffled within each balanced round, seed 814910.
|
||||
The full RX window completes even when an off-frequency packet is not
|
||||
received, as expected. An on-frequency positive-control failure stops the
|
||||
experiment. No RF retransmissions are used to repair a result.
|
||||
- The HAL records actual outgoing `SetRfFrequency` bytes on both boards,
|
||||
and the frequency word present at `SetTx`. The host verifies these words
|
||||
against the requested frequencies. This checks commands sent to the chip,
|
||||
not an independent measurement of the emitted RF spectrum.
|
||||
- Existing IRQ replies are observed and IRQs additionally polled at a nominal
|
||||
64 us interval. Events are buffered in RAM; timestamps are software
|
||||
observations, not synchronized RF arrival times. Unknown payload contents
|
||||
are not exported.
|
||||
|
||||
The three completed matrices contain **128 windows: 112 transmitted probes
|
||||
and 16 silent controls**. A separate initial 450 ms receiver-only smoke check
|
||||
was also performed. These are bounded diagnostic controls, not another
|
||||
100-packets-per-channel capacity sweep.
|
||||
|
||||
## Results
|
||||
|
||||
Entries below are windows with a preamble indication / tested windows. Each
|
||||
positive window reported one indication; latched IRQs do not count continuous
|
||||
detector activity or prove a valid packet.
|
||||
|
||||
| Transmitter offset | SF8, XIAO RX | SF8, Indicator RX | SF6, XIAO RX |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| Silent | 0/8 | 0/4 | 0/4 |
|
||||
| On frequency | 8/8 | 4/4 | 4/4 |
|
||||
| -250 kHz | 8/8 | 4/4 | 1/4 |
|
||||
| +250 kHz | 8/8 | 4/4 | 0/4 |
|
||||
| -500 kHz | 5/8 | 3/4 | 0/4 |
|
||||
| +500 kHz | 1/8 | 3/4 | 0/4 |
|
||||
| -1,000 kHz | 5/8 | 4/4 | 0/4 |
|
||||
| +1,000 kHz | 5/8 | 3/4 | 0/4 |
|
||||
|
||||
All **16 on-frequency probes delivered valid payloads**. None of the 96
|
||||
off-frequency probes delivered a valid payload. No silent control detected a
|
||||
preamble. Completed windows ended in RX mode with zero device errors; there
|
||||
were no foreign valid payloads or trace overflows.
|
||||
|
||||
Most off-frequency detections stopped at `PreambleDetected` (0x0004). Four
|
||||
progressed further but failed CRC (`seen_irq=0x0056`: preamble, header, RxDone,
|
||||
CRC error): two at +250 kHz with XIAO RX, and one each at +250 and +1,000 kHz
|
||||
with Indicator RX. Therefore **HeaderValid alone would not prove that these
|
||||
off-frequency indications are legitimate traffic**.
|
||||
|
||||
In forward SF8 on-frequency controls, instantaneous RSSI at the first preamble
|
||||
was -42 to -41 dBm; at +/-250 kHz it was -91 to -88 dBm. These are instantaneous
|
||||
receiver readings, not calibrated measurements of transmitted leakage or a
|
||||
sensitivity test. Board positions and attenuation were not systematically
|
||||
varied. Reversing roles reproduces the behavior but does not isolate its
|
||||
physical path.
|
||||
|
||||
## What this explains
|
||||
|
||||
The [earlier SF8 four-channel scan](sf8_5p1_trace_validation.md) missed probe
|
||||
13 on 910.250 MHz after detecting a bare preamble while tuned to 910.000 MHz.
|
||||
The existing `CustomSX1262::isReceiving()` guard allowed 91 ms for preamble
|
||||
progression, consistent with the observed 92.257 ms from first preamble
|
||||
observation to the stale-bit clear. That produced approximately 102 ms total
|
||||
occupancy on the wrong channel and a 135.145 ms target-channel revisit gap.
|
||||
The programmed 32-symbol preamble lasted only 65.536 ms.
|
||||
|
||||
The delayed retune itself took 550 us. These controls reproduce the suspect
|
||||
off-frequency indication with no retunes at all. Together the evidence
|
||||
supports **off-channel acquisition plus a long guard hold** as the SF8
|
||||
failure mechanism, rather than slow SPI or a demonstrated need for a longer
|
||||
post-jump delay. It does not independently prove the RF source of that one
|
||||
historical scan event.
|
||||
|
||||
The controlled-transmitter association and quiet silent controls make random
|
||||
ambient RF alone an inadequate explanation of the repeated bench result.
|
||||
Exact RF cause remains unmeasured: receiver selectivity/false acquisition,
|
||||
transmitter spectral leakage, and coupling between the nearby boards are
|
||||
not separated by these tests. No spectrum-analyzer capture or calibrated
|
||||
attenuation sweep was performed. Increasing channel spacing is not established
|
||||
as a fix: SF8 indications also occurred at +/-1 MHz.
|
||||
|
||||
The [earlier SF6 miss](sf6_5p1_trace_validation.md) had no observed nonzero IRQ
|
||||
or guard hold. The four successful stationary SF6 positive controls show the
|
||||
fixed-channel link works, but do not establish the acquisition time needed
|
||||
after a retune. These small, differently sized samples are not packet-error
|
||||
rate estimates or proof of a zero-loss channel count.
|
||||
|
||||
## Follow-up candidates, not implemented fixes
|
||||
|
||||
Semtech documents that false LoRa detections can occur and describes
|
||||
`SetLoRaSymbNumTimeout` as validating reception over multiple symbols before
|
||||
continuing when the modem locks. This is a candidate to investigate, not a
|
||||
drop-in verified fix. Its behavior in continuous RX and through each retune
|
||||
must be measured. See section 13.4.9, page 99 of the
|
||||
[Semtech SX1261/2 datasheet, revision 2.2](https://resource.heltec.cn/download/WiFi_LoRa_32_V4/datasheet/SX1261_2%20V2-2.pdf).
|
||||
|
||||
Useful next experiments would qualify/revalidate preambles before granting a
|
||||
long scan hold, and repeat the controls with lower signal levels or increased
|
||||
physical isolation. Any candidate must preserve legitimate weak signals and
|
||||
long preambles. Blindly shortening the current guard, or requiring only a
|
||||
header indication, is not justified by these results. No production radio
|
||||
change was made in this diagnostic turn.
|
||||
|
||||
## Reproduction, provenance, and checks
|
||||
|
||||
See the [stationary diagnostic instructions](../tools/hil/profile_switch_README.md#stationary-off-channel-preamble-controls).
|
||||
The same diagnostic firmware binaries were used for all three matrices.
|
||||
Base commit `c329cf1fc1e7f2e8c8733ab0d000094730458fe3` plus local changes;
|
||||
RadioLib 7.7.1 at `187ef24791c3d844939b2be13a68bd890bd04e4c`, Espressif32
|
||||
6.11.0 / Arduino ESP32 2.0.17. Both HIL targets built and uploaded successfully.
|
||||
All **29 selected host/native tests passed** after testing.
|
||||
|
||||
Raw results and SHA-256:
|
||||
|
||||
- [Forward SF8, eight rounds](../tools/hil/preamble_stationary_sf8_results.json):
|
||||
`e876a8b1727c5584aa67cb4fcdcae5ca30701e90f7ed998b5df36c37d245f7b0`
|
||||
- [Reverse SF8, four rounds](../tools/hil/preamble_stationary_sf8_reverse_results.json):
|
||||
`83b576544f807c6b81ee83a7db487137ef2584cb4981e475c7e7ac50e4fa2363`
|
||||
- [Forward SF6, four rounds](../tools/hil/preamble_stationary_sf6_run2_results.json):
|
||||
`bdb65b4e23d8b05c8523cec092533509021f878518a38523b02135b810da991b`
|
||||
- [Aborted initial SF6 launch](../tools/hil/preamble_stationary_sf6_results.json)
|
||||
is retained: no trials and no RF probes. A host reboot-command quoting
|
||||
failure left the diagnostic image unready after the preceding run. After
|
||||
correcting the command and rebooting both boards, the complete SF6 matrix
|
||||
was recorded to the separate `run2` path. A subsequent host cleanup change
|
||||
ensures an already-opened receiver port is closed if opening TX fails.
|
||||
|
||||
Tested firmware SHA-256:
|
||||
|
||||
- XIAO: `f89da2a2e542df481ff6c26d2492dcc46db8794b5549d3b4f73217767130a21d`
|
||||
- Indicator: `e58207c7e63de625bee2d4e4400eb934b2737f51e8babc7c1fddd85c48efdda6`
|
||||
|
||||
## Device handoff
|
||||
|
||||
Fresh full 8 MiB backups were taken and separately verified before flashing,
|
||||
in the private current-user MeshCore backup directory. No backup contents
|
||||
or identity/channel secrets are in the diagnostic results.
|
||||
|
||||
- XIAO backup: `5e5825b625a0e6ded65aafa72658eb3b15b466316a9efe8239b2f09de9418e63`
|
||||
- Indicator backup: `6f834296d4e29e4fe17297aad0a9e2bf2adcf0a1391cf645de1bc51aebfd70de`
|
||||
|
||||
Both original images were restored after the controls, separately verified
|
||||
against the complete 8 MiB flash with matching digests, and hardware-reset.
|
||||
The RAK4631 and Indicator RP2040 were untouched; the XIAO soak logger was not
|
||||
restarted. The temporary HIL build overlay was removed. Investigation source,
|
||||
tests, and results were initially handed off locally before publication.
|
||||
@@ -0,0 +1,424 @@
|
||||
# SX1262 profile-switch validation
|
||||
|
||||
Measured locally on 2026-09-13 using an XIAO ESP32-S3 with WIO SX1262.
|
||||
Later tests also use the SenseCAP Indicator ESP32-S3 LoRa processor. The
|
||||
[V8 integration](#production-integration-and-usb-recovery-v8) is the current
|
||||
implementation; V1-V7 sections/captures document the development history.
|
||||
|
||||
## Initial result (V1)
|
||||
|
||||
The production retune path averaged **1.434 ms with XOSC held**, versus
|
||||
**3.166 ms with RC standby**. Holding the oscillator saved **1.732 ms per
|
||||
retune (54.7%)**. Warm-mode maximum was **1.467 ms** across 6,000 measured
|
||||
retunes. The 6 ms switch allowance and 4 ms loop allowance are unchanged.
|
||||
|
||||
Each row combines both directions and two reversed-order trials, with 2,000
|
||||
measured retunes per standby policy. Times run from production `tuneProfile`
|
||||
entry until BUSY is observed low. GetStatus confirmed RX after every timed hop.
|
||||
|
||||
| Secondary profile | RC mean / maximum | XOSC mean / maximum |
|
||||
| --- | --- | --- |
|
||||
| SF7 / 500 kHz | 3.161 / 3.199 ms | 1.434 / 1.467 ms |
|
||||
| SF8 / 500 kHz | 3.166 / 3.209 ms | 1.435 / 1.464 ms |
|
||||
| SF9 / 500 kHz | 3.171 / 3.193 ms | 1.433 / 1.437 ms |
|
||||
|
||||
- Primary: 909.5 MHz, SF7 / 62.5 kHz, CR 4/5.
|
||||
- Secondary: 910.5 MHz, CR 4/5, automatic production preamble calculation.
|
||||
- TCXO configuration remained 1.8 V and 1,600 us startup delay.
|
||||
- 12,000 measured retunes; zero retune failures, BUSY timeouts, or RX-mode errors.
|
||||
- 109 packet/busy deferrals were excluded from hop timings (57 RC, 52 XOSC).
|
||||
Deferral preserves the existing packet and radio ownership checks.
|
||||
- The first eight successful hops of every trial were excluded from
|
||||
steady-state statistics, including the initial oscillator transition.
|
||||
- All 12 trials returned to RC standby after disabling the second profile.
|
||||
|
||||
## Scope and reproducibility
|
||||
|
||||
The [timing harness](../tools/hil/profile_switch_README.md) compiles the actual
|
||||
production wrapper, not the earlier fast/minimal RX benchmark. RC and XOSC
|
||||
use the same executable: the baseline changes only the standby policy after
|
||||
entering dual-profile mode. No TCXO supply or initial startup delay is disabled.
|
||||
The normal guard checks and frequency/SF/BW/CR/preamble setters remain active.
|
||||
|
||||
This isolates radio switching from UI, Wi-Fi, BLE, mesh dispatch, and scan-loop
|
||||
scheduling. BUSY polling/timer overhead is included; the RX status query is
|
||||
outside the timing. This is not a packet-delivery test, first-startup timing,
|
||||
power measurement, wide-frequency image-recalibration test, or proof of analog
|
||||
RF settling beyond BUSY/RX status. Indicator I/O-expander latency and nRF52
|
||||
timing still need their own measurements before reducing common budgets.
|
||||
|
||||
Raw results: [profile_switch_results.json](../tools/hil/profile_switch_results.json).
|
||||
The collector requires all requested samples, zero failure/timeout/mode-error
|
||||
counts, and successful RC restoration before accepting a trial.
|
||||
|
||||
Build provenance:
|
||||
|
||||
- Base commit: `c329cf1fc1e7f2e8c8733ab0d000094730458fe3`, with the local warm-standby patch.
|
||||
- Environment: `profile_switch_xiao`; Espressif32 6.11.0 / Arduino 2.0.17.
|
||||
- RadioLib: pinned `187ef24791c3d844939b2be13a68bd890bd04e4c` (7.7.1).
|
||||
- Test `firmware.bin` SHA-256:
|
||||
`629d39bba80ad97c434fbaab61bc7c3c302b5ac8180cb2cb12806508b2d111e0`.
|
||||
- Existing unrelated Companion/repeater/Wi-Fi soak changes were not included
|
||||
in this minimal timing executable.
|
||||
|
||||
Host regression checks also passed: profile scan/CLI (3 tests), receive contract
|
||||
(2 tests), and SX126x RX-status decoding (1 test). A normal
|
||||
`heltec_v4_companion_radio_usb` build and the XIAO timing build succeeded.
|
||||
|
||||
The XIAO's original 8 MiB flash snapshot was verified against the device while
|
||||
held in the bootloader before the timing firmware was uploaded. Raw flash
|
||||
backups stay in the current user's private backup directory, outside Git.
|
||||
After testing, the entire original snapshot was restored and verified again
|
||||
against the device before reboot. The live USB CLI then confirmed `Xiao S3 WIO`
|
||||
running `v1.17.1-soak-xiao-B` (11-Sep-2026). Its soak logger was left stopped;
|
||||
existing logs were preserved. The Indicator and RAK Tag were not flashed.
|
||||
|
||||
## Follow-up: batched modulation
|
||||
|
||||
On the same date, a second 12,000-retune experiment held XOSC warm in both
|
||||
cases and compared the old three-setter sequence with one combined LoRa
|
||||
modulation update. Both paths ran in the same V2 executable, with the second
|
||||
round reversing their order. Each mode completed 6,000 timed hops.
|
||||
|
||||
| Secondary profile | Separate setters: mean / maximum | Batched: mean / maximum |
|
||||
| --- | --- | --- |
|
||||
| SF7 / 500 kHz | 1.442 / 1.473 ms | 1.159 / 1.198 ms |
|
||||
| SF8 / 500 kHz | 1.444 / 1.480 ms | 1.158 / 1.192 ms |
|
||||
| SF9 / 500 kHz | 1.446 / 1.478 ms | 1.156 / 1.163 ms |
|
||||
|
||||
Overall: **1.444 ms to 1.158 ms**, saving **0.286 ms (19.8%)** per retune.
|
||||
Use this matched V2 baseline for the batching comparison; the earlier V1
|
||||
warm-standby numbers came from a different executable layout.
|
||||
|
||||
There were zero retune failures, BUSY timeouts, RX-mode errors, or SF/BW/CR
|
||||
cache mismatches. All 12 trials restored RC standby after disabling profile 2.
|
||||
84 packet/busy deferrals were excluded (54 separate-setter, 30 batched).
|
||||
First eight successful hops per trial were excluded as before.
|
||||
|
||||
The batching removes two repeated modem checks and two modulation writes.
|
||||
The helper validates a complete MeshCore bandwidth/SF/CR tuple, updates
|
||||
RadioLib's cached SF/BW/CR before its automatic LDRO calculation, and restores
|
||||
the old cache if the command fails. The wrapper's existing physical rollback
|
||||
and safe-transition paths are retained. **Frequency changes, preamble updates,
|
||||
standby, IRQ/buffer setup, packet parameters, and RX restart remain unchanged.**
|
||||
This does not qualify eliminating those other repeated operations.
|
||||
|
||||
Raw results: [profile_switch_batch_results.json](../tools/hil/profile_switch_batch_results.json).
|
||||
V2 test firmware SHA-256:
|
||||
`b4403f6f5eb0a2b0a31c2d79859122225f247296699a578ad2596ef17eaed0fd`.
|
||||
Toolchain and RadioLib pin match the first experiment. The normal
|
||||
`heltec_v4_companion_radio_usb` build also succeeded with batching enabled.
|
||||
|
||||
The two new host tests execute the production method over 1,200 valid
|
||||
bandwidth/SF/CR/LDRO combinations, invalid inputs and wrong modem, command
|
||||
failures with cache rollback/retry, and the wrapper's failure short-circuit.
|
||||
All eight relevant host tests passed. RF packet delivery and application/UI
|
||||
scheduling remain outside this timing experiment; shared budgets are unchanged.
|
||||
|
||||
## Expanded screening: redundant RX setup and SPI (V5)
|
||||
|
||||
Corrected V5 measurements on 2026-09-13 cover **28,800 timed retunes in 300
|
||||
trials** across XIAO S3/WIO SX1262 and the Indicator ESP32/SX1262. Each sweep
|
||||
uses SF7/8/9 at 500 kHz paired with SF7/62.5 kHz, both directions, reversed
|
||||
case order in round two, and eight excluded initial hops per trial.
|
||||
All 300 trials completed their sample count and restored RC standby on exit.
|
||||
There were **zero timed switch failures, BUSY timeouts, RX-mode errors or
|
||||
SF/BW/CR cache mismatches**. The normal packet guards deferred 175 attempted
|
||||
hops; these were not counted as timed retunes.
|
||||
|
||||
Twenty-one distinct cases were screened: seven individual redundant-operation
|
||||
changes, a full manual RX control, combinations, 2/4/8 MHz SPI and whole-buffer
|
||||
ESP32 SPI transfers. Shared controls appear in both groups. All new shortcuts
|
||||
are **HIL-only**, not included in normal targets.
|
||||
|
||||
### Individual and combined RX changes
|
||||
|
||||
Means in milliseconds, with warm oscillator and batched modulation throughout.
|
||||
Each XIAO row has 768 timed hops; each Indicator row has 384.
|
||||
|
||||
| RX/SPI case | XIAO mean | Indicator mean |
|
||||
| --- | ---: | ---: |
|
||||
| Production batching, 2 MHz SPI | 1.182 | 15.190 |
|
||||
| Manual RX sequence, no omissions | 1.181 | 15.135 |
|
||||
| Skip second standby | 1.124 | 14.195 |
|
||||
| Skip repeated IRQ setup | 1.096 | 14.399 |
|
||||
| Skip repeated buffer-base setup | 1.146 | 14.437 |
|
||||
| Skip repeated packet-parameter setup | 0.991 | 12.364 |
|
||||
| Skip RX modem query | 1.145 | 14.427 |
|
||||
| Defer preamble to the one RX packet-parameter write | 0.956 | 11.659 |
|
||||
| Skip wake NOP when already awake | 1.146 | 14.576 |
|
||||
| Combined omissions, early preamble write | 0.771 | 9.096 |
|
||||
| Combined omissions, deferred preamble | 0.732 | 8.384 |
|
||||
| 4 MHz SPI only | 0.985 | 14.996 |
|
||||
| 8 MHz SPI only | 0.889 | 14.889 |
|
||||
| Combined/deferred, 4 MHz SPI | 0.627 | 8.280 |
|
||||
| Combined/deferred, 8 MHz SPI | 0.579 | 8.224 |
|
||||
|
||||
The largest individual saving is programming preamble/packet parameters once.
|
||||
Compare individual omissions with the manual full control when attributing
|
||||
their isolated costs: replacing RadioLib's staging dispatch also has overhead.
|
||||
Individual savings are not additive; some remove overlapping work.
|
||||
|
||||
### Whole-buffer SPI follow-up (same V5 binaries)
|
||||
|
||||
| Case | XIAO mean / maximum | Indicator mean / maximum |
|
||||
| --- | --- | --- |
|
||||
| Production batching, byte loop, 2 MHz | 1.184 / 1.221 ms | 15.185 / 15.785 ms |
|
||||
| Bulk transfer only, 2 MHz | 1.070 / 1.073 ms | 15.092 / 15.134 ms |
|
||||
| Bulk transfer only, 4 MHz | 0.890 / 0.903 ms | 14.924 / 14.983 ms |
|
||||
| Bulk transfer only, 8 MHz | 0.797 / 0.806 ms | 14.836 / 14.908 ms |
|
||||
| Combined/deferred, byte loop, 8 MHz | 0.579 / 0.588 ms | 8.222 / 8.843 ms |
|
||||
| Combined/deferred + bulk, 2 MHz | 0.671 / 0.700 ms | 8.369 / 9.027 ms |
|
||||
| Combined/deferred + bulk, 4 MHz | 0.582 / 0.595 ms | 8.252 / 8.315 ms |
|
||||
| Combined/deferred + bulk, 8 MHz | **0.535 / 0.545 ms** | **8.203 / 8.233 ms** |
|
||||
|
||||
The fastest XIAO candidate saves **0.649 ms (54.8%)** versus that sweep's
|
||||
already-warm, already-batched production control. At 8 MHz, bulk transfers
|
||||
alone add about 0.043 ms of benefit to the combined RX shortcut. The Indicator
|
||||
remains dominated by I2C-mediated chip-select/BUSY/DIO access; the final bulk
|
||||
step improves its combined mean by only 0.019 ms. Small HAL effects varied
|
||||
between executable layouts in preliminary screens; do not generalize them.
|
||||
|
||||
**The Indicator exceeds the generic 6 ms switch allowance even in its fastest
|
||||
experimental path.** These are board measurements, not a justification for
|
||||
reducing the shared 6 ms switch / 4 ms loop constants. Indicator scheduling
|
||||
and effective preambles need board-specific treatment before a production
|
||||
rollout. Application/display/network scheduling is still excluded here.
|
||||
|
||||
Raw accepted sweeps:
|
||||
|
||||
- [XIAO RX cases](../tools/hil/profile_switch_v5_rx_xiao_complete.json)
|
||||
- [Indicator RX cases](../tools/hil/profile_switch_v5_rx_indicator.json)
|
||||
- [XIAO bulk SPI](../tools/hil/profile_switch_v5_bulk_xiao.json)
|
||||
- [Indicator bulk SPI](../tools/hil/profile_switch_v5_bulk_indicator.json)
|
||||
|
||||
### Test corrections and provenance
|
||||
|
||||
V3/V4 broad screening accidentally called `SX1262::startReceive()` instead of
|
||||
`CustomSX1262::startReceive()` in the fallback, omitting MeshCore's extra
|
||||
preamble-detection IRQ flag. Their raw files are marked superseded and are
|
||||
not included in the counts or conclusions above. The V4 packet sweep was
|
||||
stopped on discovery. V5 preserves that flag in both normal and manual RX
|
||||
paths; a host regression test checks the Custom fallback and mapped flags.
|
||||
The earlier V1/V2 warm/batching experiments did not use that experimental
|
||||
subclass and are unaffected.
|
||||
|
||||
An initial V5 XIAO capture stopped on a partial serial JSON line during guarded
|
||||
mode exit. It is retained as incomplete, not counted above. The host now
|
||||
accumulates reads until newline, with regression coverage. Initial setup
|
||||
rejections are retried only for the explicit pre-measurement packet-guard
|
||||
reply, bounded to three seconds and counted; packet losses and timed failures
|
||||
are never retried away.
|
||||
|
||||
Final V5 firmware SHA-256:
|
||||
|
||||
- XIAO: `5506a40ffa8240201aca519e8e24db3647f897e7a1290bba22be6e4986d8f02f`
|
||||
- Indicator: `dd595b2e7fa8c1ccb14fac9223f1a57277cd6a602864ee9bf090672f494fa2f6`
|
||||
|
||||
Base commit/toolchain/RadioLib pin match the earlier experiments. Thirteen unique
|
||||
host tests passed (eight production regressions, two HIL boundary/buffer tests,
|
||||
three serial-reader/setup-guard tests). The HIL tests cover all 255 nonzero omission masks,
|
||||
normal-path fallbacks, preserved IRQ clear/SetRx, error short-circuit and
|
||||
full-duplex buffer lengths 1..260. They are not full driver lifecycle tests.
|
||||
An additional normal `t1000e_companion_radio_usb` nRF52 build passed with the
|
||||
production warm/batching changes: 591,484-byte app, runtime RAM guard passed.
|
||||
It was not flashed to the RAK or any nRF52 board.
|
||||
|
||||
### Qualification boundary
|
||||
|
||||
No BUSY wait, command status validation, stale-IRQ clear, RX command or wrapper
|
||||
packet-ownership guard is removed. The fastest path relies on a known
|
||||
RX-to-RX window and established RX setup. Correct invalidation after TX, CAD,
|
||||
sleep, reset, failed commands, and recovery must be designed and tested before
|
||||
promoting these shortcuts. The per-byte/bulk HAL experiment is ESP32-specific.
|
||||
Sensitivity/PER, oscillator power draw, large-frequency image recalibration,
|
||||
and application-driven continuous scanning remain unqualified.
|
||||
|
||||
### Actual packet checks and limitations
|
||||
|
||||
Final forward matrix: Indicator transmitter to XIAO receiver, -9 dBm,
|
||||
21 cases x SF7/8/9 x both profiles x 16/64/255-byte payloads = **378 probes**.
|
||||
**359 sequence/length/payload/profile checks succeeded**, 13 receiver-declared
|
||||
wait timeouts occurred, and six receiver USB replies did not arrive before
|
||||
the host deadline. Transmitter replies returned success. Successfully read
|
||||
packets had RSSI -42 to -39 dBm and SNR 10.2 to 14.2 dB. Timeout diagnostics
|
||||
reported RX mode and no device errors; some retained a preamble IRQ. These
|
||||
observations do not establish why packets were missed.
|
||||
|
||||
The production-batched baseline delivered 17/18 in that matrix; the fastest
|
||||
combined/bulk/8 MHz candidate delivered 18/18. An earlier reversed-order
|
||||
smoke test of the fastest candidate had one receiver timeout, so the clean
|
||||
18-packet batch is **not** a reliability qualification. Earlier 0 dBm checks
|
||||
also had baseline and candidate misses. Reducing power did not eliminate them.
|
||||
|
||||
Reverse direction: XIAO transmitter to Indicator receiver, -9 dBm, baseline,
|
||||
combined/8 MHz and combined/bulk/8 MHz, with the same SF/profile/length matrix.
|
||||
**All 54 payloads arrived intact**, 18/18 per case. However, one XIAO USB TX
|
||||
acknowledgement was delayed past the host deadline, after which 32 later
|
||||
records picked up the previous command's acknowledgement. Thus the raw file
|
||||
has only 21 fully matched transactions despite 54 correctly received payloads.
|
||||
This is sequence-correlated evidence of a host acknowledgement problem, not
|
||||
33 RF losses. Subsequent collector code rejects/stores stale sequence replies
|
||||
instead of associating them with a new command, and now asserts DTR on Windows
|
||||
to match the existing `s3_memory_soak.py` HWCDC session policy. The captures
|
||||
above used DTR deasserted; a causal DTR A/B test was not performed. Sequence
|
||||
handling has host regression coverage, but these last host changes were not
|
||||
rerun on HIL firmware after the boards were restored.
|
||||
|
||||
USB acknowledgements and actual receiver payload validity are recorded
|
||||
separately. Missing acknowledgements never trigger an automatic retransmit.
|
||||
The host drains the receiver concurrently with the transmitter's command and
|
||||
records timeouts without hiding them. These tests establish some real packet
|
||||
functionality, not a controlled packet-error-rate comparison. Fix/qualify the
|
||||
test transport, repeat with a stable RF reference, then test TX/CAD/reset/RXPS
|
||||
and continuous application scanning before promoting the shortcuts.
|
||||
|
||||
- [Forward matrix, all 21 cases](../tools/hil/profile_switch_v5_packets_complete.json)
|
||||
- [Reverse matrix, three cases](../tools/hil/profile_switch_v5_packets_reverse_complete.json)
|
||||
- [0 dBm smoke](../tools/hil/profile_switch_v5_packet_smoke.json)
|
||||
- [-9 dBm reversed-order smoke](../tools/hil/profile_switch_v5_packet_minus9_smoke.json)
|
||||
|
||||
Earlier incomplete packet captures and superseded screens are retained for
|
||||
audit, not counted in the 378/54 final matrices. No identity or channel secrets
|
||||
were transmitted: probes used synthetic sequence-tagged bytes.
|
||||
|
||||
## Production integration and USB recovery (V8)
|
||||
|
||||
Normal XIAO S3 WIO and Indicator LoRa variants now opt in to buffered 8 MHz
|
||||
SPI and a guarded fast RX-to-RX path. Other SX1262 variants retain default
|
||||
SPI/full RX setup; modulation batching and warm standby remain shared.
|
||||
|
||||
The fast path keeps the TCXO warm, applies one SF/BW/CR tuple and one packet
|
||||
tuple, clears stale IRQs and starts RX with the original BUSY handling. It
|
||||
reuses an established LoRa IRQ map and buffer bases only within an owned
|
||||
continuous-RX retune. Ordinary standby, staging/TX, CAD, sleep, reset/init,
|
||||
RX duty cycling and command failures invalidate that reuse. RX startup failure
|
||||
now fails the whole profile transaction and restores the old profile/caches
|
||||
with full setup; failed recovery keeps the profile marked for refresh.
|
||||
|
||||
### Sleep recovery discovered during integration
|
||||
|
||||
Initial lifecycle captures found `XOSC_START_ERR` (0x20) after retained sleep,
|
||||
despite successful RX status. RC-policy controls reproduced the same flag:
|
||||
this was not established as a regression caused by the fast path. Simply
|
||||
waking in RC and entering standby before sleep did not clear it. Reapplying
|
||||
the already configured TCXO voltage and 1,600 us delay resolved it.
|
||||
|
||||
The production sleep override now enters standby first, wakes in RC, and
|
||||
restores TCXO configuration on wake. It refuses to clear unrelated device
|
||||
faults. The warm policy resumes after full RX setup. This follows the standby
|
||||
entry requirement in section 13.1.1 of the
|
||||
[Semtech SX1261/2 datasheet](https://files.waveshare.com/wiki/SX1262-XXXM-LoRaWAN-GNSS-HAT/DS_SX1261-2_V1.2.pdf).
|
||||
Section 13.3.6 describes TCXO control and the XOSC error flag; it does not by
|
||||
itself prove the cause of this retained-sleep observation.
|
||||
|
||||
Diagnostic files `profile_switch_v6_recovery_xiao.json`,
|
||||
`profile_switch_v7_recovery_xiao.json`,
|
||||
`profile_switch_v7_recovery_xiao_complete.json` (despite its filename, its
|
||||
`complete` field is false), and `profile_switch_v7_sleep_diagnostic_xiao.json`
|
||||
retain these failures. They are not counted as passing lifecycle tests.
|
||||
|
||||
### USB fix and scope
|
||||
|
||||
The HIL host distinguishes Espressif native CDC (DTR asserted) from CH340
|
||||
bridges (DTR/RTS deasserted). Replies are newline-assembled and sequence-matched.
|
||||
Firmware caches completed packet **and timing** reports before emitting and
|
||||
flushing them. A timeout or malformed report triggers a sequence-scoped result
|
||||
query, never a repeated TX or timing run. Randomized session sequence starts
|
||||
avoid a cached result from an earlier host session.
|
||||
|
||||
V7 had successfully fixed/retested packet result replay but a long native-USB
|
||||
timing sweep still lost one response. V8 adds whole-report timing buffering and
|
||||
replay. The incomplete V7 XIAO timing capture is retained, not silently completed.
|
||||
The public MeshCore Companion USB protocol is unchanged; these USB fixes are
|
||||
for the radio-lab transport. The previous broad Windows-DTR policy described
|
||||
in the V5 history above has been replaced by native-device identification.
|
||||
|
||||
Both boards passed **20 reopen cycles**, deliberate lost timing replies,
|
||||
deliberate lost TX replies, stale TX reply isolation, and **18 lifecycle cases**
|
||||
each. The cases cover TX, CAD, sleep, reset/init, RC-policy sleep and explicit
|
||||
TCXO-restoration controls, repeated three times. Fast counters prove one full
|
||||
RX fallback after invalidation and reuse only on the following retune.
|
||||
All command results, RX-mode checks and device-error checks passed.
|
||||
|
||||
- [XIAO recovery](../tools/hil/profile_switch_v8_recovery_xiao.json)
|
||||
- [Indicator recovery](../tools/hil/profile_switch_v8_recovery_indicator.json)
|
||||
|
||||
V8 test firmware SHA-256 (same pinned RadioLib/toolchain as above):
|
||||
|
||||
- XIAO: `e1806bbf4af5a88b31423131806a682713221082235507ff95e5beb9ef3ac067`
|
||||
- Indicator: `bab4009078a4fff68dfb7aa73a5afc83e84f5c47589354d8aeb8e5b8d8798442`
|
||||
|
||||
Normal USB Companion builds passed for `Xiao_S3_WIO_companion_radio_usb`
|
||||
(813,901 app bytes / 63,012 static RAM),
|
||||
`SenseCapIndicator-LoRa_comp_radio_usb` (879,809 / 62,960), and
|
||||
`t1000e_companion_radio_usb` (591,980 / 179,868). Runtime RAM budgets passed
|
||||
on all three. These normal application images were compiled, not substituted
|
||||
for the user's configured soak firmware during the HIL tests.
|
||||
|
||||
Host/native regression coverage includes production modulation caches/LDRO,
|
||||
standby failure short-circuit, RX-start rollback failure, ownership guards,
|
||||
fast-state invalidation, TCXO wake fault preservation, buffered SPI semantics,
|
||||
USB result overflow/replay, partial reads and stale-sequence handling.
|
||||
|
||||
### Final steady-state timing
|
||||
|
||||
V8 ran 256 timed retunes per trial, four production configurations, SF7/8/9
|
||||
at 500 kHz paired with SF7/62.5 kHz, and two reversed-order rounds on each
|
||||
board: **12,288 measured retunes / 48 trials**. The first eight hops per trial
|
||||
are excluded. There were zero retune failures, BUSY timeouts, RX-mode errors
|
||||
or modulation-cache errors. All 48 trials restored RC policy on exit. The
|
||||
normal packet guards deferred 21 XIAO and 59 Indicator hops; no setup retries
|
||||
or naturally missing/replayed USB reports occurred in these final sweeps.
|
||||
|
||||
| Production configuration | XIAO mean / maximum | Indicator mean / maximum |
|
||||
| --- | --- | --- |
|
||||
| Warm + batching, per-byte SPI 2 MHz | 1.193 / 1.227 ms | 15.174 / 15.836 ms |
|
||||
| Fast RX, per-byte SPI 2 MHz | 0.744 / 0.770 ms | 8.426 / 8.471 ms |
|
||||
| Full RX, buffered SPI 8 MHz | 0.828 / 0.840 ms | 14.816 / 15.386 ms |
|
||||
| Fast RX + buffered SPI 8 MHz | **0.549 / 0.556 ms** | **8.263 / 8.879 ms** |
|
||||
|
||||
The combined production path saves **54.0% on XIAO** and **45.5% on Indicator**
|
||||
relative to each same-image warm/batched control. Small differences from V5-V7
|
||||
reflect different binaries/code layout; only within-image A/Bs are compared.
|
||||
Both fast configurations must increment the production success counter; full
|
||||
RX controls must not. Mode/cache verification happens after the timed region.
|
||||
|
||||
- [XIAO V8 timing](../tools/hil/profile_switch_v8_production_xiao.json)
|
||||
- [Indicator V8 timing](../tools/hil/profile_switch_v8_production_indicator.json)
|
||||
|
||||
The common 6 ms switch and 4 ms loop allowances are unchanged, not delays
|
||||
inserted by the driver. Indicator still exceeds 6 ms. These measurements do
|
||||
not qualify continuous application scheduling, scan-overlap reception,
|
||||
sensitivity/PER, power use, temperature extremes, or image recalibration on
|
||||
frequency changes larger than this 1 MHz pair. Do not shorten common transmit
|
||||
preambles or advertise the XIAO number for other boards.
|
||||
|
||||
### Final over-air packet matrix
|
||||
|
||||
**288/288 payloads and command transactions passed**: 144 Indicator-to-XIAO
|
||||
and 144 XIAO-to-Indicator. Each direction covers all four production cases,
|
||||
SF7/8/9 secondary profiles, both target profiles, 16/64/255-byte synthetic
|
||||
payloads and two reversed-order rounds. TX used buffered 8 MHz SPI at -9 dBm.
|
||||
Fast receiver readiness reports had to show actual production fast resumes.
|
||||
|
||||
There were **zero RX errors, receiver timeouts, missing replies, stale replies,
|
||||
or natural transport-recovery queries** in these matrices. Deliberately lost
|
||||
and stale replies were separately exercised by the recovery tests above.
|
||||
RSSI ranged -43 to -39 dBm and SNR 10.2 to 14.5 dB. This clean short-range
|
||||
matrix addresses the failures seen in the earlier V5 harness; it does not
|
||||
identify which single change caused each historical miss or establish a
|
||||
field packet-error rate.
|
||||
|
||||
- [Indicator TX / XIAO RX](../tools/hil/profile_switch_v8_packets_forward.json)
|
||||
- [XIAO TX / Indicator RX](../tools/hil/profile_switch_v8_packets_reverse.json)
|
||||
|
||||
All **18 host/native regression tests** passed. The HIL builds do not include
|
||||
the unrelated pre-existing Companion/repeater/Wi-Fi soak edits; the normal
|
||||
application compile checks include the current working tree and preserve them.
|
||||
|
||||
A subsequent requested [SF6/125 kHz multi-channel test](sf6_channel_scan_validation.md)
|
||||
used 32-symbol preambles and 4.8-symbol visits. It stopped on the third packet
|
||||
at the initial four channels (two received, one timeout); no higher count was
|
||||
tried. That continuous scan experiment is separate from the 288/288
|
||||
stationary-after-retune matrix above.
|
||||
@@ -203,6 +203,53 @@ The scan uses **normal receive**, following the
|
||||
channel, followed by the remaining fast-channel visit. It does not use CAD for scanning.
|
||||
The separate CAD check before an initial transmission still follows `cad`.
|
||||
|
||||
SX1262 dual-profile mode keeps the oscillator running in XOSC standby between
|
||||
visits, so each retune does not need to restart the TCXO. It restores the prior
|
||||
standby policy when returning to one profile, together with the saved RXPS
|
||||
setting. Radio reinitialization temporarily uses RC standby until the TCXO has
|
||||
been configured again. Other radio families retain their existing behavior.
|
||||
This does not disable the TCXO supply or its initial startup delay, and it is
|
||||
not conditional on 500 kHz bandwidth. Keeping the oscillator on uses additional
|
||||
power during the short standby intervals.
|
||||
|
||||
The 6 ms switch budget is still a default scheduling allowance, not a
|
||||
forced delay, and has not been reduced for this change. The earlier standalone
|
||||
[keep-warm scan experiment](mixed_scan_validation.md) averaged about 1.19 ms
|
||||
of overhead per hop (scan-cycle time minus both receive windows, divided by
|
||||
two). That experiment used a leaner receive path; it is not a measurement or
|
||||
guarantee of the production implementation. Measure the target board before
|
||||
shortening its timing margins or transmit preambles.
|
||||
|
||||
The [production-path XIAO timing test](radio_profile_switch_validation.md)
|
||||
measured **1.434 ms average / 1.467 ms maximum** with warm standby, compared
|
||||
with **3.166 ms average** using RC standby: about **1.732 ms saved per hop**.
|
||||
It covered 12,000 retunes across SF7/8/9 at 500 kHz paired with SF7/62.5 kHz.
|
||||
These measurements include observing BUSY low, but exclude application/UI
|
||||
scheduling and are not a packet-delivery qualification or a guarantee for
|
||||
other boards, especially those using I/O expanders.
|
||||
|
||||
A same-image follow-up batching SF/BW/CR into one modulation command reduced
|
||||
warm switching from **1.444 ms to 1.158 ms average** (batched maximum **1.198 ms**),
|
||||
saving another **0.286 ms / 19.8%**. RadioLib's modulation caches and LDRO
|
||||
calculation remain synchronized; frequency, preamble, packet guards, and RX
|
||||
restart are unchanged. A later [HIL-only screening](radio_profile_switch_validation.md#expanded-screening-redundant-rx-setup-and-spi-v5)
|
||||
tested redundant standby/IRQ/buffer/packet setup and SPI transfer changes.
|
||||
Its fastest candidate measured 0.535 ms mean on XIAO but 8.203 ms on the
|
||||
Indicator, whose radio GPIOs go through an I2C expander. The validated production
|
||||
implementation now opts XIAO S3 WIO and Indicator LoRa into buffered 8 MHz SPI
|
||||
and a guarded fast-RX state machine. It skips redundant standby, IRQ mapping,
|
||||
buffer-base writes and modem queries only during an owned continuous RX-to-RX
|
||||
retune. Preamble/packet parameters (including the IQ workaround), stale-IRQ
|
||||
clearing, RX commands and BUSY waits remain. TX, CAD, sleep, reset, RXPS and
|
||||
failed commands revoke reuse; failed RX startup rolls back the profile.
|
||||
Sleep entry uses standby and wake restores the existing TCXO voltage/delay.
|
||||
Other variants do not opt in to faster SPI or the fast-RX state machine.
|
||||
See [production and USB validation](radio_profile_switch_validation.md#production-integration-and-usb-recovery-v8)
|
||||
for current measurements, lifecycle tests and limitations.
|
||||
The Indicator result also shows that the
|
||||
generic 6 ms allowance is not an upper bound for every board; its scheduling
|
||||
and preambles need board-specific qualification, not a smaller common budget.
|
||||
|
||||
Single-channel noise-floor calibration and RSSI interference comparison are
|
||||
suspended while scanning. Retries use the radio's preamble/header activity
|
||||
indicators. LR2021 extra-SF side detectors are suspended and restored as well.
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
# SF6 / 125 kHz: four channels at 5.1 chirps
|
||||
|
||||
Measured 2026-09-14. **Seven packets received, then packet 8 missed.** The run
|
||||
stopped at that first miss. No RF retry, other dwell, or higher/lower channel
|
||||
count was tested. The target of 100 packets per channel was not reached.
|
||||
|
||||
Follow-up: [SF8/125 at the same 5.1-chirp dwell](sf8_5p1_trace_validation.md)
|
||||
missed on packet 13 and captured an off-channel preamble hold. That differs
|
||||
from the absence of observed preamble in this SF6 failure.
|
||||
|
||||
## Setup
|
||||
|
||||
- XIAO ESP32-S3 + WIO SX1262 scanner, COM31.
|
||||
- SenseCAP Indicator ESP32-S3 reference transmitter, COM28.
|
||||
- Four centers: 909.500, 909.750, 910.000, 910.250 MHz.
|
||||
- SF6 / 125 kHz / CR4/5, 32-symbol programmed TX preamble.
|
||||
- User-corrected dwell: **5.1 symbols**, ceil(5.1 * 512) = **2,612 us**.
|
||||
- Same warm production fast retune, buffered 8 MHz SPI, packet guards.
|
||||
- 16-byte synthetic payloads at -9 dBm; balanced randomized channel order,
|
||||
seed 606125; varied arrival timing, not synchronized to scan phase.
|
||||
- IRQ changes, IRQ clears, hops and first guard deferrals buffered in RAM.
|
||||
Additional read-only IRQ polling at nominal 64 us intervals while armed.
|
||||
No per-event serial printing during capture. Trace read after each result.
|
||||
|
||||
```text
|
||||
python tools/hil/profile_switch_channels.py --receiver COM31 --sender COM28 --output tools/hil/sf6_125_5p1_trace_results.json --samples 100 --preamble 32 --max-channels 4 --dwell-symbols 5.1 --trace
|
||||
```
|
||||
|
||||
## Results and what the trace establishes
|
||||
|
||||
Probes 1–7 succeeded on channels **3, 2, 1, 0, 2, 3, 1**. Probe 8, sequence
|
||||
`944962150`, missed on channel **0 (909.500 MHz)**. Thus channel 0 had already
|
||||
received a valid probe; this was not a channel that never worked at all.
|
||||
Successful packets had RSSI -42 to -40 dBm and SNR 9.5 to 10.8 dB.
|
||||
|
||||
The failed probe has a complete, non-overflowed 3,160-event trace:
|
||||
|
||||
- Expectation armed on channel 3 without selecting the expected channel.
|
||||
- 3,158 completed hops during the bounded 10-second confirmation interval.
|
||||
- **No observed nonzero IRQ bits**: no preamble, header, RxDone or CRC event.
|
||||
- **No guard-held visit** on any channel during that expectation.
|
||||
- Receiver timeout at 10,000,369 us, with RX mode and zero device errors.
|
||||
- Reference TX returned success. All USB sequence acknowledgements matched;
|
||||
no stale replies, missing acknowledgements or cached transport recovery.
|
||||
|
||||
The scanner was not stuck on the wrong channel by a false preamble. It also
|
||||
did not acquire a header and then fail a CRC check. The evidence locates the
|
||||
failure before **observed preamble acquisition**, not at payload decoding.
|
||||
It does not prove why acquisition failed: a short-visit/arrival-phase issue
|
||||
remains a candidate, as does an unobserved RF/reference issue. There was no
|
||||
independent RF capture, and the two MCU clocks were not synchronized.
|
||||
|
||||
### Actual timing during the failed expectation
|
||||
|
||||
| Measurement | Minimum | Mean | Maximum |
|
||||
| --- | --- | --- | --- |
|
||||
| Receive dwell, 3,158 hops | 2,613 us | 2,628.706 us | 2,646 us |
|
||||
| Retune, trace hop rows | 526 us | 538.700 us | 630 us |
|
||||
| Channel 0 revisit interval, 789 cycles | 12,643 us | 12,666.829 us | 12,705 us |
|
||||
|
||||
The repeatable scan timing rules out a large software scheduling stall in the
|
||||
failed capture. The 32 programmed symbols occupy 16.384 ms, longer than that
|
||||
idle scan cycle; nevertheless, revisiting within the preamble did not ensure
|
||||
successful acquisition during these short individual visits.
|
||||
|
||||
### Successful acquisition traces
|
||||
|
||||
Times below are relative to the logged hop completion onto the eventual
|
||||
receive channel, not a precisely captured RF edge or hardware RX-start edge.
|
||||
The trace observed the following progression for every successful probe:
|
||||
PreambleDetected (0x0004), HeaderValid (0x0014), RxDone (0x0016), consumption.
|
||||
|
||||
| Probe | Channel | First observed preamble after hop | RxDone after hop |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | 3 | 1,838 us | 32,982 us |
|
||||
| 2 | 2 | 1,836 us | 35,470 us |
|
||||
| 3 | 1 | 1,844 us | 35,151 us |
|
||||
| 4 | 0 | 2,332 us | 37,329 us |
|
||||
| 5 | 2 | 1,847 us | 35,532 us |
|
||||
| 6 | 3 | 1,831 us | 30,731 us |
|
||||
| 7 | 1 | 1,329 us | 32,567 us |
|
||||
|
||||
After detecting preamble, the production guard kept those visits on-channel
|
||||
until reception completed. The failed probe never reached that observed
|
||||
state. This is not evidence that 5.1 symbols always suffice, nor does 7/8
|
||||
estimate a stable packet-error rate or establish a channel-capacity limit.
|
||||
|
||||
## Instrumentation and reporting caveats
|
||||
|
||||
The failed capture made 115,783 diagnostic IRQ polls, costing a total
|
||||
2,821,617 us (about 24.4 us each; maximum 61 us). These reads are not free:
|
||||
they alter loop load, although actual dwell and revisit timing were measured.
|
||||
This is **not a matched A/B** against the earlier untraced 4.8-symbol run, so
|
||||
seven successes versus two cannot be attributed solely to the extra dwell.
|
||||
|
||||
The run used `channel_trace: 1`. During analysis, a reporting bug was found in
|
||||
the newly added `held_dwell` aggregate: production `startRecv()` resets the
|
||||
visit timestamp after reading a packet. That aggregate therefore omitted the
|
||||
preceding held reception time. **Do not use its 2.709 ms mean as total held
|
||||
occupancy.** The timestamped IRQ/hop trace above is the evidence for the actual
|
||||
30.7–37.3 ms hop-to-RxDone intervals. The failed capture had no RX restart, so
|
||||
its dwell rows are unaffected.
|
||||
|
||||
The source now keeps a separate channel-occupancy timestamp (`channel_trace:
|
||||
2`, `trace_format: 2`). Both HIL targets compiled with this reporting-only
|
||||
correction; it was **not flashed or RF-tested**, and the saved raw result was
|
||||
not rewritten. Scheduler, packet guard and radio commands were not changed by
|
||||
that correction. Regression coverage includes passive SPI observation,
|
||||
bounded/frozen capture, occupancy accounting, page identity, requested dwell,
|
||||
and stopping at the first miss.
|
||||
|
||||
## Provenance and device handoff
|
||||
|
||||
- [Unmodified raw result and all eight traces](../tools/hil/sf6_125_5p1_trace_results.json)
|
||||
- [Harness and trace format](../tools/hil/profile_switch_README.md#traced-four-channel-diagnostic)
|
||||
- [Earlier 4.8-symbol result](sf6_channel_scan_validation.md)
|
||||
|
||||
Raw result SHA-256:
|
||||
`7caa16483b7b0000b388a1906395fe3d381bd0e40de73f48cd5c876d96deab3b`.
|
||||
|
||||
**Actually tested** firmware SHA-256 (trace version 1, before reporting fix):
|
||||
|
||||
- XIAO: `35c201f367b0aaa693be03542a4c115024d1a70a2be2fbdbef2c94da5a6053ae`
|
||||
- Indicator: `8a25d84fc99f6aeaf8318bf4533767e16a9afc0de51394fce27d3a610c63b352`
|
||||
|
||||
Base commit `c329cf1fc1e7f2e8c8733ab0d000094730458fe3` plus local changes;
|
||||
RadioLib 7.7.1 at `187ef24791c3d844939b2be13a68bd890bd04e4c`, Espressif32
|
||||
6.11.0 / Arduino ESP32 2.0.17. No normal production firmware change this turn.
|
||||
|
||||
Fresh full 8 MiB snapshots were saved and digest-verified before flashing:
|
||||
|
||||
- XIAO: `35aa2deeb8a8145bc54435c9f87b3db1c65f320f2568ee0b489305db1a6330c2`
|
||||
- Indicator: `dba59cde1df3c69dd2e5995950315951f75cd43886b21be8b14e261ec4b57309`
|
||||
|
||||
Both snapshots were restored afterward, separately verified against the full
|
||||
flash, and hardware-reset. Snapshots remain in the private current-user backup
|
||||
directory. The RAK4631 and Indicator RP2040 were not modified; the XIAO soak
|
||||
logger was not restarted. Changes were initially handed off locally before publication.
|
||||
@@ -0,0 +1,106 @@
|
||||
# SF6 / 125 kHz channel-count test
|
||||
|
||||
Measured 2026-09-13. The run stopped on the **third packet at the initial four
|
||||
channels**: two arrived intact, then the receiver timed out. No five-channel
|
||||
test, lower-channel test, retry or retransmission was performed. Consequently
|
||||
this run does **not** establish a maximum channel count with 100% reception.
|
||||
|
||||
Follow-up: [four channels at 5.1 symbols with an IRQ trace](sf6_5p1_trace_validation.md)
|
||||
stopped at packet 8 and observed no preamble acquisition during the miss.
|
||||
|
||||
## Requested setup
|
||||
|
||||
- Receiver: XIAO ESP32-S3 + WIO SX1262, COM31.
|
||||
- Reference transmitter: SenseCAP Indicator ESP32-S3 LoRa processor, COM28.
|
||||
- SF6 / 125 kHz / CR4/5, fixed **32-symbol programmed preamble**.
|
||||
- **4.8-symbol receive visits**: 2,457.6 us, rounded up to 2,458 us.
|
||||
- Buffered 8 MHz SPI and the production fast retune/packet-ownership guards.
|
||||
- Start at four channels and add one only after 100/100 packets on every channel.
|
||||
- Stop at the first missing/corrupt packet; USB/reference/scanner faults are
|
||||
reported separately as inconclusive fixture errors.
|
||||
- 16-byte synthetic payloads at -9 dBm. No identity/channel secrets transmitted.
|
||||
- Four channel centers: 909.500, 909.750, 910.000 and 910.250 MHz.
|
||||
- Balanced randomized channel order, seed 606125; varied arrival timing across
|
||||
approximately two idle scan cycles. Arming an expectation does not select
|
||||
the receiver's channel or reset its visit clock.
|
||||
|
||||
The 100-packet-per-channel target was **not reached**: the explicit first-miss
|
||||
stop rule ended the run during its first shuffled pass.
|
||||
|
||||
## Observations
|
||||
|
||||
| Probe | Channel center | Outcome |
|
||||
| --- | --- | --- |
|
||||
| 1 | 910.250 MHz | Valid 16 bytes, RSSI -40 dBm, SNR 10.8 dB |
|
||||
| 2 | 910.000 MHz | Valid 16 bytes, RSSI -40 dBm, SNR 11.0 dB |
|
||||
| 3 | 909.750 MHz | Receiver timeout; transmitter returned success |
|
||||
|
||||
All three transmit acknowledgements and receiver reports matched their
|
||||
sequence IDs, with no missing/replayed/stale USB replies. On the miss, the
|
||||
receiver reported RX mode and zero device errors. The scanner recorded zero
|
||||
retune failures, RX-mode errors, modulation-cache errors or CRC/read errors.
|
||||
No probe was sent on 909.500 MHz before the stop condition.
|
||||
|
||||
| Timing | Minimum | Mean | Maximum |
|
||||
| --- | --- | --- | --- |
|
||||
| Production retune to BUSY low, 3,467 hops | 504 us | **514.652 us** | 726 us |
|
||||
| Idle receive dwell, 3,463 visits | 2,458 us | **2,462.480 us** | 2,468 us |
|
||||
|
||||
These samples include scanning during the bounded 10-second wait that
|
||||
confirmed the missing packet. There were 2,451 deferred *attempts* while
|
||||
production preamble/header/packet ownership held a visit; this is not a count
|
||||
of packets or failed retunes. Held visits are excluded from idle-dwell timing.
|
||||
All 3,467 successful retunes used the production fast-RX path.
|
||||
|
||||
The means imply about **11.91 ms per four-channel idle cycle**, excluding
|
||||
packet-held visits and small loop bookkeeping. Fast retuning alone did not
|
||||
produce 100% reception in this setup. This short stop-on-first-miss experiment
|
||||
does not identify the exact acquisition/phase cause, estimate a stable PER,
|
||||
prove that three channels would pass, or establish a universal board limit.
|
||||
|
||||
## Implementation and reproduction
|
||||
|
||||
This is a lab-only N-channel scheduler over the real `tuneProfile()` path.
|
||||
It reuses the two production profile slots as staging slots for the next
|
||||
frequency. Normal MeshCore `radio2` remains two-profile. The explicit test
|
||||
schedule intentionally does not use the normal two-profile automatic-preamble
|
||||
fit calculation or generic 6 ms switch / 4 ms loop allowances. It keeps the
|
||||
existing packet-protection guards and measures real dwell/retune overhead.
|
||||
|
||||
```text
|
||||
python tools/hil/profile_switch_channels.py --receiver COM31 --sender COM28 --output results.json --samples 100 --preamble 32
|
||||
```
|
||||
|
||||
The controller has regression tests for balanced samples, starting at four,
|
||||
incrementing only after a perfect level, stopping without another TX, and
|
||||
distinguishing fixture failure from an RF miss. A separate RX-only 0.5-second
|
||||
setup check verified the scan timing before any capacity-test packets were
|
||||
sent. The capacity run itself was not repeated.
|
||||
|
||||
- [Raw result, including the failing probe](../tools/hil/sf6_125_channel_capacity_results.json)
|
||||
- [Host controller](../tools/hil/profile_switch_channels.py)
|
||||
- [Firmware scheduler](../tools/hil/profile_switch_channels.h)
|
||||
- [Harness instructions](../tools/hil/profile_switch_README.md#sf6125-khz-channel-count-limit)
|
||||
- [Earlier USB and fast-switch qualification](radio_profile_switch_validation.md#production-integration-and-usb-recovery-v8)
|
||||
|
||||
Build provenance: base commit `c329cf1fc1e7f2e8c8733ab0d000094730458fe3`
|
||||
plus the local fast-switch and HIL changes; Arduino ESP32 2.0.17,
|
||||
Espressif32 6.11.0, RadioLib 7.7.1 pinned at
|
||||
`187ef24791c3d844939b2be13a68bd890bd04e4c`. This is the extended V8 harness
|
||||
with `channel_sweep: 1`; its binaries differ from the earlier two-profile
|
||||
V8 measurements, so timings should not be treated as a same-image A/B.
|
||||
|
||||
Firmware SHA-256:
|
||||
|
||||
- XIAO: `b0a6dd216be8a638fe088219801290d4632afcf63048f8597037650d68cd2301`
|
||||
- Indicator: `f0aa43a46e5e59ebf4768a255bd8c31d7a72c0038e11173314f78908b725786d`
|
||||
|
||||
## Device handoff
|
||||
|
||||
After the first-miss stop, both original 8 MiB flash snapshots were restored.
|
||||
Separate full-flash verification matched each backup's digest, followed by
|
||||
hardware reset. The private backups remain in the current-user backup
|
||||
directory. The Indicator RP2040 and RAK4631 were not modified. The interrupted
|
||||
XIAO soak logger remains stopped, and the temporary PlatformIO HIL overlay was
|
||||
removed. Implementation, tests and reports were initially handed off locally
|
||||
before publication.
|
||||
@@ -0,0 +1,137 @@
|
||||
# SF8 / 125 kHz: four-channel comparison at 5.1 chirps
|
||||
|
||||
Measured 2026-09-14. **12 packets received, then packet 13 missed.** The first
|
||||
three balanced rounds passed (3/3 on every channel); the next probe on channel
|
||||
3 failed. The run stopped at that miss. The target of 100 packets per channel
|
||||
was not reached. No RF retry or other channel count was tested.
|
||||
|
||||
## Setup and comparison
|
||||
|
||||
Same XIAO ESP32-S3 + WIO SX1262 scanner (COM31) and SenseCAP Indicator ESP32-S3
|
||||
reference transmitter (COM28). Four centers: 909.500, 909.750, 910.000 and
|
||||
910.250 MHz. CR4/5, 32-symbol programmed preamble, 16-byte synthetic packets,
|
||||
-9 dBm, warm production fast RX and buffered 8 MHz SPI. Same production packet
|
||||
guards and read-only 64 us nominal IRQ polling; events buffered until each
|
||||
result. Randomized balanced channel order, seed 606125, varied arrival timing.
|
||||
|
||||
| Setting | Earlier SF6/125 | This SF8/125 |
|
||||
| --- | --- | --- |
|
||||
| One symbol | 512 us | 2,048 us |
|
||||
| Requested 5.1-symbol dwell, rounded up | 2,612 us | 10,445 us |
|
||||
| 32 programmed preamble symbols | 16.384 ms | 65.536 ms |
|
||||
| Whole-run average measured retune | 539.427 us | 524.124 us |
|
||||
| Outcome before first miss | 7 received, packet 8 missed | 12 received, packet 13 missed |
|
||||
| Miss trace | No observed preamble or hold | Off-channel preamble and prolonged hold |
|
||||
|
||||
Changing SF increases real listening and preamble durations together. This is
|
||||
not a matched same-image A/B or an isolated post-retune settling experiment.
|
||||
The small retune-time difference must not be treated as a new optimization;
|
||||
no extra settling delay was inserted. The earlier reporting-only held-visit
|
||||
timestamp correction is included in this trace-version-2 run.
|
||||
|
||||
## Failed probe: an off-channel hold
|
||||
|
||||
Failed sequence `388715032` targeted **channel 3 / 910.250 MHz**. The scanner
|
||||
instead observed PreambleDetected on **channel 2 / 910.000 MHz**, then its
|
||||
normal packet guard deferred the intended jump to channel 3. It never observed
|
||||
a valid header, header error, CRC event, or RxDone for that preamble.
|
||||
|
||||
Times are software observations relative to expectation arming:
|
||||
|
||||
| Time | Event |
|
||||
| --- | --- |
|
||||
| 207.649 ms | Last hop onto target channel 3 before the long gap |
|
||||
| 240.542 ms | Hop onto channel 2 |
|
||||
| 250.030 ms | PreambleDetected (0x0004) observed on channel 2 |
|
||||
| 251.013 ms | Guard defers channel 2 → 3 at the 5.1-symbol deadline |
|
||||
| 342.287 ms | Guard issues a clear of the still-latched preamble bit |
|
||||
| 342.794 ms | Hop onto channel 3 finally completes |
|
||||
| 342.851 ms | IRQ read confirms zero bits |
|
||||
| 9,999.270 ms | Expectation timeout, RX mode, zero device errors |
|
||||
|
||||
Channel-2 occupancy was about **102 ms**. The target channel's revisit gap
|
||||
grew to **135.145 ms**, compared with its ordinary ~43.875 ms cycle and the
|
||||
65.536 ms programmed preamble. The delayed retune itself took only **550 us**.
|
||||
|
||||
The preamble-to-header budget from `calcMaxPacketMillis()` is
|
||||
ceil((32 + 8 + 4.25) * 2.048) = **91 ms**. The strict millisecond timeout in
|
||||
`CustomSX1262::isReceiving()` clears a preamble that does not advance to a
|
||||
header. The observed **92.257 ms** from the first IRQ observation to that
|
||||
clear is consistent with this existing protection mechanism.
|
||||
|
||||
This identifies a prolonged off-channel hold that removed the next listening
|
||||
opportunity. It does **not** show that the ~0.52 ms jump needs more settling
|
||||
time. The RF source of that preamble is not proven: adjacent-channel pickup/
|
||||
false detection or unrelated RF are possibilities. There was no independent
|
||||
RF capture or synchronized MCU clock. The earlier SF6 miss had no observed
|
||||
preamble or hold; this result does not establish the same cause for that miss.
|
||||
|
||||
Simply shortening the guard risks cutting off valid long-preamble packets.
|
||||
Successful traces show that reception legitimately keeps a channel occupied
|
||||
well past 10.445 ms. No production guard change was made in this diagnostic.
|
||||
|
||||
Follow-up: the [stationary preamble investigation](preamble_detection_investigation.md)
|
||||
reproduced transmitter-associated off-frequency indications with full RX
|
||||
initialization and no hopping, on both boards. It strengthens the off-channel
|
||||
detection explanation without independently identifying the RF source of this
|
||||
historical missed probe. The SF6 miss remains a separate unresolved case.
|
||||
|
||||
## Measurements and checks
|
||||
|
||||
- All 12 successful payloads were valid; RSSI -42 to -41 dBm, SNR 12.0 to
|
||||
14.2 dB. First observed preamble after logged hop completion ranged
|
||||
**7.433–9.485 ms**; hop-to-RxDone ranged **105.056–146.836 ms**.
|
||||
- Entire run: 1,167 fast hops, mean retune 524.124 us, maximum 774 us. Idle
|
||||
dwell mean 10,452.444 us; held visits separately accounted for.
|
||||
- Failed expectation: 910 trace events, zero overflow, 903 completed hops.
|
||||
The 902 unheld dwells were 10,445–10,480 us, mean 10,450.424 us.
|
||||
- Excluding the one held cycle, target-channel revisit intervals were
|
||||
**43,847–43,928 us**, mean **43,874.580 us** (224 intervals).
|
||||
- Failed-expectation retunes: 511–617 us, mean 520.443 us. The held occupancy
|
||||
accounts for the anomalous target-channel revisit gap.
|
||||
- Zero retune failures, RX-mode errors, modulation-cache errors, CRC/read
|
||||
errors, USB stale replies or cached transport recovery. Reference TX rc=0.
|
||||
- 133,217 extra IRQ polls during the failed capture; total cost 3,241,509 us,
|
||||
maximum 55 us. Polls add load; timestamps are observations, not exact IRQ
|
||||
edges. No per-event serial output occurs during capture.
|
||||
|
||||
This first-miss sample neither estimates a stable packet-error rate nor
|
||||
establishes a channel count with 100% reception.
|
||||
|
||||
## Reproduction and provenance
|
||||
|
||||
```text
|
||||
python tools/hil/profile_switch_channels.py --receiver COM31 --sender COM28 --output tools/hil/sf8_125_5p1_trace_results.json --samples 100 --preamble 32 --max-channels 4 --dwell-symbols 5.1 --trace --sf 8
|
||||
```
|
||||
|
||||
- [Raw result and all 13 traces](../tools/hil/sf8_125_5p1_trace_results.json)
|
||||
- [Earlier SF6/125 at 5.1 chirps](sf6_5p1_trace_validation.md)
|
||||
- [Harness instructions](../tools/hil/profile_switch_README.md#sf8-comparison-at-the-same-chirp-count)
|
||||
|
||||
Raw result SHA-256:
|
||||
`0d7e97173937f42708febf8276cdadc36578740735058d5da39b1b576e9ca49e`.
|
||||
|
||||
Tested firmware SHA-256:
|
||||
|
||||
- XIAO: `a68ab9834f62d0a5fb3f10c7a0b312c17d7d62795885cac4ea0dce483d6bf1ea`
|
||||
- Indicator: `bca1514bc6e09af6b1a9daed5bf4d3dbeeab988bcb856acbc73f59334395280d`
|
||||
|
||||
Base commit `c329cf1fc1e7f2e8c8733ab0d000094730458fe3` plus local changes;
|
||||
RadioLib 7.7.1 at `187ef24791c3d844939b2be13a68bd890bd04e4c`, Espressif32
|
||||
6.11.0 / Arduino ESP32 2.0.17. Both HIL targets built successfully. All 27
|
||||
selected host/native tests passed, including SF scaling, propagation to both
|
||||
RX staging slots and TX, cache checks, trace handling and first-miss stop.
|
||||
|
||||
## Device handoff
|
||||
|
||||
Fresh full 8 MiB backups were saved and digest-verified before flashing:
|
||||
|
||||
- XIAO: `e9533742103c9d7af11a3dc0c40496ca412b072e11880c2be785c92ef80e4310`
|
||||
- Indicator: `d4f39a0be1339f142ed329b68606347adeb514d26d6cc8bad43fb3d343ac1e2a`
|
||||
|
||||
Both were restored after the test, separately full-flash digest-verified, and
|
||||
hardware-reset. Backups remain in the private current-user backup directory.
|
||||
No identity or channel secrets were used in the synthetic RF probes. The
|
||||
RAK4631 and Indicator RP2040 were not modified; the XIAO soak logger was not
|
||||
restarted. The temporary HIL build overlay was removed. Source, tests and
|
||||
results were initially handed off locally before publication.
|
||||
Reference in new issue
Block a user