Skip to content

NFSX — developer guide

Packages

PackagePurpose
@emdzej/nfsx-cliCLI (nfsx command)
@emdzej/nfsx-flashIPO-driven 5-stage FlashSession orchestrator
@emdzej/nfsx-flash-data.0PA/.0DA parser, S37 parser, MS42/MS43 checksums
@emdzej/nfsx-directmodeRaw DS2 flashing (SEED/KEY, erase, write, verify)
@emdzej/nfsx-bootmodeC167 BSL bootmode (MiniMon + JMG blob paths)
@emdzej/nfsx-runtimeNFS-specific CABI slot overrides on the inpax VM
@emdzej/nfsx-resolverSP-Daten lookup chain (HWNR → SG_TYP → IPO + SGBD)
@emdzej/nfsx-data-filesParsers for SP-Daten text files
@emdzej/nfsx-fscFSC / certificate manager

Architecture

nfsx flash (IPO-driven) resolves an HWNR through SP-Daten, loads the target IPO, and drives the inpax BEST/2 VM through the full SG_PROGRAMMIEREN job — the same code path BMW's WinKFP takes. The runtime overrides file I/O, BinBuf, and ApiJobData slots so the IPO can read firmware from .0PA archives and push it through ediabasx.

nfsx directmode skips the IPO layer and talks DS2 directly: frame building, SEED/KEY auth, AMD flash erase/write sequences, per-ECU region tables. Uses ediabasx for the K-line transport.

nfsx bootmode bypasses BMW firmware entirely via the Infineon C167 mask-ROM BSL. Two secondary loaders are supported: MiniMon (public, ~394 bytes) with custom flash stubs, and the JMG blob (898 bytes, monolithic with built-in AMD AM29F400B driver).

Protocol documentation

In-repo docs cover the wire protocols in detail:

Building from source

bash
git clone git@github.com:emdzej/nfsx.git
cd nfsx
pnpm install
pnpm -r build
pnpm -r test

Dependencies

Built on top of:

Most projects are PolyForm Noncommercial; some are MIT — see each repo for the canonical licence.