epicEFI OEM

Overview / GM E38

GM E38

Engine running

The first factory ECU to run an engine on epicEFI. Built for one engine family: a GM V8 with eight injectors, eight coils, electronic throttle, the 58x crank wheel and the 4x cam wheel.

E38

  • Freescale MPC561
  • 40 MHz PowerPC, big endian
  • 2 MiB flash · 160 KiB RAM

GMT900 trucks and SUVs, Gen IV V8

  1. Not started
  2. Compiles
  3. Runs on the bench
  4. Engine running
  5. Driving
First build
25 Nov 2026
Bench flashes in the first six days
249
Top stimulated speed
8000 rpm
Analog inputs readable
36

Journey

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.

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.

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.

Features against regular epicEFI

  • Proven on a running engine
  • Working on the bench
  • In the firmware, not proven
  • Partly available
  • Not available on this ECU
FeatureRegular epicEFIGM E38
Engine control
Crank and cam decodingOver a hundred trigger wheelsProven on a running engineGM 58x crank and 4x cam only. Every other wheel is compiled out
Sequential port injectionYesProven on a running engineEight injectors, each pulse timed by the TPU
Direct injectionYesNot available on this ECUPort-injected engine, pump control compiled out
Individual coil ignitionYesProven on a running engineEight coils, spark built from crank angles
Wasted spark, multispark, trailing sparkYesNot available on this ECURefused. Nothing fires until the cam gives engine phase
Electronic throttleYesProven on a running engineOn the ECU's own H-bridge. Motor runs only with a valid throttle and pedal reading
Idle valve, stepper or solenoidYesNot available on this ECUIdle is on the electronic throttle
Speed-density fuellingYesProven on a running engineOne air-mass model, VE from the stock airflow model
MAF fuellingYesNot available on this ECUCompiled out to fit memory
Knock controlSoftware knockWorking on the benchThe ECU's own knock chip with a per-cylinder noise model and retard
Cam phasingYesIn the firmware, not provenPhaser output from the stock calibration
Flex fuelYesWorking on the benchSensor input on a timer channel, torque model blends by ethanol
Oxygen sensors and heatersWideband and narrowbandIn the firmware, not provenFour narrowband inputs, heaters from the stock calibration. Wideband over CAN is decoded
Tuning and data
Tuning connectionUSB, serial and CANProven on a running engineCAN only, through the OBD connector. The ECU has no USB
Compressed live data streamYesWorking on the benchOver CAN, 48.8 updates a second at 8000 rpm
Tune saved to flashYesWorking on the benchBurned under the stock boot block
Tooth loggerYesNot available on this ECUCompiled out to fit memory
Lua scriptingYesNot available on this ECUCompiled out to fit memory
SD card loggingYesNot available on this ECUNo card hardware
Table blends, user tables, logic outputsYesNot available on this ECUCompiled out to fit memory
Verbose CAN, AIM and MS dash broadcastsYesNot available on this ECUByte order differs on this processor, switched off
Second CAN busYesNot available on this ECUBoth controllers sit on one bus
Factory integrationWhat an OEM controller adds that an aftermarket board does not have.
Runs under the stock boot blockNot applicableProven on a running engineNo hardware changes. A bad flash is recovered over CAN
Stock GM CAN framesNot applicableIn the firmware, not proven16 frames at stock periods, host tested, off by default
Transmission torque limit by spark retardGeneric CAN transmission linkIn the firmware, not provenHost tested, not yet on a shift
GM torque modelFuel energy modelWorking on the benchAir and spark torque model with all tables in the tune
Factory relays and lampsBoard dependentWorking on the benchFuel pump, fans, A/C, starter, check engine lamp, power hold
Cylinder deactivationNoNot available on this ECUSolenoids left undriven, all eight cylinders fire
Two-stage oil pumpNoDoes not applyNot on this engine

Hardware

A 2006-era design: a 40 MHz PowerPC and 160 KiB of RAM in total. The firmware was trimmed until it fit, then profiled until it kept up at 8000 rpm.

