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
+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.