This repository includes a stress-test suite ported from libcsp_rust, supporting both Linux (SocketCAN) and STM32 (Embassy).
Ensure you have vcan0 or a real CAN interface up:
sudo ip link add dev vcan0 type vcan
sudo ip link set vcan0 upOpen two terminals.
Terminal 1 (Receiver):
cargo run --example stress_rx -- vcan0Terminal 2 (Sender):
cargo run --example stress_tx -- vcan0The tests will automatically cycle through:
- Normal: Connectionless / UDP-like transfers.
- RDP: Reliable Datagram Protocol connections.
- SFP: Simple Fragmentation Protocol for large blobs.
- RDP + SFP: Reliable fragmented transfers.
The embassy-example project provides two binaries for stress testing.
The STM32 acts as a server, verifying incoming PRNG data from a Linux sender.
cd embassy-example
cargo build --release --bin stress_rx
probe-rs run --chip STM32L4R5ZITx target/thumbv7em-none-eabihf/release/stress_rxThe STM32 acts as a client, cycling through modes and sending PRNG data to a Linux receiver.
cd embassy-example
cargo build --release --bin stress_tx
probe-rs run --chip STM32L4R5ZITx target/thumbv7em-none-eabihf/release/stress_txConnect your STM32 CAN pins (PA11/PA12) to a CAN transceiver (e.g. SN65HVD230) and then to your Linux CAN interface.
Run Linux Sender:
cargo run --example stress_tx -- can0The STM32 will verify incoming PRNG data and log statistics via RTT.
- PRNG Seed:
0x12345678(Deterministic verification). - Data Port: 10.
- SFP Port: 11.
- MTU: 200 bytes.
- CAN Bitrate: 1 Mbps (Adjust in
main.rsand Linuxip link).