tan reset [--pulse-ms 100] [--probe-usb-path 3-4.2 | --probe-serial SN] [--jlink PATH] \
[--confirm-console PORT --expect REGEX [--confirm-baud 115200] [--confirm-timeout 30] [--confirm-window 3]] \
[--format json]
JLINK_RUN_PLACE=aen-evk-02 tan reset --probe-usb-path 3-4.2The recovery from a non-waking STOP on the AEN bench is one clean pin pulse.
tan reset sends exactly this J-Link Commander session and nothing else (the one
extra line is a leading exec DisableAutoUpdateFW, which keeps the probe's firmware
from being rewritten mid-bench; it is in data.script and the temp Commander file,
exactly as for tan flash and tan probe):
exec DisableAutoUpdateFW
SelectEmuBySN <serial> (only when a probe is selected)
r0
sleep <pulse-ms>
r1
q
JLinkExe is started as JLinkExe -NoGui 1 -ExitOnError 1 -CommanderScript <file> (the argv
of the bench-proven invocation): no -if, no -autoconnect, no -device, no -speed, no
connect. Commander toggles the reset pin without
attaching to the target; a connect against an Alif target in STOP either fails
(the debug domain is gated) or disturbs the evidence this verb exists to keep.
The script matches the bench-proven one (r0, sleep 100, r1, q).
It is not the pin reset tan flash runs (RSetType 2; r; g, retried): no
connect, no halt, no RSetType, no g, no connect-under-reset, no retry. Nothing is
written, erased or flashed. A test holds the generated script to that verb list.
--pulse-msis how long nRESET is held low: default 100, range 1 to 10000 (outside it isreset.bad-argument, exit 2, nothing spawned).- Probe selection, the trusted J-Link binary and the
ShowEmuListcheck before the spawn aretan flash's:--probe-usb-path/--probe-serialpick the probe,TAN_PROBE_USB_PATHis exported to the spawn, and a refusal reusesflash.probe-ambiguous/-not-found/-selector-conflict/-verify-failed. JLINK_RUN_PLACEis read from the environment of the invocation and inherited by theJLinkExespawn (always pair it with--probe-usb-path, so the place's probe is the one verified), so a board-farm shim picks the place per command, as fortan flash. The envelope reports it indata.place(nullwhen unset).- Envelope
data:pulseMs,place,writes(alwaysfalse),jlink(binary,binarySource),probe(selection echo),script(the exact lines sent). Success needs the Commander'sScript processing completed.and none ofFAILED,Cannot connect,Could not openin the output; otherwisereset.failed(exit 1). reset.internal-failure(exit 5) is a tan bug.
- With
JLINK_RUN_PLACEset,--probe-usb-pathgiven AND the J-Link program being the board-farm wrapper,tan resetmakes ONE J-Link spawn (data.singleSpawn: true) and does not run theShowEmuListverification pass first: each pass through the wrapper costs tens of seconds, longer than a STOP window. "Being the wrapper" means its realpath equals that of the absolute path inTAN_JLINK_WRAPPER, which must be outside the cwd and owned by root or you, with no world- or foreign-group-writable node on either path chain (the ruletan flash --rawuses;data.wrappersays whether it held, see below). A real SEGGERJLinkExe(from--jlink,TAN_JLINK, PATH or/opt/SEGGER) never qualifies, even withJLINK_RUN_PLACEset, because it would pulse whichever probe enumerates first: it takes the guarded two-pass path withSelectEmuBySN. The wrapper itself refuses aTAN_PROBE_USB_PATHthat is not its place's port (exit 96) before it opens any probe, and tan checks afterwards that the output carriesTAN_PROBE_ISOLATED_USB_PATH=<that path>(data.probe.isolation: wrapper-attested:<path>); a missing or different handshake isflash.probe-verify-failed, saying the pulse already ran. In that mode the script has noSelectEmuBySNline (the wrapper's mask leaves one emulator). Without a place, thetan flashguard runs first as before. - Exit 0 means the pulse was sent, not that the board rebooted (a target in
STOP can ignore it).
data.resetObservedis"unknown"and the info issuereset.boot-not-confirmedsays so, unless you pass--confirm-console PORT --expect REGEX: the console (a local tty orrfc2217://) is opened before the pulse; after J-Link exits its queue is dropped and it is read for up to--confirm-timeout. A matching line givesresetObserved: trueanddata.console; none givesreset.boot-not-observed(exit 1). Only bytes arriving after J-Link exits count, so pick a banner printed some time after reset.--confirm-consoleneeds pyserial: install it withpip install "./python[monitor]"from a checkout (tan-cli is not on PyPI; a bare editable install lacks it and the error says so).
-
The FIRST
--expectmatch must arrive within--confirm-window(default 3 s) of J-Link exiting;data.console.matchLatencySecondsrecords it. A later match is not a reset: it is recorded asdata.console.lateMatchAtSecondsand the run isreset.boot-not-observed(exit 1).--confirm-timeoutis only the overall read limit.--confirm-consoleis validated up front: a malformed URL (empty or non-numeric port, no host, unknown scheme) isreset.bad-port, exit 2. -
Hardware fact: on an Alif E8 in a correctly configured STOP, an nRESET pulse does not reboot the SoC; use a power cycle. Bench evidence (alp-sdk #2798 U8, e1m-aen-evk-02, 2026-10-09): the raw bench script
r0,sleep 100,r1,qbehaves the same, and a 30 s confirm window falsely accepted the RV-3028 alarm-wake banner that arrived 9.4 s after J-Link exit, which is why the window exists. -
data.timingrecordsprepSecondsandjlinkSpawnSeconds. Under the board-farm wrapper the spawn includes a 39-50 s preamble before the pulse, longer than a STOP window; that latency is the wrapper's, not tan's. -
Under a wrapper the script relies on the wrapper's USB mask (and the
TAN_PROBE_ISOLATED_USB_PATHhandshake) instead of aSelectEmuBySNline. -
While J-Link runs, one background reader takes the console and time-stamps what it reads. When J-Link exits it is joined (never abandoned, never run beside a second reader) and only chunks stamped at or after the exit are handed to the confirmation, so stale
rfc2217://lines in flight before the pulse cannot confirm it. Nothing is flushed afterwards, and there is no fixed discard: a real banner has been seen 0.088 s after J-Link exit. If the reader cannot be stopped the console is not read at all (reset.console-read-failed). -
A console that fails while being read is
reset.console-read-failed(exit 1,resetObserved: "unknown"), not "the board did not reboot". -
--confirm-consoleaccepts a local device path or one of pyserial's built-in URL schemes only (rfc2217://,socket://,loop://,spy://,alt://,hwgrep://,cp2110://);rfc2217://andsocket://needHOST:PORT.
data.wrapper is {"trusted": bool, "reason": string | null}; reason is null when
trusted, else one of wrapper-env-unset (TAN_JLINK_WRAPPER not set),
wrapper-path-unsafe (not absolute, under the cwd, not an executable file, or a
node on the path chain is foreign-owned or world/group-writable),
wrapper-not-resolved-binary (the J-Link program tan resolved is not that file),
unsupported-platform (no pwd/grp, e.g. Windows: single-spawn mode is never
used there). No paths appear in it.
The trust is operator-asserted: TAN_JLINK_WRAPPER attests a path, not that the
file really masks the other probes. tan checks that the path is safe and that the
resolved program is that path; after the pulse it checks the wrapper's
TAN_PROBE_ISOLATED_USB_PATH handshake, which a wrapper that does not mask could
also print. Point the variable only at the board-farm shim.
When JLINK_RUN_PLACE is set, the only J-Link program tan reset will spawn is
the trusted wrapper. With no --jlink, a trusted TAN_JLINK_WRAPPER is used ahead
of TAN_JLINK, PATH and /opt/SEGGER; an explicit --jlink still wins but must
resolve to that same file. If the wrapper is unset, unsafe or not the resolved
program, the run is refused as reset.wrapper-required BEFORE any spawn, because a
raw ShowEmuList would enumerate every probe on the host, including other places'.
A named place also requires the per-session lease (tan-cli#1457), checked by the very
helper tan flash --raw uses (flash_raw._reservation_refusal) before any spawn: this
shell must have run eval "$(scripts/bench/tan-lease.sh acquire <place>)" so
TAN_LEASE_NONCE matches the 0600 lease file for exactly that place, labgrid-client
must show you as the holder of the same acquisition (changed:), and
--probe-usb-path must equal the place's swd port (so a place run without
--probe-usb-path is refused). labgrid's holder name is <host>/<user>, the same for
every session of one user, so without the nonce a second session could pulse nRESET on
a board the first is using and destroy its VBAT/BKRAM evidence. Any failure is
reset.reservation-required (exit 1), nothing spawned.
Without a place, the guarded two-pass path with a real JLinkExe is unchanged. Timing seen on evk-02: about 47 s from start to pulse single-spawn and about 96 s two-pass; that is the wrapper's latency (#1462), not tan's.