Skip to content

About

ME7Logger/ME7Info open source replacement/workalike. Also can generate XDF maps.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Repository files navigation

me7-logger

Tools for Bosch ME7 engine control units, in Go, for macOS, Linux and Windows.

Program Does Reads Writes
me7info Locates measurements and calibration maps in a flash image, and copies a map catalog onto another image image.bin, a reference catalog ME7Logger .ecu, TunerPro .xdf, model JSON, Ghidra label TSV
me7logger Samples ECU RAM over the K-line diagnostic port image.bin, session.cfg CSV

Neither program writes flash or EEPROM. me7info never opens a serial port.

me7info place ref.json ref.bin dst.bin writes a model JSON for the second image. A body that still matches is kept. One code pointer, found once, moves the object. Anything else is left out. The model's origin is auto.

Workflow

flowchart LR
  ecu[(ECU flash)] -->|your flash tool| bin[image.bin]
  bin --> gen["me7info generate"]
  gen --> ecufile[ecus/image.ecu]
  gen --> xdf["image.xdf<br/>tuner maps"]
  gen -.->|--full-xdf| full["image-full.xdf<br/>every located map"]
  gen -.->|--labels| labels["labels.tsv<br/>Ghidra labels"]
  xdf --> tp[TunerPro]
  full --> tp
  ecufile --> cfg["session.cfg<br/>variables, sample rate"]
  bin --> log["me7logger log"]
  cfg --> log
  cable[K-line cable] --- log
  log --> csv[log.csv]
  csv --> plot["ECUxPlot or<br/>any CSV viewer"]
Loading
  1. Read the flash image from the ECU with a flash tool. These programs don't read flash.
  2. me7info generate image.bin writes ecus/image.ecu, plus image.xdf beside the image when it locates calibration maps.
  3. List the variables to log in session.cfg, pointing at ecus/image.ecu.
  4. me7logger log -p PORT -o log.csv image.bin session.cfg logs until Ctrl-C.

Commands, the session.cfg format and user overrides: QUICKSTART.md.

What me7info generate does

flowchart TD
  bin[image.bin] --> id["Identify<br/>part number, DPP block"]
  id --> needles["Needles<br/>config/needles.yaml"]
  id --> sigs["Map signatures<br/>config/mapsigs.d/"]
  user["config/user/*.yaml<br/>your overrides"] -.-> needles
  user -.-> sigs
  needles --> items["Measurements<br/>RAM addresses, conversions"]
  sigs --> maps["Calibration maps<br/>addresses, axes"]
  items --> ecuw[".ecu writer"] --> ecufile[ecus/image.ecu]
  maps --> xdfw["xdfkit<br/>model, .xdf writer"]
  cats["config/categories.json<br/>tuner names, categories"] --> xdfw
  xdfw --> xdf[image.xdf]
  xdfw -.-> full[image-full.xdf]
Loading
  • Measurements are found by masked byte patterns ("needles") and a few decoded instructions, not by disassembling the whole image.
  • Each Bosch map name and the bytes that locate it are a row in config/mapsigs.d/ (layout-scoped shards, first hit wins). A RAM address other rows splice is a row in config/signatures.yaml.
  • image.xdf holds the maps named in config/categories.json, filed under its categories, plus the maps at their axis addresses. --full-xdf writes every located map, with the rest under Other.
  • --labels labels.tsv writes the addr, name, size, comment TSV that ME7ImportLabelsScript in ghidra-me7-analyzer reads: needle function entries (0x800000 plus the file offset), the .ecu RAM items, and each named map body and axis. A needle with several entries is NAME_ADDR.
  • me7info probe image.bin reports what was found without writing files. With --maps, it also prints how many maps each XDF would hold, and any axis constant it couldn't turn into an axis-point curve.
  • --5120 auto reads located PUMN, PUMX, and PUE. The stock conversion is the mbar scale for that cell. When the doubled value is inside 400–1200 mbar and the stock value is outside it, every mbar factor is doubled. on doubles them. off leaves them.

How me7logger reads RAM

sequenceDiagram
  participant L as me7logger
  participant E as ECU
  L->>E: 5-baud or fast init (address from image.bin)
  E-->>L: keywords, at 10400 baud
  L->>E: StartCommunication, diagnostic session
  loop each sample
    L->>E: $23 ReadMemoryByAddress (up to 254 bytes)
    E-->>L: RAM bytes
    L->>L: convert with ecus/image.ecu, append a CSV row
  end
Loading
  • Logging stays at 10400 baud. Each request reads up to 254 contiguous bytes, so variables spread across RAM lower the sample rate.
  • SamplesPerSecond in session.cfg is 1 to 50, default 10; -s overrides it.
  • -1 reads one sample and stops, as a connection check.

Configuration

flowchart LR
  shipped["config/<br/>shipped definitions"] --> merged[loaded config]
  user["config/user/*.yaml<br/>added or replaced rows"] --> merged
  embedded["embedded copy<br/>when config/ lacks the file"] -.-> merged
  merged --> tools[me7info, me7logger]
Loading

The programs read config/ beside the executable, symlinks resolved, so a symlink in /usr/local/bin works: the unpacked release, build/ after make, or the make install directory. Each file documents its fields in its header. Rows in config/user/ with the same name replace the shipped ones; --user or ME7_USER picks another directory.

Install

Release archives for macOS, Linux and Windows (amd64; arm64 for macOS and Linux) are on the releases page. Unpack one and run the programs from it, or symlink them onto your PATH.

From source, with Go installed:

make                 # runs the tests, builds build/me7info and build/me7logger
sudo make install    # /usr/local/lib/me7-logger, links in /usr/local/bin
make help            # all targets

PREFIX moves the install (PREFIX=/usr gives /usr/lib/me7-logger and /usr/bin). DESTDIR stages it for a package. The installed config/ is root-owned, so put your rows elsewhere and point ME7_USER at them. make uninstall removes the install and the links that point into it, and keeps any config/user/ there.

Development

DEVELOPER.md covers the design, the config files, the parity scoring against legacy ME7Info output, and the private image corpus the tests use.

Related projects:

  • xdfkit: converts map definitions between WinOLS KP, TunerPro XDF and JSON. me7info writes its XDF and reads the corpus definitions with it. This repo publishes the corpus map packs (publish/).
  • ecu-corpus (private): flash images and their map definitions, shared by the test suites.

Releases

make package writes dist/. Tag vX.Y.Z publishes it; -rcN is a prerelease.

Warning

Under heavy development, and history is rewritten often. Expect to git reset --hard origin/master. Nothing is a public contract yet: config formats, flags and output can change without notice.

License

MIT, see LICENSE.

About

ME7Logger/ME7Info open source replacement/workalike. Also can generate XDF maps.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages