Commit Graph

2 Commits

Author SHA1 Message Date
Tony Cao
e032f31392 feat(rfm): PCI-5565 reflective memory via VFIO/kernel-driver, ping/echo/bridge modes
- src/rfm.rs: dual backend (rfm2g chardev /dev/rfm2g0 or vfio-pci BAR mmap),
  mailbox protocol (REQ@0x0/REP@0x1000, seq release/acquire)
- --mode rfm-ping: periodic REQ write + spin-wait REP, same-clock RTT histogram
- --mode rfm-echo: REQ->REP reflector; CX frames (>=280B) get f(x)=x*7+3
  transform so PLC echo check passes through the RFM hop
- --mode rfm-bridge: EL6695 RX -> RFM -> remote J1900 processing -> EL6695 TX
  with per-second bridge counters and rfm_hop_rtt stats (end-to-end
  CX->EL6695->D2000->RFM->x86 latency measurement)
- OnlineStats: public mean() accessor
2026-09-20 13:03:16 +08:00
Tony Cao
21b2d3bf99 J1900 <-> TwinCAT 1 kHz verification over EL6695 bridge
Re-implementation of rustbootd's ecat_el6695_* examples as a single binary
with fixes found in review and on hardware:

- DC-follow PLL hardened against period-2 hunting: slew-limited anchor
  (+/-50us/cycle), bistable-trap snap re-anchor, re-prime on stale deadline
- drift-free absolute-grid ticker mode; probe mode for timestamp forensics
- bounded-memory online stats (histograms), graceful SIGINT/SIGTERM shutdown
  with full report, error-streak abort
- timestamp plausibility filter comparing against the previous raw sample
  (avoids the deadlock after a startup outlier)
- XFC scope waveform options: --el2202 (with --el2202-dual), --el2262,
  --el1252 latch timestamp readback with per-channel edge statistics
- register access unified in regs.rs: named bit constants everywhere,
  read-modify-write for enable/activation bytes
- vendored patched ethercrab 0.7.1 (sdo_write_complete, send_raw_coe)

Verified on J1900 (PREEMPT_RT 6.6.135): 600k cycles/600s exact 1 kHz,
tx/rx zero errors, phase_err p50=164us std=5us; EL2202<->EL1252 loopback
edge interval mean 2000.24us std=24.65us.
2026-07-22 08:55:41 +08:00