Memory map
Confidence tags
[verified]: checked against every available dump (16 public 0110C6 images and two 512 KB reads plus one 32 KB calibration of a 0110AD ECU; see Variants) and/or against code that uses it. [inferred]: consistent with the evidence, not proven.
Hardware and file basics
| Item | Value | |
|---|---|---|
| CPU | Infineon C167CR (C166 family, 16-bit), little-endian | [verified] (C166 code throughout; BSL ident 0xC5, nfsx bootmode.md) |
| Flash | 512 KB external (the C167CR has no on-chip flash: 0x00000–0x0BFFF, which nfsx labels "C167 internal flash", is the boot end of the same external chip, on CS0), x16, AM29F400B-class bottom-boot: 16K / 8K / 8K / 32K / 7 × 64K (11 sectors) | [inferred] from the region boundaries, which fall on exactly these sector edges, and from bootmode erasing / programming the boot area like the rest of the chip |
| Non-volatile data | The two 8 KB sectors 0x4000–0x7FFF hold EEPROM-emulation records (see below) | [verified] |
| Full dump | 512 KB (0x80000), file offset = flash offset = ECU address | [verified] |
| Calibration file | 32 KB (0x8000), file offset 0 = ECU 0x48000 | [verified]: the 0110AD 32 KB file is byte-identical to 0x48000–0x4FFFF of the 0110AD 512 KB read |
ECU bus address vs file offset
Unlike MS43 (program at ECU 0x90000, file + 0x80000), MS42 addresses its flash 1:1. The ECU address of every byte is its file offset. [verified]:
- The checksum region tables store
0x0001_1000 … 0x0007_EC65and0x0004_8000 … 0x0004_F843. Only a 1:1 reading makes the CRCs match. - Boot code sets
DPP0 = 0x12,DPP1 = 0x14,DPP2 = 0x13(pages0x48000,0x50000,0x4C000) at0x0666. It then reads the checksum header at near0x42CE, which is ECU0x502CE. The program keeps those DPPs. It reads the calibration-CRC disable word at near0xBEFE(ECU0x4FEFE) and the program flag at near0x402C(ECU0x5002C). - 122 of the 128 interrupt vectors are
JMPS 05:xxxxinto the forwarders at file0x500A8–0x502A3. - Patchlist code:
DA 06 F0 0C(CALLS 06h, 0CF0h) at0x140F0calls the routine the same patch places at file0x60CF0.
DS2 read and write use the same addresses (nfsx raw-ds2-flashing.md §5.2; see Flashing). nfsx's full write covers 0x11000–0x3FFFF and 0x5002C–0x7FFFF after one erase at 0x11000, plus the calibration 0x48000–0x4FFEF. It never writes the boot sector, the EEPROM sectors, boot block 2 or the two block markers. [per nfsx code]
Chip selects
Set up by the reset code at 0x067A (ADDRSELx/BUSCONx, see probe.txt):
| Window | Select | Use | |
|---|---|---|---|
| everything not below | CS0 (BUSCON0) | the flash | [verified] |
0x0C000–0x0DFFF (8 KB) | CS2 | external RAM. Program variables live at 0xC000–0xD3xx | [inferred] |
0x10000–0x10FFF (4 KB) | CS3 | peripheral, written (0xF8 → 0x10000) before EINIT | [inferred] |
0x80000–0xFFFFF (512 KB) | CS1 | outside the flash image; use unknown | [verified setup] |
0xFFF000–0xFFFFFF | CS4 | unused | [inferred] |
0x0E000–0x0E7FF, 0x0F600–0x0FFFF | on-chip | XRAM (boot block 2 copies modules to 0xE000), IRAM, SFRs | [verified] |
These windows overlay the flash. That explains why 0xC000–0xFFFF and 0x10000–0x10FFF read as FF in every dump. The flash behind them is never visible to the CPU. [inferred]
Overview
0x00000 ┌───────────────────────────────┐
│ BOOT sector (16 KB) │ vectors, boot code 0x0660-0x328F (Boot CRC),
│ │ checksum block 0x3C24, UIF, ISN, factory idents
0x04000 ├───────────────────────────────┤
│ EEPROM emulation (2 × 8 KB) │ 1 KB records, CRC-16 each
0x08000 ├───────────────────────────────┤
│ Boot block 2 (32 KB sector) │ code + XOR-checked modules 0x8000-0xB5BB,
│ │ module table 0xB800, word sum 0xBFF8;
│ │ 0xC000-0xFFFF hidden by RAM/XRAM/SFR
0x10000 ├───────────────────────────────┤
│ 0x10000-0x10FFF CS3 window │ FF
│ PROGRAM, lower (188 KB) │ code 0x11000-0x3FFFF
0x40000 ├───────────────────────────────┤
│ 0x40000-0x47FFF │ FF in every dump
0x48000 ├───────────────────────────────┤
│ CALIBRATION (32 KB) │ ident, scalars + maps 0x48092-0x4F843,
│ │ CRC block 0x4FEE0, marker 0x4FFF0
0x50000 ├───────────────────────────────┤
│ PROGRAM header + tables │ ident, vector forwarders, checksum header,
│ │ pointer tables, CAN table, CRC table
0x58000 │ FF │
0x60000 │ PROGRAM code 0x60000-0x60C43 │ free space after (patchlist code goes here)
0x68000 │ FF │
0x70000 │ PROGRAM code 0x70000-0x7EC65 │
0x80000 └───────────────────────────────┘End addresses are those of 0110C6. 0110AD ends earlier in each block; see Checksums.
Boot 0x00000–0x03FFF
| Offset | Size | Content | |
|---|---|---|---|
0x00000–0x001FF | 512 | Vector table, 128 × JMPS. Reset → 0x0660; 122 vectors → 0x500A8… (program); 5 → boot handlers | [verified] |
0x00660–0x0328F | 11 KB | Boot code: reset, chip-select setup, CRC checks of boot / program / calibration (0x0B00, 0x0CD6, 0x0E88), incremental CRC routine 0x0F0C. Identical in 0110AD and every 0110C6 dump | [verified] |
0x006D2 | Reset path: if 0xBFFC == A55A and 0xBFFE == C956, jump to boot block 2 (0x8004). Both words are 0000 in every dump | [verified code; meaning inferred: "enter loader" request] | |
0x03BA0–0x03BEB | 76 | 19 × u32, values 0x0AC0–0x3F28 | [inferred: boot pointer table] |
0x03C00 / 0x03C04 | 4 + 4 | 0x0000C152, 0x00003EDE (the ISN address) | [inferred: pointers] |
0x03C24 | 2 | Boot CRC result | [verified] |
0x03C26 | 2 | Region count (1) | [verified] |
0x03C28 / 0x03C2C | 4 + 4 | Boot CRC start 0x00000000 / end 0x00003C23 | [verified] |
0x03C3A | 4 | 0x000076C8 (MS43 has the same value at 0x3C30) | (unknown) |
0x03C3E | 12 | "000000115852" in every dump (MS43: same string) | [inferred: boot software number] |
0x03C4A | 14 × 46 | UIF (User Information Fields), one slot per programming session. See below | [verified layout from the patchlist / nfsx] |
0x03EDE | 6 (+ 60) | ISN. The patchlist's "Clear Immobilizer Data" clears 0x3EDE–0x3F1F (66 bytes, "requires bootmode flash") | [verified location; content per ECU] |
0x03F00–0x03F1F | 32 | FFFE FFFF FFFF FFFF FFFE FFFE FFFF FFFF × 2 in the 0110C6 images and the 0110AD JMG read; FF in the 0110AD read | [verified] |
0x03F20 | 8 | "REGENSBU" (Siemens Regensburg), where present | [verified] |
0x03F50 | 12 + 8 | "6577225401--" + 8 binary bytes, where present. Same part-number form as the string in boot block 2 (0x84CC 0110C6: …403--; 0x84B4 0110AD: …401--) | [inferred: boot-block-2 ident + per-ECU data] |
0x03F64 | 12 | Date-like string, YYMMDDhhmmss (0110C6 images: "990119153139") | [inferred: manufacturing timestamp] |
0x03F80 | 0x3E | Factory ident: "5WK9037---0405221713MS42…6577227601e-65772251.07-" (0110C6 images). 5WK9xxxx is the Siemens part number (0110AD ECU: 5WK90329); the patchlist and nfsx call 0x3F80 "ECU Number" | [verified string; field split inferred] |
0x03FDA | 0x26 | "6577225202----" + "11101102" × 3. Identical in every dump. 111011 is the DS2 ident key | [verified] |
0x03FE6 | 2 | Boot CRC seed (0x2D2D, the "--" of the string above). nfsx's prose doc says 0x3FF6; its code and the boot code (0x0B00) use 0x3FE6 | [verified] |
UIF
Slot layout from the Community Patchlist "User Information Fields" table and nfsx ms4x-tune.ts (0x3C4A, 14 rows × 46 bytes):
| Bytes | Label | Observed |
|---|---|---|
| 0–12 | "VIN" | The VIN, packed: first character, then 4 × 3 bytes holding 4 × 6-bit characters each (nfsx decodeVin). Not reproduced here |
| 13–15 | "DATE" | 00 79 00 (0110C6 images) |
| 16–19 | "SOFT", u32 BE | 0110C6: 7501898, 0110AD: 1430863 [inferred: BMW part number] |
| 22–25 | "SERV", u32 BE | 1429763 / 1429764 |
| 26–29 | "ASM", u32 BE | 7501897 / 1430862 |
| 30–42 | — | 00 "42324" … / 00 "00000" … [inferred: tester / station id] |
| 43 | "SW" | 0xC6 / 0xAD: last two digits of the SW number [verified] |
Every dump uses slot 1 only. No checksum covers the UIF. Elsewhere in the flash, no plain-text VIN (WB…) exists. [verified]
Bootmode flashing and the ISN
The ISN area is in the boot sector, which DS2 flashing never writes. A bootmode write of a full image replaces it. The 16 public 0110C6 images all carry the same ISN, UIF and EEPROM area, taken from one donor ECU (see Variants). Bootmode-flashing one of them as-is gives the ECU the donor's immobiliser pairing. Keep the original boot sector, or re-align EWS afterwards.
EEPROM emulation 0x04000–0x07FFF
Two 8 KB sectors used alternately, each holding up to eight 1 KB records. The newest record is the one with the highest sequence number. When a sector is full the other is erased and written. 0110C6 images: records 0x82F9–0x8300 in 0x6000–0x7FFF, 0x8301–0x8302 in 0x4000; 0110AD: 0xCA51–0xCA58 in 0x4000–0x5FFF, 0x6000 sector erased. [verified data; rotation inferred]
| Record offset | Size | Content | |
|---|---|---|---|
+0x000 | 2 | Sequence number | [verified] |
+0x004 | 10 | "6577225107" (0110C6) / "6577225106" (0110AD), the program part number also found in the program ident | [verified] |
+0x010 … len−1 | Adaptation and other learned values. Layout not decoded | [inferred] | |
+0x3F6 | 2 | Data length len (0x312 0110C6, 0x2EE 0110AD) | [verified] |
+0x3F8 | 2 | Complement of the sequence number | [verified] |
+0x3FE | 2 | CRC-16 over +0x000 … len−1, init 0x000F (see Checksums) | [verified] |
Boot block 2 0x08000–0x0BFFF
| Offset | Size | Content | |
|---|---|---|---|
0x08000 | 4 | Magic 5A A5 56 C9 | [verified] |
0x08004 | 4 | JMPS 0x8044 (entry) | [verified] |
0x08044–0x0B5BB | ~14 KB | Code: a loader with its own DPP setup (DPP0..2 = 0, 1, 2). 0110C6 and 0110AD differ (21% equal bytes at the same offset) | [verified] |
0x08402–0x0B5BB | 39 modules (0110AD: 0x83EA–0x0B4B9). On demand each module is copied to XRAM 0xE000 and its XOR-16 is checked (0x82F0–0x837C, error code 0xB6) | [verified code] | |
0x084CC | 12 | "6577225403--" (0110C6) / "6577225401--" at 0x84B4 (0110AD) | [inferred: boot block 2 part number] |
0x0B800–0x0B937 | 39 × 8 | Module table: (id u16, start u16, length u16, xor u16); 0xFF00 ends it. Ids 0x01 … 0x7F | [verified] |
0x0BFF8 | 4 | Word sum: u32 = Σ u16 LE over 0x8000–0xBFF7 | [verified on every dump; checking code not located] |
0x0BFFC | 4 | 0000 0000: the loader request words the reset code tests | [verified] |
0x0C000–0x0FFFF | 16 KB | FF. Hidden by external RAM / XRAM / SFRs; nfsx's DS2 read stops at 0xBFFF | [inferred] |
Program
| Offset | Size | Content | |
|---|---|---|---|
0x11000–0x3FFFF | 188 KB | Main code (0110AD: to 0x3FFFD) | [verified] |
0x40000–0x47FFF | 32 KB | FF in every dump (lower half of the calibration's 64 KB sector) | [verified] |
0x50000 | 4 | Program block marker 90 48 24 42 (the calibration marker byte-reversed). Boot code (0x07CE at reset, 0x13C6) reads it via near 0x4000: this value = valid, all FF = erased, anything else = invalid. Not covered by any checksum; DS2 write starts at 0x5002C, so it is never rewritten | [verified code] |
0x5002C | 1 | 0x00. First byte DS2 writes. The program accepts a disabled calibration CRC only if this is 0xA8 | [verified code] |
0x5002E | 0x76 | Program ident: "42E30010" + "0110C6" + "6577225107--" + "11101102C600" × 3 + HW number × 6 "7500255" + "15C060E3004430" (0110AD: "42D61010" "0110AD" "6577225106--" "11101102AD01"×3, HW "1430844") | [verified] |
0x50032 | 2 | Program CRC seed ("00" 0110C6, "10" 0110AD, inside the ident) | [verified] |
0x500A4–0x502A3 | 512 | Vector forwarders (JMPS copies of the boot vectors, 0x500A8 onward) | [verified] |
0x502CE–0x50305 | 56 | Checksum header: program block {result 0x50306, seed 0x50032, ident pointers 0x50048, 0x50096, 0x5006C, 0x50081}, calibration block {start 0x48000, result 0x4FEE0, seed 0x4800C, ident 0x48010}. All (lo, hi) u16 pairs | [verified] |
0x50306 | 2 + 2 + 7 × 8 | Program CRC result, region count (7), region table | [verified] |
0x50342–0x50785 | Near-pointer tables (task / jump tables) | [inferred] | |
0x52000 | 16 × 15 | CAN bus initialisation / arbitration-ID table (patchlist "ECU Information") | per patchlist |
0x52CF2 | 512 | CRC-16/ARC table (0110AD: 0x52C78) | [verified] |
0x52EFD | End of the program header block (0110AD 0x52E83) | [verified] | |
0x60000–0x60C43 | 3 KB | Code (0110AD: to 0x60C1F). 0x60C44–0x67FFF is free; the patchlist puts its new code at 0x60C44–0x61057 | [verified] |
0x70000–0x7EC65 | 59 KB | Code (0110AD: to 0x7B815) | [verified] |
Calibration 0x48000–0x4FFFF
| Offset | Size | Content | |
|---|---|---|---|
0x48000 | 8 | Data-set id, e.g. "91c6222g" (15 distinct values over the 16 0110C6 images) / "84ad620f" | [inferred] |
0x48008 | 8 | "0110C601": SW number 0110C6 + 01 | [verified] |
0x4800C | 2 | Calibration CRC seed (ASCII "C6" → 0x3643, "AD" → 0x4441) | [verified] |
0x48010, 0x48020, 0x48030 | 16 each | Calibration ident "11101100C6010000" × 3 | [verified] |
0x48040 | 12 | "ca0110C6.DAT": calibration file name. The XDF's "Softwareversion" is 0x48042 (6 bytes) | [verified] |
0x4804C–0x48091 | FF | [verified] | |
0x48092–0x4F843 | ~30 KB | Scalars, maps and axes: all 2308 XDF items (0x48092–0x4F83C) | [verified from XDF] |
0x4F844–0x4F8D3 | FF in 0110C6. The patchlist's LC / RAL / LED / ignition-cut values go here, outside the calibration CRC. 0110AD's data runs to 0x4F8C7 | [verified] | |
0x4F8D4–0x4FEDF | ~1.5 KB | 00 | [verified] |
0x4FEE0 | 2 + 2 + 8 | Calibration CRC result, count (1), region 0x48000–0x4F843 | [verified] |
0x4FEFE | 2 | 0x0000. FFFF disables the calibration CRC check (patchlist "Checksum Bypass") | [verified code] |
0x4FFF0 | 4 | Calibration block marker 42 24 48 90. Boot code (0x1368) tests it via near 0xBFF0 with the same valid / erased / invalid logic. It is not a CRC (nfsx calls 0x4FFF0–0x4FFFF the "CRC trailer"; the calibration CRC is at 0x4FEE0). DS2 write stops at 0x4FFEF, so the marker is never rewritten | [verified code] |
The 32 KB calibration file is exactly this region. It carries the calibration CRC's result, region table and seed, so it is self-describing. See Checksums.