Originally Posted by
steveo
i think the error is in error assuming it fixed your vin and cal id without you doing it manually.
Looking at your code, it appears you have shifted from doing maths on factors that exist in the BIN already in order to determine vehicle fingerprint to attempting to write a unique Vehicle ID to the 4-byte region of EEPROM stored at 0x0FFC. In this branch of code, you use ONBOARD_EEPROM.BIN as the simple program to execute on T-SIDE. However, since ONBOARD_EEPROM.BIN does not exist, this attempt fails, triggering the message:
Could not set or retrieve vehicle ID. The compare functions are not going to work well.
Looking further, the actual routine that writes the EEPROM region for VIN and CAL ID doesn't use a simple program, it calls...
Code:
bool processor_ee::program_eeprom_block(int device_id, region r, QByteArray data) {
log("PROGRAMMING" + r.to_string(),LOGLEVEL_DEBUG);
datastream_request request(device_id,COMM_EXECUTE);
request.append16(0x0300); // ram location to store the block
request.append(0x7E); // JMP
request.append16(0x1CB4); // .. to the exec point of the write program.
request.append(r.size);
request.append16(r.offset);
data.resize(r.size);
request.append(data);
request.override_timeout = (r.size * 35) + 150; // could take a bit o' extra time if writing lots of stuff.
emit region_changed(device_id,r.offset,r.size,REGION_PROGRAMMING);
datastream_reply repl = interface->request(request);
if(repl.success == true) {
emit region_changed(device_id,r.offset,r.size,REGION_WRITTEN);
return true;
} else {
emit region_changed(device_id,r.offset,r.size,REGION_ERROR);
errmsg("Error programming EEPROM.");
return false;
}
}
Which works since it's not looking for ONBOARD_EEPROM.
Bookmarks