Recently, I am debugging the i2c bus on Rock-5a platform and I encounted some werid issue about the i2c bus.
I find the communication of the i2c is not stable, even I reduce the clock speed to 10000. Whe I try to write and read the es8316 or wm8960 chip and both of them will return write or read error. I think it is not accessible and I think it i2c controller is abnormal.
@Stephen can you help to check this issue ?
@GinKage and I also had a similar issue when connecting up a WM8960 audio HAT (specifically, the Waveshare HAT) to our CM5 IO board. I2C worked, but was unstable occasionally until the I2C connection was put on riser headers. I didn’t look at it under a scope though yet to see if there was any issue with the clock signals.
could this issue be related to insufficient pull-up resistor on SDA as observed by this post?
@Bin may i ask how you managed to reduce the clock speed?
to change clock speed to e.g. 10000:
sudo fdtput --type u rk3588s-rock-5a.dtb i2c8 clock-frequency 10000
Missing resistor is not the only issue: other I2C buses (the ones that do have all resistors in place) suffer from similar problems with wm8960. The connection has to be short and firm (i.e. it has to be a HAT, not a flex cable or some wires), otherwise it keeps being unstable.
i managed to connect a bunch (5x) of SAMD21 mcu’s to the rock 5A via i2c. i achieved 1mbit/s (fast-mode plus) with a cable length of roughly 10-15cm for all 5 slaves without any read or write errors. didn’t do anything particular except for selecting pull-up resistors so that the signals would look reasonable on a scope. 2.2kOhm on the rock 5A + an additional 330Ohm in parallel was needed to get the following singal in my case: