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. |
||
|---|---|---|
| .. | ||
| init-must-be-send.rs | ||
| README.md | ||
| replay-dc.pcapng | ||
| replay-dc.rs | ||
| replay-ek1100-alias-address.pcapng | ||
| replay-ek1100-alias-address.rs | ||
| replay-ek1100-el2828-el2889.pcapng | ||
| replay-ek1100-el2828-el2889.rs | ||
| replay-ek1914-el3004-configure.pcapng | ||
| replay-ek1914-el3004-configure.rs | ||
| replay-ek1914-el3004-mailbox.pcapng | ||
| replay-ek1914-el3004-mailbox.rs | ||
| replay-ek1914-no-complete-access.pcapng | ||
| replay-ek1914-no-complete-access.rs | ||
| replay-ek1914-segmented-upload.pcapng | ||
| replay-ek1914-segmented-upload.rs | ||
| replay-issue-255.pcapng | ||
| replay-issue-255.rs | ||
| util.rs | ||
Integration tests
Uses Wireshark captures of known-good runs as replays to test for regressions against.
Capturing replays
Captures should be run in debug mode to make sure everything has time to breathe. If this is not done, the replays can fail in weird and confusing ways.
With just
From the repository root, run e.g.
just capture-replay replay-ek1100-el2828-el2889 enx00e04c680066
The replay name must exactly match the name of a file in tests/ (without the .rs) extension.
Debian users may need to run:
sudo apt install psmisccargo install fd-find
Note that the Debian apt package fd-find installs the binary as fd-find, however the script
looks for just fd. Installing with cargo doesn't present this issue.
Manually on local machine (terminal method)
sudo apt install -y tshark
Then e.g.
tshark -w tests/replay-ek1100-el2828-el2889.pcapng --interface enp2s0 -f 'ether proto 0x88a4'
Remote machine (GUI method)
On remote machine from project root e.g.
ssh ethercrab 'sudo tcpdump -U -i enp2s0 -w -' | wireshark -f 'ecat' -i - -w ./tests/replay-ek1100-el2828-el2889.pcapng -k
Then run the test using real interface e.g.:
INTERFACE=enp2s0 just linux-test replay
Filtering captured replays
Use tshark to filter out only EtherCAT packets from provided dumps:
tshark -r EL1014.pcapng -Y 'ecat' -w issue-63-el1014.pcapng
This isn't required if the original capture is filtered with -f 'ether proto 0x88a4'.