Commit Graph
41 Commits
Author SHA1 Message Date
goebish 91199e146e Compute xn297 whitening instead of using an hardcoded array (#1201)
* Compute xn297 whitening instead of using an hardcoded array

* Add function to scramble byte for XN297 interface

* Refactor XN297 scrambling logic to use a global LFSR and improve byte generation

* Add technical specification and implementation details for XN297 whitening and CRC
2026-10-25 16:57:07 +01:00
Raphael Coeffic d3293afdab HoTT, XN297 emu: compute the hop and CRC xorout tables (-1.2 KB) (#1199)
* HoTT: compute the hop table from the hop value (-1 KB)

The 16 hop tables are generated from the 16 bit value sent in packet[0..1]:
the C library rand() LCG (low 16 bits: x = x * 0x4E6D + 0x3039) seeded with
it drives forward Fisher-Yates shuffles, first of the order of the 5 bands of
15 channels, then of the channels of each band, hop i being in the band at
position i%5. This gives back the 16 tables bit for bit, and for any seed a
75 channel permutation with the same band structure.

* XN297 emu: compute the CRC xorout instead of the 4 tables

The XN297 CRC is CRC-16/CCITT with init 0xFFFF and xorout 0xFFFF over the
unscrambled address, pcf and payload, sent scrambled. The emulation computes
it from 0xB5D2 over the bits as sent, so the xorout for a CRC over n bits is
CRC(init 0xFFFF^0xB5D2) of n scramble (or zero) bits, xor 0xFFFF, xor the 16
scramble bits at the CRC. The scramble bits come from the LFSR behind
xn297_scramble[] (1110001, then s[i] = s[i-7] ^ s[i-3]), which also covers
the last enhanced entries, past the end of that table. It is the generator
Goebish gave for the scramble sequence in a comment on
https://mcumix.blogspot.com/2016/07/reverse-engineering-24ghz-rf-chip-xn297.html
(seed 0x71, feedback bit 6 ^ bit 2, MSB first).

All the entries of the 4 tables are given back but two: entry 0 (3 byte
address, no payload) was a 0 placeholder, and scrambled entry 1 (3 byte
address, 1 byte payload) was 0x3448 where the formula gives 0xE348.
2026-10-23 12:02:20 +02:00
pascallanger bb59582271 Update XN297Dump_nrf24l01.ino 2026-07-14 18:46:54 +02:00
pascallanger 0e5834a457 Update XN297Dump_nrf24l01.ino 2025-01-15 12:46:28 +01:00
pascallanger 190ebaefd4 Update XN297Dump_nrf24l01.ino 2025-01-13 20:22:14 +01:00
pascallanger e05bc7c447 Update XN297Dump_nrf24l01.ino 2025-01-07 15:11:32 +01:00
pascallanger f35be2984a SLT try 1d 2024-04-14 13:29:28 +02:00
pascallanger 7ddeb31e95 SLT try 1c 2024-04-14 13:23:50 +02:00
pascallanger 7444c44b48 SLT try 1b 2024-04-13 10:22:39 +02:00
pascallanger 08d1dcbed2 SLT try 1a 2024-04-12 18:24:50 +02:00
pascallanger 3e4f4e36c1 SLT try 1 2024-04-12 18:20:01 +02:00
pascallanger 0a0463652b E129/C186 protocol
C186/E120 models
2022-06-27 16:59:48 +02:00
Pascal Langer ae748e25f8 Update XN297Dump_nrf24l01.ino 2021-09-07 23:17:21 +02:00
Pascal Langer 2501656bf4 Update XN297Dump_nrf24l01.ino 2021-08-26 11:52:36 +02:00
Pascal Langer 9356e7654e XN297EMU: allows to send and receive 0 payload length in enhanced mode 2021-08-25 19:07:36 +02:00
Pascal Langer c52ac2cefc Fix XN297Dump enhanced payload detection 2021-06-28 18:04:17 +02:00
Pascal Langer 51a3ef8ee9 Update XN297Dump_nrf24l01.ino 2021-05-01 18:45:20 +02:00
Pascal Langer b9028ab4b4 XN297Dump: CC2500 dump @250K 2021-05-01 18:15:34 +02:00
Pascal Langer 4a626eaf14 Change XN297 emulation layer
Loads of protocols have been touched by this change. Some testing has been done but please test on all your models.
The XN297 emulation selects in this order:
 - the CC2500 if it is available and bitrate=250K. Configure the option field automatically for RF tune.
 - the NRF for all bitrates if it is available
 - if NRF is not available and bitrate=1M then an invalid protocol is sent automatically to the radio.
CC2500 @250K can now receive normal and enhanced payloads.
OMP protocol supports telemetry on CC2500 and is also for NRF only modules including telemetry.
Separation of E016H (new protocol) from E01X due to different structure.
MJXQ, MT99XX, Q303 and XK: some sub protocols available on CC2500 only.
2021-03-17 17:05:42 +01:00
Pascal Langer 0270420531 XN297dump: increase polling 2021-02-12 19:05:39 +01:00
Pascal Langer 29d1fb00b1 More code optimization 2021-02-12 11:21:42 +01:00
Pascal Langer 3b8b2ef376 Protocol init function modified 2021-02-09 18:23:33 +01:00
Pascal Langer 5aae065dc0 New protocol: E129 2021-01-16 15:45:19 +01:00
Pascal Langer 8338104266 Update XN297Dump_nrf24l01.ino 2021-01-11 12:37:58 +01:00
Pascal Langer 321e4aee34 E016H v2: new protocol WIP only 1 ID 2020-12-17 18:05:04 +01:00
Pascal Langer 1408431649 XN297Dump: increase the number of RF channels to look for 2020-08-10 22:52:50 +02:00
Pascal Langer 890a042a43 V2X2 new sub proto MR101 and protocol rewrite
MR101 sub proto for Dromida XL
2020-06-20 21:40:03 +02:00
Pascal Langer 90b287f1f4 Multi 5-in-1 initial support 2020-06-06 01:57:52 +02:00
Pascal Langer 0d97af5ae2 XN297dump: Auto mode small fix 2020-06-02 14:34:50 +02:00
Pascal Langer 693f9f58eb V911S: new sub protocol E119
Model: Eachine E119
Protocol: V911S -> 46
Sub protocol: E119 -> 1
CH5: left button ???
CH6: right button ???
2020-02-16 20:05:29 +01:00
pascallanger 86778c5997 XN297Dump: new auto mode
Automatically:
 - find XN297L packet -> bitrate, scrambling, enhanced...
 - use address to filter incoming packets
 - find all frequencies
 - determine channel order (basic)
 - help to find out the changes by only displaying packets when there is a change in the packet
2020-01-12 13:16:30 +01:00
pascallanger dad3282bbb XN297Dump RF channel display 2019-11-09 19:26:31 +01:00
Pascal Langer 4e906757b9 XN297Dump fix enhanced unscramble mode 2019-08-24 22:39:27 +02:00
Pascal Langer d4e77c6499 XN297Dump: added enhanced packet mode 2019-08-24 21:37:26 +02:00
Pascal Langer 23756a387a XN297Dump: fix packet timer 2019-07-03 20:51:13 +02:00
Pascal Langer ded0487ce6 XN297Dump improvements
Selection of address length
Timing accuracy
2019-06-04 21:41:50 +02:00
Pascal Langer 18dcc29a0d XN297Dump: auto scramble detection 2019-05-17 20:34:02 +02:00
Pascal Langer c3a5c263d3 XN297Dump fix CRC... 2019-05-17 19:56:52 +02:00
Pascal Langer ccdf60d525 XN297DUMP: dynamic address search
The dump process is now looking for addresses with different length (3..5) additonnaly to the packet length.
Untested...
2019-05-17 17:00:08 +02:00
Pascal Langer 511f77f5e7 Bayang DHD D4 sub protocol 2019-05-09 18:23:19 +02:00
Pascal Langer 6748f6ce78 Add XN297 Dump protocol
Protocol number: 63
Sub protocols: 0=250Kb, 1=1Mb, 2=2Mb
Option: -1=scan RF channels, 0-84=RF channel
DEBUG_SERIAL must be enabled
If a valid frame is received the frame will be sent on the serial port.
2019-05-08 22:01:24 +02:00