2. Can you explain a little bit about the mechanics of how a flash update process works through the SCI interface?
Sure. The process works like this:
1. The SCI tool sends a command that causes the ECU to return a 'seed'. This 'seed' is encrypted using a key and algorithm.
2. The result of the seed encryption is sent back to the ECU with another command. The ECU returns success or failure.
3. The next SCI command issued is the command to enter programming mode. The ECU will return an OK status, then switch the SCI baud rate to 62. 5KBPS. It is at this point that the 'Wait to Start' light will begin blinking.
4. Next is the Erase Flash command. This command is sent, followed by a Get Status command. The Get Status command will be reissued until the ECU indicates that the flash has completed the erase process.
At this point, the ECU is erased, except for the bootstrap code. We can begin programming the flash memory, then the EEPROM. Programming is done in blocks. There are three blocks of flash that must be programmed, and one block of EEPROM data.
Each block is programmed using the following process:
1. A Start Block command is sent. This command will contain the starting address of the block to program, and the length.
2. Records are then transferred. I am using 64-byte records, but it may be possible to transfer larger records. As the records are being sent, a checksum word is generated, in the ECU, and in the SCI utility.
3. When all records of the block are transferred, a Checksum command is sent. This command is sent with the checksum word we were generating while we were uploading the records. It must match the checksum word the ECU has. If it does not, there was an error during the data transfer.
After all three flash blocks, and the EEPROM block, have been transferred and checked, a command is sent that causes the ECU to verify and finalize the update process. Immediately after this command is sent, a Get Status command must be sent. If this does not happen correctly, the process will fail.
At this point, the ECU will 'reset' itself. The 'Wait to Start' light (and the grid heaters) will come on for the full duration, as if the engine was cold. Once the WTS light goes out, the process has completed. I usually turn the truck off for a while, then fire it up.