Are the ignition and battery power wires to the ECU connected exactly as stock?
If not, then the 'deleted' codes, which are only deleted in RAM, don't get written out of the non-volatile EEPROM where codes are more permanently stored. So when you power it back up and the codes are read back from the EEPROM they are still there.
Data (codes, adaptions etc) are written from RAM during the 'shutdown' phase after they key is turned off, which typically lasts about ten seconds.
|