Skip to content

About

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

Topics

Resources

Stars

5 stars

Watchers

2 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 session.cfg + generated .ecu 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"]
  ecufile --> log["me7logger"]
  cfg --> log
  cable[K-line cable] --- log
  log --> csv["logs/session_….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 (Connect, Session or SafeOnly, LogSpeed, measurements), plus image.xdf beside the image when it locates calibration maps. Use --5120 here when needed; the logger does not take a bin.
  3. List the variables to log in session.cfg, pointing at ecus/image.ecu.
  4. me7logger session.cfg (sole USB cable, or --usb N / -p PORT) writes logs/session_<date>_<time>.csv until Ctrl-C (--tag optional; -o appends / -o - stdout). The .ecu is the logging contract. Session=0x86 allows the embedded RAM handler at LogSpeed; SafeOnly=yes (or --safe) stays on stock 0x23 at 10400.

If connect fails with the generated .ecu (no sync / keywords), see QUICKSTART.md Connect / double slowinit (SLOW-0x00); the engine must be stopped for that first connect.

Do not copy or log against files under testdata/. They are internal parity fixtures only and are deprecated for users. Always generate from an original (ORI) bin of your own ECU.

Commands and the session.cfg format: 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/"]
  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 for ME7 Ghidra label import: 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. See docs/ghidra/.
  • 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

With Session=0x86 in the .ecu, the default path matches ME7Logger (embedded log/logger/handler.bin + LogSpeed / 0xBE). SafeOnly or --safe is stock 0x23 at 10400. Flags: QUICKSTART.md.

  • SamplesPerSecond in session.cfg is 1 to 50, default 10; -s overrides it.
  • -c 0 connects and writes the ident header only (no handler; CSV stays 10400/HM0); -1 / -c N stop after samples. --abs-time, --align, and --no-header adjust TIME and CSV headers (QUICKSTART.md).
  • Typical SPS and how channel count affects rate: docs/logging-rate.md.
  • Connect / Session / SoftContinue background: docs/kwp-connect.md.

Configuration

flowchart LR
  shipped["config/<br/>beside the executable"] --> info[me7info]
  embedded["embedded copy<br/>when config/ lacks the file"] -.-> info
Loading

me7info reads 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. --core, --names, --meas, --map, or --alias (or ME7_*) replaces one file. me7logger reads only the .ecu.

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. Change a definition in a checkout and rebuild. make uninstall removes the install and the links that point into it.

Development

AGENTS.md is for coding agents and is the commit / style guide for developers. DEVELOPER.md covers the design, the config files, the parity benchmark, 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 builds each OS on that OS and publishes the archives; -rcN is a prerelease. Darwin needs a Mac because USB listing links IOKit.

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.

testdata/ (including leftover testdata/parity/ecu/me7info/*.ecu) is not a sample pack. It is for internal parity testing only and is deprecated for any other use. Run me7info on your own ORI bin.

License

GNU General Public License, version 3 or any later version. See LICENSE.

The embedded RAM handler (log/logger/handler.bin, source in log/logger/handler/) is from me7log, Copyright (C) 2023 prj, under the same license.

About

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

Topics

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages