update error code and i2c status