RAM Logging & .ecu Files
C167CR RAM layout, the 25 channels worth logging, and generating an .ecu file.
C167CR RAM layout, the 25 channels worth logging, and generating an .ecu file.
While standard OBD-II diagnostic tools (such as generic scan tools or standard VCDS measuring blocks) poll data via ISO 9141-2 / KWP1281 at sluggish sample rates of 2 to 4 Hz across only 3 or 4 channels simultaneously, ME7Logger utilizes proprietary Bosch engineering KWP2000 diagnostic hooks to poll internal microcontroller RAM directly via dynamic packet definition at sample rates of 20 to 50 Hz across up to 138 mixed channels.
To achieve this, ME7Logger requires an .ecu definition file that maps high-level variable names (nmot_w, rl_w, pvdks_w, dwkrz_0) to physical 24-bit C167CR microcontroller RAM addresses.
12.1. Infineon C167CR Internal RAM Architecture & Addressing Rules#
The Infineon C167CR-LM microcontroller utilizes a segmented memory architecture governed by Data Page Pointers (DPP0 through DPP3):
- Internal RAM (IRAM): Spans physical addresses
0x380000to0x383FFF(16\text{ KB} total). - DPP2 Mapping (
0x00E0): In C167CR execution, internal RAM is addressed via page registerDPP2. In 16-bit operand instructions, any RAM reference must have bits 15–14 set to0b10(0x8000 | offset). For example, RAM offset0x0FD2is executed as0x8FD2. - Special Function Registers (SFRs): Spans
0x00FD00to0x00FDFF(mapped viaDPP3 = 0x0003). Operands must be prefixed with0xFDxx. - ME7Logger
.ecuConvention: In.ecudefinition files, ME7Logger expects the full physical 24-bit linear address (0x38xxxxfor RAM variables,0x00FDxxfor SFRs).
C167CR DATA PAGE POINTER (DPP) MEMORY SEGMENTATION
| Pointer | Page Value | Linear Physical Range | Target Hardware / Subsystem |
|---|---|---|---|
| DPP0 | 0x0000 | 0x000000 – 0x003FFF | Flash ROM Bank 0 (Interrupts / Boot) |
| DPP1 | 0x0004 | 0x010000 – 0x013FFF | Flash ROM Bank 1 (Calibration Maps) |
| DPP2 | 0x00E0 | 0x380000 – 0x383FFF | Microcontroller Internal RAM (16 KB) |
| DPP3 | 0x0003 | 0x00C000 – 0x00FFFF (SFRs) | Bit-Addressable RAM & On-Chip Peripherals |
12.2. Top 25 Core Live Telemetry Variables & Physical Addresses (06A906032LP)#
The table below compiles the definitive RAM registry for 06A906032LP (and 06A906032JJ / h24bw05g), establishing the foundation for in-car telemetry stations and dynamic logging profiles:
| Variable Name | Physical RAM Address | Size & Type | Signed | Scale Factor | Additive Offset | Physical Units | Description |
|---|---|---|---|---|---|---|---|
nmot_w | 0x380A90 | 2 Bytes (u16) | No | 0.25 | 0.0 | \text{rpm} | Engine Speed (Crankshaft) |
rl_w | 0x380D2A | 2 Bytes (u16) | No | 0.023438 | 0.0 | \% | Relative Engine Load |
zwist | 0x380D8C | 1 Byte (u8) | Yes | 0.75 | -48.0 | \text{°BTDC} | Actual Current Ignition Angle |
dwkrz_0 | 0x380EA0 | 1 Byte (u8) | No | 0.75 | 0.0 | \text{°KW} | Knock Retard Cyl 1 |
dwkrz_1 | 0x380EA1 | 1 Byte (u8) | No | 0.75 | 0.0 | \text{°KW} | Knock Retard Cyl 2 |
dwkrz_2 | 0x380EA2 | 1 Byte (u8) | No | 0.75 | 0.0 | \text{°KW} | Knock Retard Cyl 3 |
dwkrz_3 | 0x380EA3 | 1 Byte (u8) | No | 0.75 | 0.0 | \text{°KW} | Knock Retard Cyl 4 |
wped_w | 0x3809AC | 2 Bytes (u16) | No | 0.001526 | 0.0 | \% | Accelerator Pedal Position |
dkv_w | 0x3809C2 | 2 Bytes (u16) | No | 0.001526 | 0.0 | \% | Throttle Plate Angle |
pvdks_w | 0x380D4C | 2 Bytes (u16) | No | 0.039063 | 0.0 | \text{hPa} | Charge Pressure Before Throttle (MAP) |
pvds_w | 0x380D4E | 2 Bytes (u16) | No | 0.039063 | 0.0 | \text{hPa} | Intake Manifold Pressure |
plsol | 0x3812C4 | 2 Bytes (u16) | No | 0.039063 | 0.0 | \text{hPa} | Target Specified Boost Pressure |
ldtv | 0x381310 | 1 Byte (u8) | No | 0.390625 | 0.0 | \% | Wastegate Duty Cycle (N75) |
ti_b1 | 0x380D6E | 2 Bytes (u16) | No | 0.002667 | 0.0 | \text{ms} | Effective Injection Pulse Width |
fr_w | 0x380E62 | 2 Bytes (s16) | Yes | 0.0000305 | 1.0 | \lambda | Short-Term Lambda Controller |
fra_w | 0x382F8C | 2 Bytes (s16) | Yes | 0.0000305 | 1.0 | \lambda | Multiplicative LTFT (Fuel Trim) |
rkadd_w | 0x382F90 | 2 Bytes (s16) | Yes | 0.007813 | 0.0 | \% | Additive LTFT (Idle Trim) |
lamsoni_w | 0x380E5E | 2 Bytes (u16) | No | 0.000244 | 0.0 | \lambda | Actual Wideband Lambda (LSU 4.2) |
lamsbg_w | 0x380E58 | 2 Bytes (u16) | No | 0.000244 | 0.0 | \lambda | Target Specified Lambda |
mshfm_w | 0x380A40 | 2 Bytes (u16) | No | 0.1 | 0.0 | \text{kg/h} | Air Mass Flow Rate (MAF) |
tmot | 0x380980 | 1 Byte (u8) | Yes | 0.75 | -48.0 | \text{°C} | Engine Coolant Temperature |
tans | 0x380982 | 1 Byte (u8) | Yes | 0.75 | -48.0 | \text{°C} | Intake Air Temperature |
tabg_w | 0x38148C | 2 Bytes (u16) | No | 0.1 | 0.0 | \text{°C} | Modeled Exhaust Gas Temp (EGT) |
vfzg | 0x3809E8 | 1 Byte (u8) | No | 1.25 | 0.0 | \text{km/h} | Vehicle Road Speed |
gangi | 0x3809FA | 1 Byte (u8) | No | 1.0 | 0.0 | - | Current Engaged Gear (0\dots 6) |
12.3. Automated ME7Logger .ecu Configuration File Structure#
Adhering strictly to user:workspace-standards, an .ecu definition file consists of a metadata header, communication timings, and variable descriptors:
[General]
ECUName = 06A906032LP
Description = VW Golf MK4 GTI 1.8T AWP 180PS (6-Speed Manual 02M)
PartNumber = 06A906032LP
SoftwareNumber = 1037366194
SoftwareVersion = 0005
CommunicationMode = KWP2000
BaudRate = 125000
[Measurements]
; Format: Name, Address, Size (bytes), Signed (S/U), Factor, Offset, Units, LongName
nmot_w, 0x380A90, 2, U, 0.25, 0.0, rpm, Engine Speed
rl_w, 0x380D2A, 2, U, 0.023438, 0.0, %, Relative Engine Load
zwist, 0x380D8C, 1, S, 0.75, -48.0, deg BTDC, Current Ignition Angle
dwkrz_0, 0x380EA0, 1, U, 0.75, 0.0, deg KW, Knock Retard Cyl 1
dwkrz_1, 0x380EA1, 1, U, 0.75, 0.0, deg KW, Knock Retard Cyl 2
dwkrz_2, 0x380EA2, 1, U, 0.75, 0.0, deg KW, Knock Retard Cyl 3
dwkrz_3, 0x380EA3, 1, U, 0.75, 0.0, deg KW, Knock Retard Cyl 4
wped_w, 0x3809AC, 2, U, 0.001526, 0.0, %, Accelerator Pedal Position
dkv_w, 0x3809C2, 2, U, 0.001526, 0.0, %, Throttle Plate Angle
pvdks_w, 0x380D4C, 2, U, 0.039063, 0.0, hPa, Charge Pressure Before Throttle
plsol, 0x3812C4, 2, U, 0.039063, 0.0, hPa, Specified Boost Pressure
ldtv, 0x381310, 1, U, 0.390625, 0.0, %, Wastegate Duty Cycle N75
ti_b1, 0x380D6E, 2, U, 0.002667, 0.0, ms, Effective Injection Time
lamsoni_w, 0x380E5E, 2, U, 0.000244, 0.0, lambda, Actual Wideband Lambda
lamsbg_w, 0x380E58, 2, U, 0.000244, 0.0, lambda, Target Specified Lambda
mshfm_w, 0x380A40, 2, U, 0.1, 0.0, kg/h, Mass Air Flow Rate
tmot, 0x380980, 1, S, 0.75, -48.0, C, Engine Coolant Temperature
tans, 0x380982, 1, S, 0.75, -48.0, C, Intake Air Temperature
tabg_w, 0x38148C, 2, U, 0.1, 0.0, C, Modeled Exhaust Gas Temperature
vfzg, 0x3809E8, 1, U, 1.25, 0.0, km/h, Vehicle Road Speed
gangi, 0x3809FA, 1, U, 1.0, 0.0, -, Current Engaged Gear
12.4. Automated DAMOS-to-ECU Definition Generator (me7_damos_to_ecu.py)#
Below is the standalone Python utility that parses any Bosch ASAP2 DAMOS (.dam) or A2L file and generates a fully compliant ME7Logger .ecu configuration file:
#!/usr/bin/env python3
"""
Bosch ME7.5 DAMOS-to-ME7Logger Definition Generator
Converts .dam / .a2l internal ASAP2 symbol records into .ecu logging profiles.
"""
import re
import sys
def parse_damos_and_generate_ecu(dam_path, output_ecu_path, ecu_name="ME7_CUSTOM"):
# Target symbols to extract from DAMOS
target_symbols = {
'nmot_w': ('Engine Speed', 'rpm', 0.25, 0.0, 2, 'U'),
'rl_w': ('Relative Engine Load', '%', 0.023438, 0.0, 2, 'U'),
'zwist': ('Actual Ignition Timing', 'deg BTDC', 0.75, -48.0, 1, 'S'),
'dwkrz_0': ('Knock Retard Cyl 1', 'deg KW', 0.75, 0.0, 1, 'U'),
'dwkrz_1': ('Knock Retard Cyl 2', 'deg KW', 0.75, 0.0, 1, 'U'),
'dwkrz_2': ('Knock Retard Cyl 3', 'deg KW', 0.75, 0.0, 1, 'U'),
'dwkrz_3': ('Knock Retard Cyl 4', 'deg KW', 0.75, 0.0, 1, 'U'),
'wped_w': ('Accelerator Pedal', '%', 0.001526, 0.0, 2, 'U'),
'dkv_w': ('Throttle Angle', '%', 0.001526, 0.0, 2, 'U'),
'pvdks_w': ('Boost Pressure (MAP)', 'hPa', 0.039063, 0.0, 2, 'U'),
'plsol': ('Specified Boost', 'hPa', 0.039063, 0.0, 2, 'U'),
'ldtv': ('Wastegate Duty Cycle', '%', 0.390625, 0.0, 1, 'U'),
'ti_b1': ('Injection Pulse Time', 'ms', 0.002667, 0.0, 2, 'U'),
'lamsoni_w': ('Actual Lambda', 'lambda', 0.000244, 0.0, 2, 'U'),
'lamsbg_w': ('Specified Lambda', 'lambda', 0.000244, 0.0, 2, 'U'),
'mshfm_w': ('Mass Air Flow', 'kg/h', 0.1, 0.0, 2, 'U'),
'tmot': ('Coolant Temperature', 'C', 0.75, -48.0, 1, 'S'),
'tans': ('Intake Air Temp', 'C', 0.75, -48.0, 1, 'S'),
'tabg_w': ('Exhaust Gas Temp', 'C', 0.1, 0.0, 2, 'U'),
'vfzg': ('Vehicle Speed', 'km/h', 1.25, 0.0, 1, 'U'),
'gangi': ('Engaged Gear', '-', 1.0, 0.0, 1, 'U')
}
found_entries = []
print(f"Scanning {dam_path} for RAM symbols...")
with open(dam_path, 'r', encoding='latin-1', errors='ignore') as f:
content = f.read()
# Search for ASAP2 /SPZ records: /SPZ SymbolName Address
for sym, meta in target_symbols.items():
# Match pattern: /SPZ sym $Address or /SPZ sym 0xAddress
match = re.search(rf'/SPZ\s+{sym}\s+[\$0x]*([0-9A-Fa-f]+)', content)
if match:
raw_addr = int(match.group(1), 16)
# Normalize to 24-bit physical RAM address (0x380000 base)
if raw_addr < 0x010000:
ram_addr = 0x380000 | (raw_addr & 0x3FFF)
elif (raw_addr & 0xF00000) == 0x800000:
ram_addr = 0x380000 | (raw_addr & 0x3FFF)
else:
ram_addr = raw_addr
found_entries.append((sym, ram_addr, meta))
print(f"Found {sym:<10} -> 0x{ram_addr:06X} ({meta[0]})")
else:
print(f"Symbol {sym} not found in DAMOS.")
# Write output .ecu file
with open(output_ecu_path, 'w') as f:
f.write("[General]
")
f.write(f"ECUName = {ecu_name}
")
f.write(f"Description = Auto-Generated ME7Logger Definition from {dam_path}
")
f.write("CommunicationMode = KWP2000
")
f.write("BaudRate = 125000
")
f.write("[Measurements]
")
f.write("; Name, Address, Size, Signed, Factor, Offset, Units, LongName
")
for sym, addr, meta in found_entries:
desc, units, factor, offset, size, signed = meta
f.write(f"{sym}, 0x{addr:06X}, {size}, {signed}, {factor}, {offset}, {units}, {desc}
")
print(f"Generated {output_ecu_path} with {len(found_entries)} telemetry channels.")
if __name__ == '__main__':
if len(sys.argv) < 3:
print("Usage: python3 me7_damos_to_ecu.py <input.dam> <output.ecu> [ECUName]")
sys.exit(1)
name = sys.argv[3] if len(sys.argv) > 3 else "06A906032LP"
parse_damos_and_generate_ecu(sys.argv[1], sys.argv[2], name)
Related#
Cross-referenced on shared calibration symbols, not on subject matter — these are the chapters that touch the same maps.
- Chapter 31 — MAFless / Speed Density —
MSHFM_W,DKV_W,TI_B1,TANS,FR_W,FRA_W - Chapter 60 — Post-Dyno Verification —
PVDS_W,LAMSBG_W,FRA_W,LAMSONI_W,TABG_W,ZWIST - Chapter 35 — High-Speed Logging —
PLSOL,LDTV,DWKRZ_0,LAMSONI_W,PVDKS_W,TMOT - Chapter 25 — Troubleshooting & Failsafes —
DKV_W,TANS,FRA_W,WPED_W,N75,NMOT_W - Chapter 10 — Serial EEPROM & Immo —
RKADD_W,DWKRZ_3,DWKRZ_0,FRA_W - Chapter 13 — 121-Pin Harness —
VFZG,GANGI,TABG_W,N75
← Previous chapter · Contents · Next chapter →
Related
Cross-referenced on shared calibration symbols, not on subject matter — these are the chapters that touch the same maps.