epicEFI OEM

Overview / Journal

Journal

Every progress report across the four controllers, newest first.

A running engine on a factory E38

epicEFI has run an engine from a stock GM E38: stock connectors, stock boot block, our firmware in the operating system area. It is the first of the four targets to get there.

Synced with epicEFI master

Merged 21 commits from epicEFI master into the GM firmware, and wrote the internal guide for building and flashing under the stock boot block. Features that are compiled out on the E38 now keep their tune fields, so a tune stays compatible with the tuning tool.

Speaking stock GM CAN

The E92 now sends 22 factory CAN frames and receives 6, including the transmission's torque limit, which it follows by retarding spark. The frames have been seen on the bench bus. They have not been tried in a vehicle.

Direct injection hardware comes alive

26 commits in one day brought up most of what makes the E92 different.

  • Direct injection switched on: the pump valve driven peak-and-hold, the injector boost supply regulated, rail pressure read.
  • The driver chip came up, and with it the main relay, fuel pump, fan, A/C and check engine lamp.
  • Throttle bridge output and the SENT throttle position input.
  • Software knock on both banks.
  • Oxygen sensor heaters regulated the stock way, and the two-stage oil pump.
  • Settings saved in internal flash. Tooth logger and Lua on.

CPU headroom at 8000 rpm

Profiling on the bench raised idle CPU time at 8000 rpm from 5.1 % to 14.0 %, and live-data updates from 6.8 to 48.8 a second. The gains came from caching the torque model per operating point, reusing fuel-path lookups and a cheaper crank and cam edge path.

Two throttle fixes landed with it. The throttle position read invalid half the time because of a timeout shorter than the sensor update, and the motor now runs only when throttle and pedal are both valid at that moment.

Running from flash under the stock boot block

The kernel port for the MPC5674F passed its test suites from RAM, then the firmware ran from flash under the stock boot block on the third flash.

By flash 13 the same day, crank and cam were decoded by our own eTPU microcode, the analog inputs read correctly (13.23 V of battery on the bench), and spark and injector command outputs were being timed by the eTPU and verified under self-stimulation.

Throttle, relays, knock and a base tune

The day the ECU started driving real loads.

  • The electronic throttle runs on the ECU's own H-bridge.
  • The serial output drivers became pins: fuel pump, fans, check engine lamp, A/C relay, powertrain relay and power hold on key-off.
  • The tune burns to flash under the stock boot block.
  • Car mode: vehicle CAN traffic or a turning engine keeps the ECU up without a laptop attached.
  • A base tune came from a Pontiac G8 calibration: VE from the stock airflow model, the stock dwell and spark tables, and the stock air and spark torque model.
  • Stock knock control was ported, using the ECU's knock chip with a per-cylinder noise model.

The bench ECU was on flash 231 by the end of the day.

Tuning over CAN without starving the engine

The E38 has no USB, so the tuning link runs over CAN through the OBD connector. On a 40 MHz processor that link competes with the engine for time.

36 commits went into making both fit. The compressed live-data stream now runs over CAN. Received factory frames are decoded in the interrupt handler. The slave processor link moved to interrupts after it stopped for good at 8000 rpm. Injections are now handed to the timer unit whole, as the stock software does.

8000 rpm on the bench with spark, fuel and cam

With a crank and cam stimulator on the bench, the firmware ran to 8000 rpm with spark, fuel and cam sync. Getting there meant batching pin events, restarting the decoder from the crank position and letting the timer unit build spark pulses from crank angles.

The sensors were identified from the stock software and given the stock scalings. All 36 analog inputs became readable and every pin got a name in the tuning tool. The stock GM CAN frames were written the same day: 16 frames at their stock periods, behind a build switch.

From first compile to first start, in one day

The E38 port landed in 95 commits in a single day. It began with epicEFI compiling and linking for the MPC561, then had to be made to fit: the ECU has 160 KiB of RAM in total, and only 32 KiB of it is inside the processor.

  • The build was narrowed to one engine family: a GM V8 with the 58x crank and 4x cam. Trigger shapes for every other wheel, idle valves, the high-pressure pump and several other features were compiled out.
  • Real drivers replaced the stubs: scheduler timer, analog inputs, crank and cam capture, injector and coil pins switched by the timer unit, PWM, CAN and both watchdogs.
  • An independent review returned 24 findings. All were fixed or answered the same day, including outputs that could be left on by a refused request and firing before engine phase was known.
  • A second build variant was made for an ECU that keeps its stock GM boot block.

The day ended with the first start on the ECU itself.

Board skeleton and a byte-order audit

The E92's processor is big endian, and epicEFI had only ever run on little-endian ARM. Before any hardware work, every fixed wire format in the firmware was audited and given an explicit byte order. The board skeleton, bring-up plan and bench preparation notes were written alongside.