Open iglesiasmarianod opened 2 years ago
Going back from
int update_checksum(t_eeprom_data* data)
{
char* p_data;
char checksum=0x00;
p_data = (char*)data;
for (size_t i=0; i<sizeof(*data); i++)
{
checksum += *p_data;
p_data++;
}
//printf("Checksum: %x\n", checksum);
data->checksum = checksum;
return (0);
}
to
int update_checksum(t_eeprom_data* data)
{
char* p_data;
int i;
char checksum=0x00;
p_data = (char*)data;
for (i=0; i<sizeof(data); i++)
{
checksum += *p_data;
p_data++;
}
//printf("Checksum: %x\n", checksum);
data->checksum = checksum;
return (0);
}
in update_checksum and verify_checksum fixes the issue.
I've built the latest image and found sensorcal is not working. It finds sensorboard as virgin and asks to initialize (even when the sensorboard is been calibrated before). I clicked on "yes" to initialize the board again, but keeps seeing the board as virgin. I ran sensorcal -c. The output is "EEPROM content not valid, run sensorcal -i" I ran sensorcal -i and seems to run OK. I suspect it has something to do with Checksum calculation or verification. Running sensorcal -d The output is "EEPROM content not valid, run sensorcal -i" twice From sensorcal:
from 24c16.cpp
It seems to be returning 2 and printing error message twice as eeprom_read() is not printing error messages.