Decode the real CAN map: gear, temps, battery, driveline speeds

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>
This commit is contained in:
2026-07-17 12:33:31 +02:00
parent 0a58afca9a
commit bb87b3d6da
13 changed files with 428331 additions and 132 deletions
+52 -27
View File
@@ -1,7 +1,7 @@
---
type: synthesis
tags: [can-bus, reverse-engineering, e60, research]
updated: 2026-07-16
updated: 2026-07-17
---
# E60/E65 CAN ID Candidates (Research Results)
@@ -15,7 +15,14 @@ Findings from the 2026-07-15 deep-research run (95 claims extracted from ~15 sou
> - `0x1D0` byte0 drifts up `0x55→0x58` = coolant warming (−48 scaling holds). **Oil temp `0x1D0` byte1 = `0xFF`** (not populated here).
> - `0x1D2` **gear fully VERIFIED** (2026-07-16, [[gear-box-can-revealings]]): byte0 `0xE1`=P/`0xD2`=R/`0xB4`=N/`0x78`=D — all codes match; byte4 splits D vs S/M and carries manual +/− shifts.
> - Absent despite being researched: `0x130`, `0x304`, `0x192`.
> - Still needs a **cold-start + confirmed-engine-running** capture to lock scaling on coolant/battery. See the source page for the full table.
> [!success] 2026-07-17 — [[e65-reverse-engineering-repo]] ingested: both disputes resolved, engine state closed
> A per-ID DBC-style source with worked examples on every page. Combined with re-analysis of our own capture:
> - **Gearbox oil temp offset RESOLVED → `raw − 40`** (not offset 0, not +40). Cross-checked against our coolant trace.
> - **Battery layout RESOLVED → 12-bit LE × 0.015** (the E65 reading; the E90 24-bit BE reading is wrong for us).
> - **Engine-run state CLOSED** — `0x1D0` bits 20–21 read "running" in 397/397 frames of the 2026-07-15 capture. That dump *was* a genuine warm-up trace, so **no cold-start capture is needed to trust the coolant scaling**.
> - **Engaged gear number RESOLVED** without a drive capture → `0x1D2` D1 high nibble ([[gear-box-can-revealings]]).
> - **New signals**: turbine speed (`0x1A2`), output shaft speed (`0x0BA` D3/D4), pedal position + cruise state (`0x0AA`) → [[driveline-speed-signals]].
## The map (replaces the firmware's placeholder IDs)
@@ -23,12 +30,19 @@ Findings from the 2026-07-15 deep-research run (95 claims extracted from ~15 sou
|--------|--------|-------|---------|--------|------|------------|
| Coolant temp | **0x1D0** | byte 0 | °C = raw − 48 | DME/DDE | 100 ms | **Very high** — verified verbatim in E65 docs, present in E90-gen DBC, confirmed live on a real E60 545i, E60 tool32 table lists 0x1D0 "Motordaten" from DDE1 (diesel!), and the [[e60-vfl-can-codes-xlsx]] sheet shows 0x7A→74 °C on a real E60 VFL (raw−48 checks out) |
| Engine oil temp | **0x1D0** | byte 1 | °C = raw − 48 | DME/DDE | 100 ms | **High** — same sources as coolant |
| Gearbox oil temp | **0x0B5** ("Torque_request_EGS") | byte 7 | ⚠ disputed: raw + 0 vs raw + 40 | EGS | ? | **Medium** — in the E9x community DBC; absent from the E65 repo's decoded EGS messages. Offset must be settled on the bench (a ~40 °C error is dangerous — resolve before trusting) |
| Gear lever position | **0x1D2** ("TransmissionDataDisplay") | **byte 0** | `0xE1`=P `0xD2`=R `0xB4`=N `0x78`=D/(S/M); split D vs S/M with byte 4 (`0xF0` auto / `0xF1` S-M) | EGS | 200 ms | **✅ VERIFIED on the swap bus 2026-07-16** — every code matches. Full decode: [[gear-box-can-revealings]] |
| Current gear number | **0x1D2** byte 1 upper nibble (GearAct, −4 offset) or **0x0BA** bits 0–3 (E65: values P/R/N…6th) | | | EGS | 20–200 ms | **Medium** — two candidate messages; also **0x304** "Gear lever" — the E60 VFL sheet shows a 2-byte lever message: P=0xE3, R=0xC2, N=0xD1, M=0xC9 (its D=0xC2 duplicates R — likely a sheet typo) |
| Battery voltage | **0x3B4** ("Powermanagement Batteriespannung") | ⚠ disputed layout | 12-bit LE × 0.015 V (E65, verified: 0x3D9→14.775 V) vs 24-bit BE × 0.001 V (E90 DBC) | Power module / DDE | 5 s (E65) | **High on ID** (E60 tool32 table + E60 VFL sheet: `64 F3`→12.76 V, consistent with the 12-bit LE layout though implying factor ≈0.0147 vs 0.015). Bonus from the sheet: byte 3 = engine running flag (0x09 on / 0x00 off) |
| Engine RPM (bonus) | **0x0AA** | bytes 4–5 | RPM = raw / 4 | DME/DDE | 10 ms | High — cross-generation (E65 + E90 comment) |
| Ignition/terminal status (bonus) | **0x130** | byte 0 bitmasks | 0xD5/0xC5/0xC1 | CAS | 100 ms | Medium — used by an M57 project as its only passive decode |
| Gearbox oil temp | **0x0B5** (`TEMP_GRB`) | byte 7 | **°C = raw − 40** | EGS | 10 ms | **✅ RESOLVED 2026-07-17** — [[e65-reverse-engineering-repo]] worked example (raw `0x43`=67 → 27 °C), plus our own cross-check: D7 `0x47`(71)→**31 °C** while coolant read 37 °C and climbing. Offset-0 would have the box at 71 °C with the engine at 37 °C — impossible for a warm-up |
| Gear lever position | **0x1D2** ("TransmissionDataDisplay") | **byte 0** | `0xE1`=P `0xD2`=R `0xB4`=N `0x78`=D/(S/M) | EGS | 200 ms | **✅ VERIFIED on the swap bus 2026-07-16** — every code matches. Full decode: [[gear-box-can-revealings]] |
| Gearbox mode | **0x1D2** | **byte 4** | `0xF0`=Drive(auto) `0xF1`=Sport `0xF2`=Manual | EGS | 200 ms | **✅ VERIFIED 2026-07-17** — `0xF2` is a *persistent mode*, not a downshift event (earlier claim corrected) |
| Engaged gear number | **0x1D2** | **byte 1** | `gear = (D1 >> 4) − 4`; `0x0F` = none (P/R/N) | EGS | 200 ms | **✅ VERIFIED 2026-07-17** — clean +16 ladder across gears 1–6, identical in D and M/S ([[gear-box-can-revealings]]). **Never set for R** |
| Engaged gear **incl. reverse** | **0x0BA** (`ST_GR_GRB`) | byte 0 low nibble | `1`=N `2`=**R** `3`=P `5`–`A`=1st–6th `0xF`=invalid | EGS | 20 ms | **✅ VERIFIED 2026-07-17** for 1/2/3/5 against our capture; 6–A inferred. **The only source of engaged reverse** — `0x1D2` D1 is blind to it |
| Battery voltage | **0x3B4** (`U_BT`) | bits 0–11 | **`((D1 & 0x0F) << 8 \| D0) × 0.015` V** | Power module | 5 s | **✅ RESOLVED 2026-07-17** — 12-bit LE × 0.015 confirmed by [[e65-reverse-engineering-repo]] worked example (`0x3D9`→14.775 V). The E90 24-bit BE × 0.001 reading is **wrong for us**. Bonus: `ENG_ST` bits 16–19 |
| Engine RPM | **0x0AA** (`RPM_ENG`) | bits 32–47 | **`(D4 + D5×256) × 0.25`** 1/min | DME/DDE | 10 ms | **✅ VERIFIED 2026-07-17** — 679–684 rpm at idle on our capture, matching `RPM_IDLE_TARGET`=700 from `0x1D0` |
| **Turbine speed** | **0x1A2** (`RPM_GRB_TURB`) | bits 0–15 | **`(D0 + D1×256) × 0.125 + 6`** 1/min | EGS | 20 ms | **✅ VERIFIED 2026-07-17** — physical proof of gear engagement; collapses ~630→~0 when the box engages. → [[driveline-speed-signals]] |
| **Output shaft speed** | **0x0BA** | bits 20–39 (D3/D4) | ⚠ **uncalibrated** | EGS | 20 ms | 🔬 **Hypothesis, strong** — undocumented in the source repo; zero in every stationary frame incl. engaged-in-D, non-zero once wheels turn. **Our only road-speed signal** (no DSC on this bus) → [[driveline-speed-signals]] |
| Engine run state | **0x1D0** (`ST_ENGINE_RUN`) | bits 20–21 | `0`=off `1`=starting `2`=running `3`=invalid | DME/DDE | 100 ms | **✅ VERIFIED 2026-07-17** — read 2 ("running") in 397/397 frames of the 2026-07-15 capture |
| Pedal position / cruise state | **0x0AA** | `ANG_ACPD` bits 24–31 (×0.39063 %); `ST_CLCTR_V` bits 52–55 | see [[driveline-speed-signals]] | DME/DDE | 10 ms | (source: [[e65-reverse-engineering-repo]]) — relevant to a cruise-control PoC |
| Gearbox cooling demand | **0x0B5** (`ST_OTMP_GRB`) | bits 38–39 | `0`=none `1`=stage 1 `2`=stage 2 `3`=invalid | EGS | 10 ms | (source: [[e65-reverse-engineering-repo]]) — the box's own overheat opinion; better display warning than a raw threshold |
| Ignition/terminal status | **0x130** | byte 0 bitmasks | 0xD5/0xC5/0xC1 | CAS | 100 ms | **Absent from our bus** (verified 2026-07-15) — CAS not retained in the swap |
### The 0x1D2 encoding dispute — ✅ RESOLVED on the swap bus (2026-07-16)
@@ -37,30 +51,39 @@ The live lever capture ([[gear-box-can-revealings]]) settles it — **DLC 6**, w
| Byte | Meaning | Values |
|------|---------|--------|
| **0** | **Lever position** | `0xE1`=P, `0xD2`=R, `0xB4`=N, `0x78`=D **and** S/M |
| 1 | Drive-gate flag | `0x0F` in P/R/N, `0x5F` in D + S/M |
| **1** | **Engaged gear** | `gear = (D1 >> 4) − 4`; `0x0F` = none (P/R/N). Never set for R |
| 2 | unused | `0xFF` |
| 3 | Rolling counter | fluctuates — ignore (matches the predicted byte-3 counter) |
| **4** | **Mode / manual shift** | `0xF0`=Drive(auto), `0xF1`=Sport/Manual, `0xF2`=downshift (−); up-shift (+) unconfirmed |
| **4** | **Mode** | `0xF0`=Drive(auto), `0xF1`=Sport, `0xF2`=Manual |
| 5 | unused | `0xFF` |
Byte 0 alone gives P/R/N/D; byte 4 splits **D vs S/M** (Steptronic side-gate) and carries the manual +/− nudges. The old "dispute" was just notation — the E65 whole-byte values and the E90 low-nibble scheme agree (`0xE1` low nibble = 1 = P, etc.), and this bus speaks the whole-byte/DLC-6 dialect.
Byte 0 alone gives P/R/N/D; byte 4 splits **D vs S vs M**; byte 1 gives the engaged gear 1–6. The old "dispute" was just notation — the E65 whole-byte values and the E90 low-nibble scheme agree (`0xE1` low nibble = 1 = P, etc.), and this bus speaks the whole-byte/DLC-6 dialect.
> The firmware's `automotive_data.h` gear map should be rewritten to `0x1D2` byte 0 (+ byte 4 for S/M). → [[can-bus-integration]]
> [!warning] Two 2026-07-16 labels on this page were wrong — corrected 2026-07-17
> - **D1 was called a "drive-gate flag"**. It is the **engaged gear number**; it only ever showed two values because the vehicle was stationary in 1st. This also means the "engaged gear needs a drive capture" task was never real — a per-detent capture sufficed.
> - **D4 `0xF2` was called "downshift (−)"**, a transient event. It is a **persistent Manual-mode flag** — it holds across gears 2–6. The `+`/`−` nudges have no distinct code; they merely promote Sport → Manual. The old "up-shift (+) value unconfirmed" question therefore dissolves rather than being answered.
>
> Both errors came from over-reading a two-value field as a boolean. Full evidence: [[gear-box-can-revealings]].
> Note `0x1D2` is where **our decode is ahead of the published source**: [[e65-reverse-engineering-repo]] lists `0x1D2` as "Display Gearbox Data" with an **empty signal table** — it never decoded it. Its sample frame (`E1 0C 8F 7C F0 FF`) does independently confirm `0xE1`=P.
> The firmware's `automotive_data.h` gear map should be rewritten to `0x1D2` byte 0 + byte 1 + byte 4, with `0x0BA` for engaged reverse. → [[can-bus-integration]]
## Field checklist for the live capture session
Setup: 500 kbps, board's 120 Ω termination switch **OFF**, common ground with the vehicle, tap CAN-H/CAN-L on the PT-CAN. (Note: the firmware runs `TWAI_MODE_NORMAL` and ACKs the bus — not listen-only — see [[can-bus-integration]].) **Log everything raw for the whole session** and save the dump into `wiki/raw/` — even IDs we don't care about yet.
Setup notes still apply. **Most of the original checklist is now done** — gear (lever, engaged, mode), coolant, gearbox temp, battery, RPM, engine state are all resolved. What remains:
| Test | Watch | Confirms |
|------|-------|----------|
| Ignition on, engine off | `0x130` byte 0 changes per key position; `0x3B4` appears (~every 5 s) | Terminal status; battery message alive |
| Compare `0x3B4` to a multimeter at the battery | Try 12-bit LE ×0.015 and ×0.0147 vs meter (engine off ≈12.4 V, running ≈14+ V); check byte 3 flips 0x00→0x09 on start | Battery layout + factor; engine-running flag |
| Cold start, note ambient temp | `0x1D0` byte 0 ≈ ambient+48 raw, then climbs steadily to ~90 °C (raw ~0x8A) | Coolant ID + −48 scaling |
| Same, byte 1 | Should ALSO start near ambient but climb **slower** than byte 0 and lag behind | Oil temp really is byte 1 (weakest engine signal) |
| Cold start | `0x0B5` byte 7: if raw ≈ ambient → offset 0; if raw ≈ ambient+40… i.e. reads 40 under ambient with offset 0 assumed → offset +40 | Gearbox temp offset dispute (cold start makes the two hypotheses ~40 apart — unmistakable) |
| Hold brake, shift P→R→N→D→(S/M) slowly | `0x1D2` byte 0 (note DLC: 5 vs 6!); `0x304` bytes; `0x0BA` bits 0–3 | Gear lever encoding + which message to use; settles the D=R typo in the E60 sheet |
| Drive: let the box shift 1→2→3… | `0x1D2` byte 1 upper nibble, `0x0BA` low nibble increments per shift | Current gear number source |
| Blip throttle | `0x0AA` bytes 4–5 = RPM×4 | RPM sanity check (fast cross-check that you're on the right bus) |
| **Wheels lifted, steady speed in D; step 1st→6th** | `0x0BA` D3/D4 vs `0x1A2` turbine vs `0x0AA` RPM, logged together | **Output-shaft scaling.** Turbine ÷ output at each gear should reproduce the 6HP26 ratios — a built-in self-check. → [[driveline-speed-signals]] |
| Compare `0x3B4` to a multimeter at the battery | `((D1 & 0x0F) << 8 \| D0) × 0.015` vs meter (engine off ≈12.4 V, running ≈14+ V) | Battery factor — layout is settled, this is a sanity pass only |
| Cross-check `0x0B5` D7 − 40 against the Launch's gearbox oil temp readout | Expect agreement within a degree | Confirmatory only — offset already settled two ways |
| Lever to R **on the ground**, brake released | `0x1A2` turbine ÷ `0x0AA` RPM ratio | The engagement test for the "lever says R but nothing happens" fault → [[driveline-speed-signals]] |
| Engage cruise (if the donor's stalk is wired) | `0x0AA` `ST_CLCTR_V` bits 52–55 → `0x4`–`0x7` | Whether the DME's CC regulator is live on this swap |
If an expected ID is absent entirely, note it — it means the swap harness dropped that module's traffic, which is itself an answer ([[open-questions]] #3).
Absent IDs are themselves answers — `0x130`/`0x304`/`0x192` and the whole DSC group (`0x0CE`/`0x19E`/`0x1A0`) never appear, meaning CAS and DSC aren't on the swap bus ([[open-questions]] #3).
## Fault codes: passive reading is NOT possible ⚠
@@ -77,9 +100,9 @@ Also useful: an E60 forum claim `(unverified)` that arbitration IDs are identica
## Sources
- [[e65-reverse-engineering-repo]] — **E65/E66 per-ID DBC-style docs (ingested 2026-07-17)** — the highest-value source found so far: resolved the gearbox-temp offset and battery layout, closed the engine-state question, and supplied turbine speed, output shaft, pedal position and cruise state. Caveat: petrol MED 9.2.1 donor, not M57N diesel
- [[e60-vfl-can-codes-xlsx]] — **E60 VFL community spreadsheet (ingested)**: E60-specific confirmation of 0x1D0 (−48 scaling), 0x3B4, 0x1D2 DLC 6; adds 0x304 gear lever; contains NO oil-temp or gearbox-temp rows
- [[listen-and-send-pid-arduino]] — technique reference (ingested): ELM327 PID-request pattern for the fault-code fallback; E46 cluster frames, not E60 evidence
- `HeinrichG-V12/E65_ReverseEngineering` (GitHub) — E65 760Li PT-CAN, docs verified verbatim by the adversarial pass (0x1D0, 0x3B4, 0x192, 0x1D2, 0x0BA, 0x1A2)
- `damienmaguire/BMW-E65-CANBUS` (GitHub) — live E65 735i captures + working EGS emulator code (0x1D2 encoding, 0x192, 0x0AA)
- `TimesNewRomanZ/e60-canbus` (GitHub, community `bmw_e9x_e8x.dbc`) — author runs a real E60 545i; 0x1D0 confirmed live on E60
- `kmalinich/dieslg8` (GitHub) — M57 diesel (E90 335d, EDC17): diagnostic-request-only coolant/DTC evidence
@@ -89,11 +112,13 @@ Also useful: an E60 forum claim `(unverified)` that arbitration IDs are identica
## Caveats
- No source used an actual **E60 M57N diesel** end-to-end; the closest anchors are the E60 tool32 table (lists DDE1 as sender for 0x1D0/0x3B4), the E60 VFL spreadsheet (real pre-facelift E60, engine variant unknown), and the M57 dieslg8 project (different chassis generation). Engine-side layouts are inferred from petrol DME captures of the same bus generation.
- **Oil temp and gearbox oil temp remain the weakest signals** — absent from both E60-specific sources; only the E9x DBC and E65 docs place oil temp at 0x1D0 byte 1, and only the E9x DBC has gearbox temp (0x0B5 byte 7, offset disputed).
- Firmware's current IDs (`0x4F`, `0x55`, `0x201`, `0x1001`, `0x101F`) are contradicted by every source AND **confirmed absent from the live bus** (verified, 2026-07-15) — definitively placeholders. → [[can-bus-integration]]
- Promotion to `(verified)` requires a live capture from the swap's bus: warm the engine and watch 0x1D0 byte 0 climb, shift through P/R/N/D and watch 0x1D2. **Partially done** 2026-07-15 ([[can-capture-2026-07-15]]): IDs + 0x1D2 gear codes verified; coolant/battery scaling still needs a cold-start capture with confirmed engine state.
- No source used an actual **E60 M57N diesel** end-to-end; the closest anchors are the E60 tool32 table (lists DDE1 as sender for 0x1D0/0x3B4), the E60 VFL spreadsheet, and the M57 dieslg8 project. Engine-side layouts are inferred from petrol DME captures of the same bus generation. **Mitigating evidence (2026-07-17)**: every signal from the petrol-donor [[e65-reverse-engineering-repo]] that we checked against our own bus decoded to physically sensible values first try — coolant, gearbox temp, RPM, turbine speed, engine state, gear. The layouts evidently carry.
- **Engine oil temp is now the only dead signal**: `0x1D0` byte 1 reads `0xFF` on our bus — the sensor isn't populated on this M57N. Not a decode error; there is nothing to read. The UART packet's `engine_oil_temp` field has no source.
- **`AIP_ENG` (`0x1D0` byte 3) is barometric, not boost** — 8 bits ×2 +598 caps at 1108 hPa; a boosting M57N reaches ~2500 hPa absolute. Manifold boost is **not broadcast**; the Launch polls for it. → [[obd-diagnostic-polling]]
- Firmware's original IDs (`0x4F`, `0x55`, `0x201`, `0x1001`, `0x101F`) are contradicted by every source AND **confirmed absent from the live bus** (verified, 2026-07-15) — definitively placeholders. → [[can-bus-integration]]
- **The cold-start capture is no longer needed.** It was on the list only because the 2026-07-15 engine state was unknown; `ST_ENGINE_RUN` = running in 397/397 frames settles that, making the coolant trace a genuine warm-up and its −48 scaling trustworthy.
- Remaining `(unverified)`: `0x0BA` `ST_GR_GRB` values 6–A (2nd–6th, inferred from the parallel `0x1D2` ladder), and the `0x0BA` D3/D4 output-shaft **scaling**. → [[driveline-speed-signals]]
## Related
[[can-bus-integration]] · [[bmw-m57n-engine]] · [[nissan-patrol-swap]] · [[open-questions]]
[[can-bus-integration]] · [[driveline-speed-signals]] · [[e65-reverse-engineering-repo]] · [[gear-box-can-revealings]] · [[bmw-m57n-engine]] · [[nissan-patrol-swap]] · [[open-questions]]