I'm seeing an occasional but consistently reproducible problem when reading from an I2C GPIO expander using a C6748 DSP
This happens only perhaps 1 in a hundred reads, and not in a particularly consistent fashion. I have a script which executes a number of I2C operations, but in short I'm writing a value to the IO expander, then reading it back to check the value.
Most of the time this is fine, but just occasionally the value read back is incorrect and is the previous value written/read back from the IO expander. If I read the value a second time i.e. just retry the read because its not the value I expected, then it is always correct.
Using a sniffer on the I2C bus has proved that the IO expander is sending the correct value, so it looks like the problem is in the C6748 I2C peripheral.
The driver is quite simple, just using polled mode as speed is not an issue, and I've been through the datasheet in detail to make sure it's being set up exactly as indicated, but this still seems to be happening. It's not a speed issue as the bus speed has been slowed right down, and I've tried adding delays in a number of places but without success, so it looks like a logic issue and the I2C peripheral is somehow "caching" the last value read.
I've searched the errata but I haven't found any reference to anything similar.
Unfortunately I cannot post the driver code as it belongs to a customer.
Has anyone seen anything similar, and have any suggestions?