HIL harness, docs, SDR PLL-wedge workaround; firmware flashed and in RX

This commit is contained in:
Lars Nolden
2026-08-31 22:23:26 +02:00
parent 5b46f647f6
commit 3b8547fb8a
13 changed files with 727 additions and 1 deletions
+80
View File
@@ -0,0 +1,80 @@
# Hardware
## Board
```
Board: Heltec WiFi LoRa 32 V4.3
Model: HTIT-WB32LAF
MCU: ESP32-S3 (16 MB flash, 2 MB PSRAM)
Radio: Semtech SX1262
FEM: KCT8103L (868-928 MHz high-power variant)
```
DUT USB identity (native ESP32-S3 USB):
- factory Arduino firmware enumerates as `usb-Espressif_Systems_heltec_wifi_lora_32_v4__16_MB_FLASH__2_MB_PSRAM__F85B1BA1F86C-if00`
- our ESP-IDF firmware / ROM bootloader enumerate as `usb-Espressif_USB_JTAG_serial_debug_unit_F8:5B:1B:A1:F8:6C-if00`
`tools/discover_devices.sh` handles both.
## SX1262 pin mapping — DOCUMENTED + EXPERIMENTALLY VERIFIED
```
SX1262:
NSS GPIO8
SCK GPIO9
MOSI GPIO10
MISO GPIO11
RESET GPIO12
BUSY GPIO13
DIO1 GPIO14
```
Verified: SPI register write/readback passes and GFSK RX runs
(`radio_init` diagnostic: `spi:true, reset:true, tcxo:true`, heartbeat
`chip_mode:5` = RX with plausible RSSI). See docs/FINDINGS.md.
Sources:
- Heltec product manual / wiki, "WiFi LoRa 32 V4":
https://wiki.heltec.org/docs/devices/open-source-hardware/esp32-series/lora-32/wifi-lora-32-v4/
- Heltec schematic: https://resource.heltec.cn/download/WiFi_LoRa_32_V4/Schematic/HTIT-WB32LAF_V4.3.pdf
- RNode_Firmware 1.86 board table via jrl290/RTNode-HeltecV4 `Boards.h`
(working firmware for this exact board):
https://github.com/jrl290/RTNode-HeltecV4
## KCT8103L FEM — DOCUMENTED + EXPERIMENTALLY VERIFIED
```
FEM:
POWER GPIO7 supply enable, drive HIGH
CSD GPIO2 chip enable, drive HIGH (internal pull-up on KCT8103L)
CTX GPIO5 path select: LOW = RX/LNA, HIGH = TX/PA
CPS -- wired to SX1262 DIO2 (enable DIO2-as-RF-switch)
```
Notes:
- V4.2 boards use a GC1109 FEM with different control (CSD + CPS, CTX on
DIO2). Do NOT copy V4.2 configuration.
- RNode 1.86 auto-detects the FEM by reading CSD as input after powering
the FEM: KCT8103L pulls HIGH, GC1109 pulls LOW.
- After TX, CTX must be driven LOW again or the FEM stays in TX-bypass and
RX is dead (documented failure mode in RTNode sx126x.cpp).
## TCXO — DOCUMENTED (RNode 1.86), verified working
- DIO3-controlled TCXO, 1.8 V (`SetDIO3AsTCXOCtrl` code 0x02), ~4 ms start.
- After enabling the TCXO, recalibrate all blocks or `XOSC_START_ERR`
persists in device errors.
- OCP register set to 0x28 (RNode 1.86 "OCP_TUNED" for the V4 PA chain).
## SDR
```
Nooelec NESDR SMArt v5
RTL2832U + R820T, USB ID 0bda:2838, serial 33999948
```
Quirk (EXPERIMENTALLY VERIFIED): the R820T PLL can wedge ("PLL not
locked"), after which captures contain gain-independent white noise on any
frequency. A USB reset (`usbreset 0bda:2838`) recovers it. The HIL runner
resets the dongle before each session. Suspected trigger: `rtl_test -t`'s
direct-sampling probe. Avoid `rtl_test -t` in automation.
+58
View File
@@ -0,0 +1,58 @@
# RF Configuration — Wireless M-Bus C1 (mode C, meter-to-other)
## PHY parameters (EN 13757-4, cross-checked against rtl-wmbus source)
```
Frequency: 868.95 MHz
Chip/bit rate: 100 kbps NRZ (mode C is NOT 3-of-6 coded, unlike T)
Deviation: +/-45 kHz nominal
Preamble: alternating 01 chips
Sync: 0x543D (shared T/C access code)
Mode bytes: 0x54CD -> frame format A, 0x543D -> frame format B
```
Authority used:
- rtl-wmbus source (`t1_c1_packet_decoder.h`): `ACCESS_CODE_T1_C1 0x543d`,
`C1_MODE_A 0b010101001100`, `C1_MODE_B 0b010101000011`, trailer `0b1101`
— concatenated this yields sync sequences 0x543D54CD (A) / 0x543D543D (B).
- Frame lengths (over-the-air, incl. L and CRCs):
- format A: `1 + L + 2*((L-10+15)/16 + 1)`
- format B: `1 + L`
## SX1262 register-level configuration (firmware/main/sx126x.c)
```
Packet type: GFSK
Bitrate: raw 0x002800 (32*32e6/100e3 = 10240 -> 100 kbps)
Deviation: raw 0x00B852 (45e3*2^25/32e6 = 47186)
Shaping: none (plain 2-FSK; may experiment with BT=0.5)
RX bandwidth: 234.3 kHz DSB (code 0x0A) -- signal occupies ~190 kHz
Sync word: 0x543D, 16 bits; mode bytes handled as payload so RX and
TX share one configuration
Preamble TX: 48 bits
Preamble det: 8 bits
Length mode: fixed, 255-byte capture, truncated in software using the
L-field formulas above (SX1262 variable-length mode cannot
express wM-Bus length semantics)
CRC: radio CRC off; EN 13757 CRC-16 (poly 0x3D65, complemented)
validated per block in software
Whitening: off
RX gain: boosted (reg 0x08AC = 0x96)
TX params: default -9 dBm configured (min), ramp 40 us; PA config
(0x02,0x02,0x00,0x01) = +14 dBm-optimal table, deliberately
capped -- the external KCT8103L PA adds gain on top
```
## Consequences of the fixed-255-byte RX capture
RxDone fires ~ (255 - frame_len) * 80 us after the actual end of frame;
the firmware reconstructs the true end-of-frame timestamp. During that
tail the receiver cannot re-arm sync search, adding up to ~20 ms of dead
time per frame. Acceptable for the experiment; optimization candidate
(GetRxBufferStatus polling with early stop).
## TX power
Configured SX1262 power is NOT radiated power: the KCT8103L PA follows.
Development default is the SX1262 minimum (-9 dBm). Log lines carry
`configured_tx_dbm` to keep this distinction explicit.
+18
View File
@@ -0,0 +1,18 @@
# Standards Gaps — experimental shortcuts vs EN 13757 / OMS
This firmware is an RF feasibility experiment, NOT a standards-compliant
repeater. Known deviations:
| # | Experimental behavior | Standard requirement |
|---|---|---|
| 1 | Repeats the raw telegram bit-exact, including hop-related fields | EN 13757-5 repeaters must manage the hop counter / C-field semantics so telegrams are not repeated endlessly |
| 2 | Fixed development repeat delay 20-200 ms (default 50 ms) | OMS repeaters use randomized delays in the seconds range to avoid collisions |
| 3 | Repeats every CRC-valid C1 telegram (optional dev whitelist) | Real repeaters filter by installation list |
| 4 | No duty-cycle accounting | EU 868.95 MHz band has duty-cycle limits (1% for 868.7-869.2 sub-band per ERC 70-03); a production repeater must budget its TX time |
| 5 | Duplicate suppression is a 2.5 s hash ring | Standard requires proper duplicate/loop protection semantics |
| 6 | No AES, no decryption, payload treated as opaque | OMS security profiles apply to end devices; a transparent repeater may pass ciphertext, but production behavior needs review |
| 7 | T1 telegrams are detected (shared 0x543D sync) but dropped | A combined C/T repeater would need 3-of-6 decode/encode |
| 8 | Format B frames >128 bytes CRC-checked but rare path untested | -- |
None of these shortcuts may be carried into the production Solenos/Gebos
gateway without explicit review.
+13
View File
@@ -0,0 +1,13 @@
signal,device,gpio,direction,voltage,interrupt,timing_critical,test_point_required,header_required,reason
WMBUS_NSS,SX1262,8,output,3.3,false,true,true,true,SPI decode of radio commands during bring-up
WMBUS_SCK,SX1262,9,output,3.3,false,true,true,true,SPI decode
WMBUS_MOSI,SX1262,10,output,3.3,false,true,true,true,SPI decode
WMBUS_MISO,SX1262,11,input,3.3,false,true,true,true,SPI decode
WMBUS_RESET,SX1262,12,output,3.3,false,false,true,true,radio recovery verification
WMBUS_BUSY,SX1262,13,input,3.3,false,true,true,true,command-timing and stuck-BUSY debugging
WMBUS_DIO1,SX1262,14,input,3.3,true,true,true,true,RX/TX IRQ latency measurement
FEM_PWR_EN,KCT8103L,7,output,3.3,false,false,true,true,FEM power sequencing verification
FEM_CSD,KCT8103L,2,output,3.3,false,false,true,true,FEM enable + board-revision detection (pull level)
FEM_CTX,KCT8103L,5,output,3.3,false,true,true,true,RX/TX path switch timing vs TX start
ESP_USB_DN,ESP32-S3,19,bidir,3.3,false,false,false,true,flash/console; must stay accessible
ESP_USB_DP,ESP32-S3,20,bidir,3.3,false,false,false,true,flash/console
1 signal device gpio direction voltage interrupt timing_critical test_point_required header_required reason
2 WMBUS_NSS SX1262 8 output 3.3 false true true true SPI decode of radio commands during bring-up
3 WMBUS_SCK SX1262 9 output 3.3 false true true true SPI decode
4 WMBUS_MOSI SX1262 10 output 3.3 false true true true SPI decode
5 WMBUS_MISO SX1262 11 input 3.3 false true true true SPI decode
6 WMBUS_RESET SX1262 12 output 3.3 false false true true radio recovery verification
7 WMBUS_BUSY SX1262 13 input 3.3 false true true true command-timing and stuck-BUSY debugging
8 WMBUS_DIO1 SX1262 14 input 3.3 true true true true RX/TX IRQ latency measurement
9 FEM_PWR_EN KCT8103L 7 output 3.3 false false true true FEM power sequencing verification
10 FEM_CSD KCT8103L 2 output 3.3 false false true true FEM enable + board-revision detection (pull level)
11 FEM_CTX KCT8103L 5 output 3.3 false true true true RX/TX path switch timing vs TX start
12 ESP_USB_DN ESP32-S3 19 bidir 3.3 false false false true flash/console; must stay accessible
13 ESP_USB_DP ESP32-S3 20 bidir 3.3 false false false true flash/console