Processor
Freescale MPC561, MPC5xx core, 32-bit PowerPC, big endian, hardware floating point, 40 MHz
Flash
2 MiB external
RAM
32 KiB internal plus 128 KiB external on a 16-bit bus
Timers
TPU A and TPU B, 16 channels each, for crank, cam, injectors and spark
PWM
MIOS14 submodules: throttle bridge, fan, purge, cam phaser
Analog
Two QADC64E converters, 36 inputs readable, one behind an external multiplexer
CAN
TouCAN A. The second controller sits on the same bus and stays off
Serial devices
Queued SPI to custom driver ICs: two output drivers, injector driver, knock interface, supply and watchdog IC
Safety processor
A slave CPU on a serial link that gates the throttle bridge
Connectors
X1 and X2

How this ECU differs

  • Eight coils share two timer channels through a demultiplexer, so spark is built by the TPU from crank angles and coils must fire in ascending order.
  • Injections are handed to the TPU whole when they are scheduled, the way the stock software does it.
  • Coolant temperature uses a switched pull-up, so the firmware changes bias with temperature like the stock ECU.
  • The ECU keeps its stock GM boot block. Only the operating system area is replaced, and a bad flash is recovered over CAN.

I/O map

Sensor assignments come from the stock software. Connector pins come from the owner's truck pinout and public pin tables. A pin marked Inferred or Unknown has not been proven with a signal.

8
Unassigned by the stock software
5
Wired in the ECU, not fitted on this vehicle
9
Belong to a system you could delete

Reuse candidates are read from the map. None has been proven as a repurposed input or output yet.

