Hans Dorn wrote:why expressif didn't just switch everything over to the working ones...
Yes I wonder about that too. Is there any penalty to use the alt address?
There is a performance penalty. The peripheral address registers from 0x3FF40000 are mirrored at the 0x600000 address, but this second address is via a slower bus where the CPU can't issue the writes via its write buffer.
ECO 3.3 was due to a bug where sometimes subsequent writes to the same address were lost (the bug happens as part of the same write buffer behaviour that is a performance boost for all other peripheral writes). Adding a peripheral bus read before the second write, or writes to different peripheral addresses interleaved, means the bug does not trigger. Which is why the ECO document only mentions moving the addresses used for FIFO registers (where data is often copied word-at-a-time to the same address.) It seems like an oversight that the I2C data FIFO register is not mentioned in the ECO document.
In Arduino, I had a quick look but I don't yet see where the FIFO data loss would have been happening except in 10bit mode. Writing "fifo_data.data" twice in succession here may cause the second write to be lost in 10 bit mode:https://github.com/espressif/arduino-es ... i2c.c#L171
However the loop which writes "normal" i2c data writes to the 'val' 8 bit bitfield rather than writing the full register, which should be a register read-modify-write cycle each time (having the read there should mean that the bug doesn't trigger):https://github.com/espressif/arduino-es ... i2c.c#L181
It seems from the reports here that there is some data loss somewhere though, possibly to do with timing between some of the read/writes when interrupts are enabled. Or maybe some other software behaviour that changing to the slower peripheral bus mitigates.
Not sure what the state of esp-idf is though.
In IDF, the i2c driver already uses the "slow" address at 0x6000xxxx when writing to the FIFO register:https://github.com/espressif/esp-idf/bl ... i2c.c#L380
(The I2C_DATA_APB_REG macro returns the correct register address.)
Overall, I'm a little confused now reading such a long thread that seems to be be discussing multiple quasi-related issues. Marty, are you still having I2C integrity problems if you use the latest Arduino master branch? Is it possible to differentiate between these problems (ideally in separate threads)?