fix: TCXO XOSC_START_ERR handling, always apply config, register DIO1 ISR callback; TX proof of life confirmed by SDR

This commit is contained in:
Lars Nolden
2026-08-31 22:43:55 +02:00
parent 3b8547fb8a
commit f7c8614a3b
9 changed files with 283 additions and 14 deletions
+30
View File
@@ -0,0 +1,30 @@
# Future Solenos/Gebos dev-board requirements
Derived from actual debugging needs during this experiment. Machine-readable
pin list: devboard_signals.csv.
## Debug access that proved necessary
- SX1262 BUSY + DIO1 on test points: needed to reason about command timing,
IRQ latency, and stuck-BUSY recovery without guessing.
"I needed direct access to this signal because the only alternative was
inferring radio state from SPI responses."
- Full SPI bus (NSS/SCK/MOSI/MISO) on a header: logic-analyzer decode of
the SX1262 command stream is the ground truth when firmware and radio
disagree.
- FEM control lines (PWR_EN, CSD, CTX): RX sensitivity and TX output both
silently break if these are wrong; scoping them is the fastest check.
CSD doubles as board-revision detect (pull level) — keep it probeable.
- Native USB pins must remain dedicated to flash/console; the DUT USB
identity changes between app and ROM bootloader, so the dev board should
also expose UART0 TX as an always-on log output (the Heltec does not,
which made early-boot debugging blind).
## Wishlist beyond the current board
- Always-available secondary UART for logs (independent of native USB).
- Measurable radio power rail (current shunt) to correlate TX events with
actual PA draw — would have settled "is the FEM PA active?" instantly.
- RF test connector (u.FL tap or directional coupler) for conducted
measurements instead of over-the-air-only verification.
- ESP32 BOOT/RESET buttons brought to a header for automated strapping.
+40
View File
@@ -0,0 +1,40 @@
# Findings
## CONFIRMED
- Heltec V4.3 SX1262 pin mapping (NSS 8, SCK 9, MOSI 10, MISO 11, RST 12,
BUSY 13, DIO1 14): SPI write/readback passes, radio enters RX
(`radio_init: spi:true, reset:true, tcxo:true, result:ok`).
- TCXO is DIO3-controlled at 1.8 V; without post-TCXO recalibration the
XOSC_START_ERR device error appears. With recalibrate: no device errors.
- KCT8103L FEM on GPIO7 (power), GPIO2 (CSD), GPIO5 (CTX), CPS on DIO2.
RX works with CSD high + CTX low + DIO2-as-RF-switch.
- Firmware heartbeat RSSI in RX: -101..-107 dBm noise floor -> RX chain
with boosted gain is plausibly alive.
- Nooelec NESDR SMArt v5 R820T PLL wedges ("PLL not locked"), producing
gain-independent white noise on all frequencies until USB reset.
`usbreset 0bda:2838` reliably restores operation. Trigger correlated
with `rtl_test -t` direct-sampling probe.
- rtl-sdr-blog and osmocom rtl_sdr builds behave identically w.r.t. the
wedge; not a driver-fork issue.
- Real C1 traffic exists at this site (first telegram decoded 22:23 local,
meter ID 04767752).
## LIKELY
- Fixed 255-byte RX capture adds up to ~20 ms artificial dead time per
frame (by construction; to be measured).
## DISPROVEN
- "rtl_sdr pipeline works out of the box": the PLL wedge cost ~20 minutes
of empty captures. Always energy-probe the SDR before trusting a null
result.
## NEEDS TESTING
- Heltec C1 RX of real meter frames (SDR sees traffic; Heltec match TBD).
- TX proof of life via SDR.
- LNA on/off comparison (KCT8103L CSD low in RX = bypass?).
- Repeat delay accuracy, RX deaf time distribution.
- Long-run stability (>=100, >=500 repeats).
+18
View File
@@ -0,0 +1,18 @@
# Open Questions
- Optimal SX1262 RX bandwidth for C1: 234.3 kHz chosen (signal ~190 kHz
incl. tolerances); would 156 kHz improve sensitivity without clipping
drifted meters?
- Preamble detector length: 8 bits chosen for sensitivity; false-sync rate
in the field? (false syncs cost ~20 ms deaf time each at fixed-255 RX).
- Does the KCT8103L LNA help or hurt with strong 868 MHz interferers?
(see planned docs/RF_FRONTEND_TESTS.md)
- RX dead time during retransmit: measured distribution?
- Can the SX1262 re-arm RX fast enough to catch a meter's immediate
follow-up telegram after our TX?
- Exact production repeater framing/hop requirements (EN 13757-5).
- Regulatory duty-cycle budget for a production repeater at 868.95 MHz.
- Modulation shaping for TX: none vs GFSK BT=0.5 — which does rtl-wmbus /
real receivers prefer? (TX currently unshaped 2-FSK.)
- Why did the R820T PLL wedge? (usbreset workaround in place; root cause
unknown, suspected rtl_test direct-sampling probe.)
+57
View File
@@ -0,0 +1,57 @@
# Testing
## One-command HIL test
```
nix develop --command ./hil/run.sh --duration 300
```
Performs: device discovery (aborts on ambiguity) -> SDR USB reset ->
firmware build + flash -> DUT configuration -> concurrent serial + SDR
capture -> correlation -> report (text + report.json). Exit 0 = PASS.
Useful flags:
- `--no-flash` reuse the already-flashed firmware
- `--duration N` capture window seconds
- `--tx-power N` configured SX1262 dBm (-9..14; FEM adds gain!)
- `--delay MS` repeat delay (20..200)
- `--gain G` SDR tuner gain
- `--min-repeats N` PASS threshold
## Artifacts
Each run writes `captures/<timestamp>-hil/`:
```
serial.log DUT JSON-lines (wmbus_rx / wmbus_tx / heartbeats / stats)
rtlwmbus.log rtl_wmbus decodes
report.json machine-readable correlation result
report.txt human-readable report
setup.log DUT configuration acks
```
## Manual pieces
```
./tools/discover_devices.sh -v # device inventory
./tools/flash.sh # build + flash
./hil/capture_sdr.sh 60 /tmp/sdr.log # SDR-only capture
./result-py/bin/python3 hil/dut_cmd.py PORT --listen 10 status stats
./result-py/bin/python3 hil/iq_energy.py iq.raw # burst energy probe
./result-py/bin/python3 hil/iq_spectrum.py iq.raw # spectrum sanity
```
## DUT serial commands
```
status | stats | clear_stats | radio_status | radio_reset | test_tx
set repeat_delay_ms N | set tx_power N | set repeat_enabled 0|1
set verbose 0|1 | set whitelist ID[,ID...] | set whitelist clear | reboot
```
## Known pitfalls
- SDR PLL wedge -> gain-independent white noise; `usbreset 0bda:2838`.
- Never wrap the rtl pipeline in `timeout bash -c` (orphans children);
apply timeout to `rtl_sdr` itself.
- ESP32-S3 USB re-enumerates between app CDC and ROM bootloader; flash
scripts rediscover the port on failure.