diff --git a/obu-firmware/docs/overnight-bench-test.pdf b/obu-firmware/docs/overnight-bench-test.pdf index d8ec85f..723c941 100644 Binary files a/obu-firmware/docs/overnight-bench-test.pdf and b/obu-firmware/docs/overnight-bench-test.pdf differ diff --git a/obu-firmware/docs/overnight-bench-test.tex b/obu-firmware/docs/overnight-bench-test.tex index 752bfee..9d02c34 100644 --- a/obu-firmware/docs/overnight-bench-test.tex +++ b/obu-firmware/docs/overnight-bench-test.tex @@ -25,7 +25,7 @@ \begin{document} {\Large\bfseries\color{ink} Overnight bench test of the micrOBU firmware}\par \smallskip -Status: 2026-11-25. Scripts: \cmd{obu-firmware/test/bench}. Companion documents: \cmd{obu-firmware/test/bench/README.md}, \cmd{obu-firmware/test/host/README.md}, \cmd{obu-firmware/FLASHING.md}.\par +Revision 2, status 2026-11-27. Scripts: \cmd{obu-firmware/test/bench}.\newline Companion documents: \cmd{obu-firmware/test/bench/README.md}, \cmd{obu-firmware/test/host/README.md},\newline\cmd{obu-firmware/FLASHING.md}.\par \section*{1\quad Purpose} The test checks the integrity and function of \cmd{obu-firmware} on a real board over many hours, without a phone. A PC plays the phone over the USB station link, drives every kind of request, resets and reconfigures the board, listens to the air, and watches the board's own counters and heap. A second, board-free part runs the PC-side C tests and a long fuzz of the receive parser. @@ -45,7 +45,7 @@ Every run starts and ends with the conformance stage, so drift shows as a differ \begin{longtable}{@{}P{30mm}P{132mm}@{}} \toprule\textbf{Stage} & \textbf{What it checks}\\\midrule\endhead conformance & about 100 checks of the link protocol against the specification and the firmware source: opcodes, malformed lengths, fragment reassembly (1536-octet requests, gaps, 2\,s timeout, 8 pending), CRC and resynchronisation, configure and POTI, BTP requests, stale requests, counter wrap.\\ -soak-unsigned & BTP requests at 4\,Hz, payload 24 to 1480 octets in turn (494 and 495 are the V2X\_RX edge). Every accepted request must leave the radio byte for byte, with the MAC the phone named. 40 refusals (\cmd{resource\_limit}) in a row end the phase as ``transmit path wedged'', and a repeated configure is tried.\\ +soak-unsigned & BTP requests at 4\,Hz, payload 24 to 1480 octets in turn (494 and 495 are the V2X\_RX edge). Every accepted request must reach the radio driver byte for byte, with the MAC the phone named. 40 refusals (\cmd{resource\_limit}) in a row end the phase as ``transmit path wedged'', and a repeated configure is tried.\\ soak-signed & the same at 3\,Hz up to 1200 octets, signed with the demo chain; \cmd{sign\_failed} must stay 0.\\ raw-toggle & \cmd{RAW\_CAPTURE} modes 0x00, 0x01, 0x03, 0x05, 0x07 in turn: copies of the station's own frames must appear exactly in the modes with the own-TX bit.\\ reconfigure & \cmd{STATION\_CONFIGURE} every second or two with a new MAC, security on or off, radio TX+RX or RX only; the next frame must carry the new MAC and security.\\ @@ -53,11 +53,11 @@ fuzz & the board is reset, then seeded random frames are sent while it is unconf resets & the port is reopened five times; each time the board must boot, come back unconfigured, configure and transmit.\\ idle-listen & radio receive-only, STATUS once a second; counts what else is on the air and checks the receive queue never overflows.\\\bottomrule \end{longtable} -\textbf{How a transmitted frame is proven.} One board has no second receiver, so the test uses \cmd{RAW\_CAPTURE} mode 0x05: every frame the station submits to the radio is copied back over the link. The copy is unwrapped by a Python port of \cmd{gn\_unwrap.c} written separately from the firmware, and its ITS payload is compared with what was sent. The payload carries its own size and CRC-32. This does not prove that another station can hear the frame. +\textbf{How a transmitted frame is checked.} One board has no second receiver, so the test uses \cmd{RAW\_CAPTURE} mode 0x05: every frame the station submits to the radio is copied back over the link. The copy is unwrapped by a Python port of \cmd{gn\_unwrap.c} written separately from the firmware, and its ITS payload is compared with what was sent. The payload carries its own size and CRC-32. The copy is made when the radio driver \emph{accepts} the frame, not when it reports the transmission complete, so it proves neither that the frame went on the air nor that another station can hear it (section 7). The driver's completion count is in \cmd{device.log} (\cmd{TX observation: submitted= completed=}); the test does not check it yet. \textbf{On the air.} Transmit phases send at most 4 frames per second at 5\,dBm on channel 180. The payload is a made-up ItsPduHeader with messageID \cmd{0xF1}, which is not an assigned ETSI message, so receivers refuse it. MACs are locally administered, \cmd{02:b3:0a:ce:xx:xx}. \cmd{--no-tx} keeps the radio silent. -\textbf{PC-side tests} (\cmd{run\_host\_tests\_overnight.ps1}, no board): \cmd{make check} of \cmd{test/host} (chain test, replay of recorded captures, fuzz, battery policy, 40 firmware unit tests, fragments), then the \cmd{gn\_unwrap} fuzzer with new seeds until the time is up. A \cmd{CRASH} line or a non-zero exit is a failure. +\textbf{PC-side tests} (\cmd{run\_host\_tests\_overnight.ps1}, no board): \cmd{make check} of \cmd{test/host} (chain test, replay of recorded captures, fuzz, battery policy, firmware unit tests, fragments), then the \cmd{gn\_unwrap} fuzzer with new seeds until the time is up. A \cmd{CRASH} line or a non-zero exit is a failure. The script's search for that line currently also matches ``no crash'' (section 7). \section*{4\quad Running it} Close everything that holds the port, run \cmd{git pull}, then from the repository root: @@ -93,10 +93,51 @@ Not in git, so absent on a fresh checkout: \cmd{its-g5-receiver-firmware/recordi Results go to \cmd{obu-firmware/test/results/overnight-