Files
STM32F4-Base/MDK-ARM/retracted_bench_20260922/probe_boundary.py
T

29 lines
988 B
Python

# Battery A (boundary scan): 64x10 + 1460 + 4096 (two 2KB fills) + 0.25s + tail 64x10.
# The firmware probe (net_recv(64)) fires ~45+D ms after the fill1 full drain;
# if it lands on a refilled buffer it EATS 64B at pattern offset 2048 of the 4096 block
# (no echo for those bytes). probe_classify.py rebuilds the expected stream using the
# actual eaten count logged on the device serial line "probe: recv64 n=%d".
from probe_bench_lib import *
def main():
s = connect()
if not send_rounds64(s, 10, 0, "R"):
finish(s, 1)
b1460 = pattern(640, 1460)
s.sendall(b1460)
rx, stalled = wait_step(s, 1460, "B1460", 3.0)
if stalled or rx != b1460:
hexdump(rx)
finish(s, 1)
f4096 = pattern(2100, 4096)
s.sendall(f4096)
time.sleep(0.25)
tail_base = 2100 + 4096
for i in range(10):
s.sendall(pattern(tail_base + i * 64, 64))
rx, stalled = wait_step(s, 4736, "F4096+TAIL", 4.0)
hexdump(rx)
finish(s, 0)
main()