Repository navigation
docs(firmware): bring specs back in line with the code (audit 2026-10-27) - #403
Merged
Merged
Conversation
…-27) Wording and comments only: no behaviour, wire format or frame change. Fixes the FirmwarePlan, TechSpecs, library READMEs and code comments the 2026-10-27 audit of #375-#395 found stale: per-node sequential sync and READY(RESYNC) instead of a SYNC_REQ broadcast, no CTRL_BCAST coalescing, the bridge's 2 ms batch hold, 38-hex _NODE_STATUS rows, boot frames above CTRL_BCAST, drop counters kept on the board, the retired DIAG_* frames, re-reports as state, and markBootHealthy() placement. Decisions D5, D7, D11, D21, D24 and D30 get as-built notes where the code overrode them.
5 tasks
…SimGateway drift Restore the original D5, D7, D21 and D24 decision text word for word and keep only the as-built notes (D32's addition becomes one too). Fix the SYNC_REQ wording left in the PanelBridge test ini, ReadyFlag and the bench headers, the uploader retry result, the 0x7C1 relay row, the lone-board error-passive note and a stale SimGateway.cpp citation. Bootloader size reads "about 3.7 KB, roughly 400 B free"; the coalescing loss reads "about a fifth". Fold in the older SimGateway TechSpec and README drift: no library.json copy, the real template path, every test env, HIDHatSwitch in the API block, a complete Testing section and API table.
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.
Docs PR A from the 2026-10-27 audit of #375–#395. There is no tracking ticket. The published
docs/pages are PR B and are not in this PR.Wording and comments only. Nothing changes in behaviour, wire format or frame structure, and no new reporting is added. Where the code overrode a decision, the original decision text stays word for word and an as-built note is added after it. This applies to D5, D7, D11, D21, D24, D30 and D32 (D32's note says the counters stay on the board).
Audit claims, verified against
mainand the PR or ticket behind each changeexamples/panelbridge.md; the PanelBridge TechSpec (timelines, rules, setup, RX table, READY section);PanelBridge.h:70;PanelBridge.cpp:385,495;CANProtocol.hReadyFlagcomment; PanelBridge README; PanelGroup TechSpec (READY, SYNC_REQ rows);CANProtocolTechSpec (SYNC_REQ handling,onSyncReq,SYNC_REQ_LEN_TARGETED);Tests/PanelBridge/platformio.inicommentsCANProtocol.cpp:433). A full ring drops the new frame and counts it._NODE_STATUSv4 row is 38 hex, not 34NODE_STATUS_ROW_BYTESis 19 (#365 added the bootloader fields before v4 shipped)NodeStatus.h:35; NodeStatus TechSpec (said 17 bytes); PanelBridge README (said "18 chars"); SimGateway's longest-line figure (~42 → ~52 bytes) inSimGateway.hand 070x7E0(D31), below 0x740–0x7C1BootProtocol.h:25. Those are the only two places.ANNOUNCE_INTERVAL_MS) with the first announce at once; it is not randomized. "One at a time" is a host rule: the uploader binds the first announcement it hears. Two boards that start the same frame in the same bit get a bit error, so error frames and an automatic retransmit, not a lost announcement.drain()flushes a lone packet after two passes and≥ BATCH_HOLD_MS(2 ms). On nodes the hold is 0 ms.CANProtocol.hdrain/sendBatched doxygen; CANProtocol TechSpec (BatchState, deadline)markBootHealthyplacement, SYNC order,DIAG_ERRmarkBootHealthy()is the last line of PanelGroupsetup()(after READY) and ofPanelBridge::setup()(after arming the roster).DIAG_ERR, and in fact all fourDIAG_*types, are defined but nothing sends or parses them.CANProtocol.hcomment marks them retired, constants kept; FirmwarePlan README and firmware skill index lineDIAG_ERRcounter, "exposes"), the text now saystxDropCount()/rxDropCount()/rxOverrunCount()are counted on the board and not reported over the bus.send();CANProtocol.hsend()doc;CANProtocol.cpp:266NODE_FORGET_REQ_ADDR(0xFF04). BEGIN[len]and END[crc]match the code; I added thatlenis unpadded, that a short frame gets no reply, and that ENDED crc is 0 on an early fail. Further findings are listed below.PanelGroup.h:85vs #394; README listener names, "debug optional"forceReport()doc saying "emit … unconditionally". READMEs named listeners that #389 folded intoExportDispatcher. The README sketches turned debug on, but it is off by default and the templates ship with it off (#389).PanelGroup.h; PanelGroup TechSpec; PanelBridge and PanelGroup README samples now comment outsetDebug(true)as bench-onlyOther stale places found by grepping the same claims
InputType::SWITCH/ACTION/…, which has been stale since RotaryEncoder relative dispatch (REL ±step + DIR INC/DEC) — source DCS dispatch from class, collapse InputMap to controlId→name #147. It now describes the ABS/REL/DIR/ACTION forms chosen by frame. The roster reply was described asSerial.flush()ed fromsetup(); fix(panelbridge): never block loop() on a roster reply — write it a few rows per loop #388 made it a row at a time fromloop(). A HEALTH frame was said to queue a sync; only HB does. The Dependencies list was missing NodeStatus, BootProtocol, FirmwareImage and FirmwareVersion.PanelBridge.cpp:232–244. Comments named the removed listeners (BridgeExportListener,NodeStatusReqListener, …). Same forPanelBridge.htestHandleExport, theoutput_submissiontest and D30.dual_integration,node_tracking,startup_sequence,model_time_resync). They expected a[BRIDGE] SYNC_REQ broadcastlog line that no code prints, and the old "session change — SYNC_REQ" text. I rewrote them to the lines the code prints:[BRIDGE] READY node=1,node=1 alive,READY (resync) node=1,DCS session change — sync every node. The pass criteria follow those lines. A node that boots first only showsalive(from its HB). A lone board stops at error-passive, not bus-off. On a single board, the model-time test logs the session change but sends noSYNC_REQ, because no node is alive.PanelGroup.h, TechSpec, 05):configure(), and left out ShiftBusbegin()andmarkBootHealthy()._lastHeartbeatMswas listed; the heartbeat moved to CANProtocol in refactor(firmware): move node heartbeat, HEALTH and master watchdog into CANProtocol #340.loop()order was wrong.BootProtocol.h,main.cppheader, Bootloader TechSpec, 12):poll_rx()details.SimGateway.h,Uploader.h,LinkRecovery.h, 07, TechSpec):_NODE_STATUS/_BOOT_RSP.breakis one of its triggers.loop()steps now include the uploader, the session expiry and D33.Uploader::begin()is called fromsetup(), notbegin().UPL_RETRIES) and endsWRITE_FAILEDwhen the retries run out.@param cdcStalled; a stale "lands in PR 4" comment.STM32BoardTechSpec. TheReceiveFifoLockedcomment referred to a "drop-oldest policy" that doesn't exist.TechSpec/PanelGroup/Inputs/AnalogInput.md:210. CitedSimGateway.cpp:80-81for the USB report interval; it is now at:82-83.docs/firmware/build-flags.md:218. I changed thePanelBridge.hcitation from:92to:96because the header grew. That is the onlydocs/edit, and it keepscheck_doc_refs.pygreen.Dropped
None. Every listed claim held.
Resolved after review (user decisions, 2026-10-27)
UPL_BEGINduring a calibration session. The code is being fixed in build(firmware): one release zip with all three image types; drop the flat files #402, so the docs' rule stays as written.CANProtocol.cppcomment.library.jsoncopy; the TechSpec points at the file instead.Firmware/Templates/SimGateway/replaces the path that doesn't exist.axis_cal_*,hid_enumerationandhid_stress.HIDHatSwitchadded to the Public API block.diagnostics()/calibration()rows in the API table; a complete Testing section.0x7C1announce is relayed only and not tracked (PanelBridge TechSpec RX table).CTRL_BCASTcoalesced before fix(panelbridge): sim outputs never reach CAN — overlapping DCS-BIOS export listeners #389.Not changed
model_time_resync.cpp:51prints "SYNC_REQ expected" at run time. That is test output, not a comment, so I left it alone.Verification
python3 tools/docs-drift/check_doc_refs.pypasses. I also checked everyfile:linecitation into a file this PR edits: apart from thebuild-flags.mdone above, they all still point at the same text.pio runpasses forTemplates/PanelBridge,Templates/PanelGroupandTemplates/SimGateway.Firmware/Bootloader(bootloaderandbridgeenvs) with and without the comment edits tomain.cppandBootProtocol.h. Bothfirmware.binfiles are byte-identical (4096 B each).