Make USB control DSP-authoritative and attest firmware builds - #5
Open
xmutantson wants to merge 15 commits into
Open
xmutantson wants to merge 15 commits into
xmutantson wants to merge 15 commits into
Conversation
When the mode screen initializes with a mode other than WGN selected, the WGN branch also runs because its condition treats any uninitialized state as WGN. Both branches then print the mode and S:N lines, and since there is no screen clear or cursor reset between them the second copy lands two text rows lower, leaving a duplicated header on the panel until the next full redraw. Select the WGN branch on the mode alone. Initialization of a non-WGN mode falls through to its own branch and the header is drawn exactly once; WGN behavior is unchanged.
Apply the parsed channel mode to the live DSP for every serial SIM parameter-page command (not only WGN-MPD): assign intMode and force reinitialization. Bound BUSY CH1 IN to the nine-element fltLogs table; apply MULTIPATHS, OFFSET and FM-deviation routing immediately; restore fade rate, FM rate and FM amplitude from EEPROM into the DSP at boot; reject empty and non-numeric parameters before the setters coerce them to zero; correct the FM-rate display multiplier (10 * fltLogs). Updates the regression tests for both sketches.
…L/HELP) Echo the live DSP state after each command, ending in OK or ERROR, as the single source of truth. Add a one-way DSP-to-display watchdog with change detection and a 30-second repaint. Add STATUS (mode and S:N), LEVEL (input level in mVp-p) and HELP (command and range listing ending END HELP). Legacy OK and ? replies preserved. With the watchdog now owning the display, remove the redundant ParseSetParameter parser. Based on the PR ARSFI#2 branch (apply after PR ARSFI#2).
This was referenced Sep 21, 2026
The AdjustS_N calibration debug block printed on every change of the
requested S:N. Under a running flat fade the fade state machine steps the
integer S:N tens of times per second, so the block was emitted from inside
the audio envelope loop at roughly 40 Hz. That floods the serial link,
desyncs the host command protocol, and risks the processor blocking on the
serial chip inside the very loop that is shaping the fade envelope.
Classify the debug output by source rather than by a bare value change:
- the fade loop's internal per-step adjustment (Fade -> AdjustS_N) is
silent;
- operator-initiated changes (boot/initial apply, front-panel dial, and
the USB/serial S:N command) still print exactly one block on change.
An opt-in DEBUG ON|OFF verb restores the legacy per-step calibration trace
for bench calibration and STATUS reports its state; it defaults off. No DSP
math changes. Bump the consolidated firmware and sketch name to Rev 2.05.
Add a source-pattern test asserting the fade path is silent by default while
the operator paths keep their single calibration block.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The USB serial side had never been seriously exercised by scripted control. Based on correspondence with the Winlink team, this is the first systematic scripted use of that interface.
That exposed three correctness failures in released behavior:
This is test equipment. If the commanded channel and the live channel can differ, every downstream measurement can be mislabeled. The interface must report what the DSP is actually running, not what the parser or display intended.
This consolidated change supersedes PRs #2, #3, and #4. It incorporates their useful work, corrects the ancillary-command regression in #4, and adds the missing trust and build-attestation pieces.
Changes
Tier 0 — make scripted profile selection work
The established nine-command profile-first program now ends with live MPP and mode-3 tap initialization:
Tier 1 — make state authoritative
ApplyChannelMode().OKor the structured ACK.OK/ERRORreplies.Tier 2 — retain maintenance behavior
RESETwith transmit flush before reset.CODECINIT, completing codec reinitialization before its response.Tier 3 — display and repository cleanup
Validation` section with
Validation
sketches where applicable (eight prior tests plus five new source-filter tests):
the fade internal call is silent (
blnOperatorSource=false), both live-loop steadycalls request the printing source, the print guard is
(blnOperatorSource || blnDebugAdjustSN) && (intDesiredSN_dB != intLastDesiredSN_dB), the firehose flagdefaults off, and the
DEBUGverb andSTATUS DEBUG=field remain reachable.HFSim_BFD_2_05; its TFT display, serial boot banner,HELP banner, and STATUS revision field report Rev 2.05. The Proto sketch follows the
same revision convention.
teensy-compile15.2.1,and explicit
teensy:avr:teensy40:usb=serial,speed=600,opt=o2std,keys=en-ussettings.Two fresh builds with the same recorded identity produced byte-identical Intel HEX.
Build identity:
7037038@20260921T061316ZHEX SHA-256:
8567d5e2a91e24b358d0dfd674f310f8a2a26f5199bf0792db7f80919cb4961bHardware validation: this exact Rev 2.05 HEX was flashed to the Teensy 4.0 HF
simulator and re-verified over serial and on the audio wire.
fade depth 20 dB, 1 Hz) emitted 514,102
AdjustS_Ncalibration blocks (151.9 MB ofserial output). After the fix, a 45-second standing flat fade emitted zero blocks
(0 bytes), and all four interleaved
STATUSreads parsed cleanly, reporting Rev 2.05,DEBUG=OFF,FADE_DEPTH_DB=20, andBUILD=7037038@20260921T061316Z.MPP:25prints exactly one block;a serial S:N change mid-fade (
WGN:30) prints exactly one block and then goes quiet;the RESET boot banner prints exactly one block.
7037038@20260921T061316Z; the exactnine-command program ends with live MPP and mode-3 tap initialisation.
PASS with all five checks true and
build_matches_expected=true; the MPG profilemeasured envelope std 7.14 dB and a 23.6 dB p95–p05 span with 5 downward −3 dB
crossings, while the matched WGN control measured 0.05 dB std with zero crossings.
the Butler lock was released.