PinFunctionTypeProcessorFirmwareEvidenceReuse
X1-47Ignition voltage, powertrain relayAnalog input A AN48EFI_ADC_0 Stock code
X2-65Throttle position 1Analog input A AN49EFI_ADC_1 Stock code
X1-29Pedal position 1Analog input A AN50EFI_ADC_2 Stock code
X1-32Pedal position 2Analog input A AN51EFI_ADC_3 Stock code
not listedPressure sensor BAnalog input A AN52EFI_ADC_4 Unknown
not listedNot identifiedAnalog input A AN53EFI_ADC_5 UnknownUnassigned
X2-63Throttle position 2Analog input A AN54EFI_ADC_6 Stock code
X1-24Fuel tank pressureAnalog input A AN55EFI_ADC_7 InferredOptional system
X2-58MAPAnalog input A AN56EFI_ADC_8 Stock code
X1-12A/C pressureAnalog input A AN57EFI_ADC_9 Stock codeOptional system
not listedPressure sensor AAnalog input A AN58EFI_ADC_10 Unknown
X2-50Oil pressureAnalog input A AN59EFI_ADC_11 Stock code
not listedFixed 2.55 V on the bench, not a sensorAnalog input A AN0EFI_ADC_12 Stock code
not listedPark/neutral or clutch switch, levelAnalog input A AN1EFI_ADC_13 Inferred
not listedPark/neutral or clutch switch, level, active lowAnalog input A AN2EFI_ADC_14 Inferred
X1-8Reverse switch, levelAnalog input A AN3EFI_ADC_15 Stock code
X2-57Oxygen sensor B1S1 (bank 1 upstream)Analog input B mux 0EFI_ADC_16 Stock code
not listedOxygen sensor B2S1 (bank 2 upstream)Analog input B mux 1EFI_ADC_17 Stock code
not listedOxygen sensor B1S2 (bank 1 downstream)Analog input B mux 2EFI_ADC_18 Stock code
not listedOxygen sensor B2S2 (bank 2 downstream)Analog input B mux 3EFI_ADC_19 Stock code
not listedBoard variant strapAnalog input B mux 4EFI_ADC_20 Stock code
not listedBoard variant strapAnalog input B mux 5EFI_ADC_21 Stock code
not listedTemperature input, which one not knownAnalog input B mux 6EFI_ADC_22 Unknown
not listedNot identifiedAnalog input B mux 7EFI_ADC_23 UnknownUnassigned
X1-16Fuel level primaryAnalog input B AN8EFI_ADC_24 Stock codeOptional system
X1-70Fuel level secondaryAnalog input B AN16EFI_ADC_25 Stock codeOptional system
X2-23Transmission fluid temperature, switched pull-upAnalog input B AN24EFI_ADC_26 Stock code
not listedFixed 2.56 V on the bench, not a sensorAnalog input B AN48EFI_ADC_27 Stock code
not listedNot identifiedAnalog input B AN49EFI_ADC_28 UnknownUnassigned
not listedNot identifiedAnalog input B AN50EFI_ADC_29 UnknownUnassigned
not listedPressure against barometer, brake boosterAnalog input B AN51EFI_ADC_30 Inferred
X2-21Coolant temperatureAnalog input B AN55EFI_ADC_31 Stock code
X1-26Clutch pedal positionAnalog input B AN56EFI_ADC_32 Stock code
not listedSecond air temperature inputAnalog input B AN57EFI_ADC_33 Unknown
X1-37Intake air temperatureAnalog input B AN58EFI_ADC_34 Stock code
X1-9Brake switch, levelAnalog input B AN59EFI_ADC_35 Stock code
X2-68Crank sensorTimed input TPU A 1A1 Stock code
X2-64Cam sensorTimed input TPU A 8A8 Stock code
not listedSecond cam inputTimed input TPU A 7A7 Stock codeNot fitted here
X1-40Flex fuel sensorTimed input TPU B 6B6 Stock code
X2-20Injector 1Output TPU B 8B8 Stock code
X2-17Injector 8Output TPU B 9B9 Stock code
X2-40Injector 7Output TPU B 10B10 Stock code
X2-37Injector 2Output TPU B 11B11 Stock code
X2-19Injector 6Output TPU B 12B12 Stock code
X2-18Injector 5Output TPU B 13B13 Stock code
X2-39Injector 4Output TPU B 14B14 Stock code
X2-38Injector 3Output TPU B 15B15 Stock code
X2-70Coil 1Output spark output 0E0 Stock code
X2-71Coil 8Output spark output 1E1 Stock code
X2-72Coil 7Output spark output 2E2 Stock code
X2-73Coil 2Output spark output 3E3 Stock code
X2-74Coil 6Output spark output 4E4 Stock code
X2-75Coil 5Output spark output 5E5 Stock code
X2-76Coil 4Output spark output 6E6 Stock code
X2-77Coil 3Output spark output 7E7 Stock code
X2-5 / X2-6Throttle motor bridge PWMOutput MPWMSM16D0 Stock code
not listedThrottle motor bridge direction AOutput MDASM13C13 Stock code
not listedThrottle motor bridge direction BOutput MDASM14C14 Stock code
not listedEGR valve or second cam phaser in other calibrationsOutput MPWMSM2C2 Stock codeNot fitted here
X2-16Cam phaser solenoidOutput MPWMSM3C3 Inferred
not listedPWM output, use not knownOutput MPWMSM17D1 UnknownUnassigned
X1-17Fan relay 1Output MPWMSM20D4 Stock code
X2-8EVAP purge solenoidOutput MPWMSM21D5 Stock codeOptional system
X1-52Starter enable relayOutput TPU A 14A14 Stock code
X1-51Fuel pump 2 relayOutput TPU B 5B5 Stock code
X1-50Fuel pump relayOutput TPU A 12A12 Stock code
X1-48Tachometer outputOutput TPU A 3A3 Inferred
X2-61Charge indicator lampOutput TPU B 1B1 InferredOptional system
X1-57Vehicle speed outputOutput TPU B 4B4 Inferred
X1-66Skip shift solenoidOutput code 5 ch2J2 Stock codeOptional system
X1-67Starter relay low sideOutput code 5 ch3J3 Stock code
X1-61EVAP vent solenoidOutput code 5 ch4J4 Stock codeOptional system
not listedIntake manifold tuning valveOutput code 5 ch5J5 Stock codeNot fitted here
not listedSecondary air pump relayOutput code 5 ch8J8 Stock codeNot fitted here
X1-63A/C clutch relayOutput code 5 ch10J10 Stock codeOptional system
X1-68MILOutput code 5 ch11J11 Stock code
not listedUnassigned driver outputOutput code 6 ch2K2 UnknownUnassigned
X1-58Fan relay 2Output code 6 ch4K4 Stock code
not listedUnassigned driver outputOutput code 6 ch5K5 UnknownUnassigned
not listedSecondary air valveOutput code 6 ch7K7 Stock codeNot fitted here
not listedUnassigned driver outputOutput code 6 ch10K10 UnknownUnassigned

What comes next

  1. Stock GM CAN frames on a vehicle bus, with the transmission and brake controllers listening
  2. Torque limit from the transmission followed on a real shift
  3. Knock control checked on a loaded engine
  4. A GMT900 to live in, so the truck outputs can be proven pin by pin