New hand-coded LVGL screen (src/modules/driveline_screen.*) showing only
signals verified on this bus: gear as the hero, coolant and gearbox oil temp
flanking it, an engine RPM bar, and turbine / output-shaft speeds, plus
ignition, engine-run, converter-clutch, gearbox-cooling and gear-mismatch
status. Reached by swiping right from Home.
It lives in src/ and hooks its gesture onto the Home screen at RUNTIME rather
than editing ui_Home_Screen.c, because SquareLine Studio overwrites
include/ui/ on every export - that is how the CAN toggle's event handler went
missing. LVGL dispatches to every registered callback, so the runtime hook
coexists with the generated left-swipe handler instead of replacing it. Same
reasoning the existing meters_manager already follows.
Output shaft is labelled "raw" and shown as counts: the x0.125 scaling is
still a hypothesis, so inventing a unit here would launder it into fact.
Also fixes a defect found while wiring this up: main.cpp updated the Home
screen's meters and battery label unconditionally, but those fields are
pre-seeded with DEFAULT_* constants. With no CAN data the display showed a
confident 92.0degC engine oil temp and 12.45V battery that had never been
measured. Two of them have no source on this bus at all - engine oil temp has
no sensor (0x1D0 byte 1 is permanently 0xFF), and 0x3B4 publishes the
battery's not-available marker on nearly every frame. Now gated on
valid_flags, so an unmeasured value reads "--.--" instead of a plausible lie.
Same class of bug in the driver: 0x3B4's U_BT was accepted even when it read
0xFFF, which would have put a confident 61V on screen. Now rejected, leaving
the valid flag clear.
Decodes ignition state from 0x3B4 byte 2 (user-verified: 0x00 = on, 0x09 =
off, unmoved by the engine starting). Both the E65 repo (ST_ENGINE_RUN) and
the E60 VFL sheet (engine flag, 0x09 = running) are wrong about this field on
our bus - inverted and mislabelled. Noted at the definition so it doesn't get
"corrected" back. It also restores ignition sensing, which we thought was
lost with CAS/0x130 absent from the swap.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
First capture with the vehicle actually moving (raw/log_20260717_145930.txt,
1857 frames, filtered to 0x0BA + 0x1D2).
Verified, closing yesterday's inference: ST_GR_GRB values 6/7/8/9/A observed
directly = 2nd..6th. So 0x0BA byte 0's low nibble is a COMPLETE gear source
on its own - P/R/N plus 1st..6th, reverse included. 0x1D2 is now needed only
for the lever and the D/S/M mode, which 0x0BA does not carry. Value 4 is
still unaccounted for.
Also caught ST_CCLT (torque converter lockup clutch) live - 422 frames
"controlling", clustered in the higher gears. This matters beyond curiosity:
a closed clutch bolts the turbine to the impeller, so turbine == engine
exactly. Any turbine/engine slip ratio read at road speed must check CCLT
first or it will report "not engaged" for a perfectly healthy locked-up box.
Decoded into driveline_t with that warning attached.
Output shaft: identification now verified (rises monotonically 1139->16702
across gears 1->6, zero whenever the output is held). Scaling narrowed to
x0.125 but NOT adopted - it implies a coherent 901->1872 rpm upshift schedule
across five independent 6HP26X ratios, where raw-as-rpm would imply
7,200-15,000 rpm against a ~4,500 redline. Still rests on the unproven
assumption that each gear's max output is its upshift point, so the field
stays in raw counts. One capture including 0x1A2 settles it: turbine/output
gives each ratio directly.
Gearbox confirmed as ZF 6HP26X (user). Same gearset as the 6HP26, so the
ratio table holds; the X is the xDrive output variant, which dates the donor
to E60/E61 rather than E65 - the 7-series never took M57N with xDrive. That
partly answers a standing open question, and raises a new one: the X box
measures its output shaft upstream of the transfer case, so if a Patrol
transfer case sits in the path its ratio enters the km/h conversion and
changes with high/low range.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ingest HeinrichG-V12/E65_ReverseEngineering (per-ID DBC-style docs with
worked examples) and re-analyse our own 2026-07-15 capture against it.
Resolves both outstanding scaling disputes, closes the engine-state
question, and adds the driveline speeds.
Resolved:
- Gearbox oil temp = raw - 40 (not offset 0, not +40). Source's worked
example plus our own cross-check: the box read 31 C while coolant was
at 37 C and climbing; offset 0 would have the transmission warming
faster than the engine.
- Battery = 12-bit LE * 0.015 (0x3B4 U_BT); the E90 24-bit BE reading is
wrong for us. The high nibble of byte 1 is ST_BTSW, not voltage.
- Engine was running during the 2026-07-15 capture (ST_ENGINE_RUN = 2 in
397/397 frames), so its coolant trace is genuine warm-up data and the
planned cold-start capture is unnecessary.
- Engaged gear = 0x1D2 byte 1, gear = (D1>>4)-4. No drive capture needed.
New signals (0x1A2 turbine, 0x0BA output shaft, 0x0AA RPM/pedal). Turbine
speed physically proves engagement: it free-spins at ~engine speed in P/N
and collapses to ~0 when the box loads up. Output shaft is the only
road-speed source on this bus - there is no DSC module - so it is the
feedback variable any future cruise-control work would need. Scaling is
uncalibrated; it is carried as raw counts with no physical unit.
Corrects three of my own earlier claims:
- 0x1D2 D1 is the engaged gear, not a "drive-gate flag" (it only ever
showed two values because the car was stationary in 1st).
- 0x1D2 D4 0xF2 is a persistent Manual mode, not a "downshift event" - it
holds across gears 2-6.
- 0x0BA was dismissed on the strength of D7, which is an alive counter.
The gear is in D0's low nibble, and it is the only source of engaged
reverse: 0x1D2 D1 stays 0x0F in R.
Firmware: real IDs replace the placeholder map (all 11-bit standard now,
so the extended-ID assumption is gone), full gear decode incl. Sport vs
Manual, and a debounced lever-vs-gearbox mismatch fault - the "lever says
R but the box never took it" case. Engine oil temp reads 0xFF here (sensor
not populated), so its valid flag is left clear rather than publishing
-207 C. Driveline speeds are kept out of automotive_data_t deliberately:
that struct is the UART wire format and widening it would break
Controller B.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The gear lever is fully decoded and confirmed on the actual swap bus
(raw/gear_box_can_revealings.csv): 0x1D2 byte0 = P 0xE1 / R 0xD2 / N 0xB4 /
D 0x78, matching the documented BMW codes exactly. Byte4 splits D vs S/M
(0xF0 auto) and carries manual +/- shifts.
Firmware:
- automotive_data.h: replace placeholder gear map (0x1001) with CAN_ID_GEAR_LEVER
0x1D2, verified byte-0 codes, byte-4 mode define, and can_to_gear_lever().
- can_driver.cpp: decode 0x1D2 byte0 into gear_position via the enum; reject
unrecognized codes instead of copying the raw byte.
- Scope: P/R/N/D only (verified). S/M shows as D for now (no enum slot; engaged
gear number needs a drive capture) — TODO'd, not faked. Coolant/oil/battery
left as flagged placeholders pending a cold-start capture.
Wiki:
- New source page gear-box-can-revealings + raw CSV filed.
- can-id-candidates: 0x1D2 gear row -> VERIFIED; encoding "dispute" section
rewritten with the full lever+mode decode table.
- Updated index + log.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>