gr26: sync CAN models with firmware GRCAN#155
Open
jacobjurek wants to merge 4 commits into
Open
Conversation
Tooling to keep gr26/model in sync with the Firmware GRCAN autogen artifacts (Inc/GRCAN_*_ID.h + Doc/GRCAN_*.dbc): - grcan_sync.py: stdlib parser/differ with three modes — parse, diff (firmware-vs-firmware), reconcile (models-vs-firmware audit). Joins by CAN ID via composite base-ID extraction with name-match fallback. - fetch.sh: pull the 5 source artifacts from Firmware via gh. - snapshot/: committed baseline for diffing future firmware changes. - .claude/skills/sync-grcan: orchestration skill (audit -> apply -> PR). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ructural
reconcile was false-flagging dash messages (which build signals via the
bit(v,n,"name") helper, not Signal{Name:...} literals) as having 0 signals.
Also: when the model exposes MORE signals than the DBC (e.g. dash explodes a
byte into per-bit booleans) that's intentional enrichment, not drift -
demote it from structural to naming.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ran grcan_sync reconcile against Firmware@main. Applied the one clearly-safe structural fix and flagged the judgment cases with TODO(grcan-sync) for firmware confirmation rather than blindly conforming to the DBC. Applied: - ECU_STATUS_3: add missing relay_states field (firmware dlc 5, byte 4) Flagged (no behavior change): - DTI_DATA_1-5: DBC endianness/signedness/scale disagree with the hand-tuned third-party layout; DTI_DATA_5 also has a richer DBC layout - INV_STATUS_3: fault_bits byte position differs from DBC - GPS_ALT: DBC 8-byte ALT vs model float32 + gps_status See gr26/tools/grcan/AUDIT-20260530.md for the full report. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds message definitions and messageMap entries for firmware nodes that were never modeled (untracked firmware messages: 49 -> 15): - Tire temp thermal arrays: TireTempFrame0..23 (0x37-0x4E), 64-byte CAN-FD, 768 pixels (global pixel0..767) via a tireTempFrame() factory - Brake node: BrakeTemp (0x4F), WheelSpeed (0x50) - SuspensionIMUMagData (0x51), InboardFloorIMUToFData (0x52) - Energy Meter: EMMeas/EMStatus/EMTeamData1/EMTeamData2/EMTemp - IMDGeneral (0x18FF01F4) These are >8-byte CAN-FD frames; verified the mapache-go decoder sizes match and a 64-byte tire frame decodes correctly. Layouts generated from the DBC via grcan_sync; judgment items (IEEE-float vs raw, bit-packed fields, the mag_status DLC overrun, J1939-multiplexed IMD frames) carry TODO(grcan-sync) flags. Remaining untracked (debug, DTI control commands, charger, IMD_RESPONSE) intentionally not modeled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Syncs
gr26/modelwith the Firmware GRCAN autogen artifacts (Autogen/CAN/Inc/GRCAN_*_ID.h+Doc/GRCAN_*.dbc) and adds the tooling that produced this sync.Applied (1)
relay_statesfield — firmware dlc is 5, the model stopped at 4 bytes. Confirmed in-sync after the change.Flagged for firmware confirmation —
TODO(grcan-sync), no behavior changecan_version) vs the model's reserved bytes.fault_bitsat byte 1 (byte 2 unused); model has padding at byte 1,fault_bitsat byte 2.ALT(likely float64); model decodes a float32 altitude +gps_status.No action (intentional)
dash.go).ts_voltagevstractive_system_voltage) are intentional abbreviations.Tooling included
gr26/tools/grcan/—grcan_sync.py(parse / diff / reconcile),fetch.sh, committed firmwaresnapshot/, and thesync-grcanskill. Full audit ingr26/tools/grcan/AUDIT-20260530.md.Net model change is +27 lines, all additive (one field + four comment blocks).
🤖 Generated with Claude Code