ExampleTCPIP is a hardware stress example for:
ServerSocket(TCP server)Socket(TCP client from board to host)DatagramSocket(UDP)Serverconnection manager
It includes command/control, payload integrity checks (checksum), burst/saturation traffic, forced disconnect/reconnect and UDP probe/ack.
Control command IDs used by the host script:
CMD_RESET=1CMD_PING=2CMD_GET_STATS=3CMD_FORCE_DISCONNECT=4CMD_BURST_SERVER=5CMD_BURST_CLIENT=6CMD_FORCE_CLIENT_RECONNECT=7CMD_GET_HEALTH=8(paged telemetry)CMD_RESET_HEALTH=9
Build with Ethernet enabled and EXAMPLE_TCPIP defined.
Example (board + KSZ8041):
./hyper build tcpip --preset board-debug-eth-ksz8041 --extra-cxx-flags "-DTCPIP_TEST_HOST_IP=192.168.1.9"Example (nucleo + LAN8742):
./hyper build tcpip --preset nucleo-debug-eth --extra-cxx-flags "-DTCPIP_TEST_HOST_IP=192.168.1.9"Notes:
TCPIP_TEST_HOST_IPmust be the IPv4 of your laptop on the same Ethernet segment.- Defaults (if not overridden in compile flags):
TCPIP_TEST_BOARD_IP="192.168.1.7"- TCP server port:
40000 - TCP client local/remote ports:
40001/40002 - UDP local/remote ports:
40003/40004
Flash the latest build with:
./hyper flashThen power-cycle or reset the board if needed.
One-shot automation (build + flash + ping + tests):
./tools/run_example_tcpip_nucleo.sh \
--iface en6 \
--board-ip 192.168.1.7 \
--base-runs 1 \
--aggr-runs 0./tools/run_example_tcpip_stress.sh --board-ip 192.168.1.7 --host-bind 192.168.1.9Useful options:
--host-bind 0.0.0.0--tcp-server-port 40000--tcp-client-port 40002--udp-local-port 40003--udp-remote-port 40004--good-payloads 1200--bad-payloads 200--min-payload-rx-ratio 0.90--min-bad-detect-ratio 0.80--payload-interval-us 800(set0for max blast / likely RX overrun testing)--server-burst 800--client-burst 800--min-server-burst-ratio 0.95--min-client-burst-ratio 0.95--udp-count 300--strict-client-stream(maketcp_client_streama hard fail instead of warning)--health-pages 6--reset-health--health-at-end--no-health-on-fail
- TCP command/response path (
PING) - TCP payload integrity under load (good + bad checksum packets)
- Forced disconnect and reconnect
- TCP server burst stream reception
- UDP probe/ack response ratio and board-reported counters
- Board TCP client stream reception on host-side sink
CMD_GET_HEALTH returns three values per page:
page 0:uptime_ms,loop_iterations,tcp_commands_rxpage 1:tcp_payload_rx,tcp_payload_bad,tcp_responses_txpage 2:tcp_client_tx_ok,tcp_client_tx_fail,tcp_client_send_fail_streak_maxpage 3:tcp_server_recreate_count,tcp_client_recreate_count,tcp_client_reconnect_callspage 4:reason_last,reason_arg_last,reason_update_countpage 5:server_burst_requested_max,client_burst_requested_max,tcp_client_not_connected_ticks
Current reason codes:
0: none/reset1: boot2: force-disconnect command3: server recreate4: client recreate by command5: client recreate watchdog6: client reconnect poll7: client send fail streak started
Strict matrix (base + aggressive):
./tools/example_tcpip_quality_gate.sh \
--board-ip 192.168.1.7 \
--host-bind 192.168.1.9 \
--base-runs 20 \
--aggr-runs 5 \
--health-at-endThis script stores all logs in out/quality-gate/<timestamp>/.
Useful flags:
--health-pages 6--health-at-end--stop-on-first-fail
Long-running soak with automatic pass/fail summary:
./tools/example_tcpip_soak.sh \
--board-ip 192.168.1.7 \
--host-bind 192.168.1.9 \
--duration-min 480 \
--strict-client-stream \
--health-pages 6 \
--max-failures 1This script stores all logs in out/soak/<timestamp>/.
Use the long-run wrapper to execute for hours and get final pass ratio + fail breakdown:
./tools/example_tcpip_soak_hours.sh \
--board-ip 192.168.1.7 \
--host-bind 192.168.1.9 \
--hours 8 \
--min-pass-ratio 0.90 \
--baseline-pass-ratio 0.8475Outputs:
- Run console/session log:
out/soak-hours/<timestamp>.log - Per-run logs from soak engine:
out/soak/<timestamp>/
To leave it running in background:
nohup ./tools/example_tcpip_soak_hours.sh --board-ip 192.168.1.7 --host-bind 192.168.1.9 --hours 8 > out/soak-hours/latest.nohup.log 2>&1 &