Hello all, I’ve been using the i2c interface on the hifive1_revb with the zephyr OS (recently synced from master zephyr-v2.2.0-844-g6c2451c5c0a6).
Configuring as I2C_SPEED_FAST - the default in i2c_sifive_init:
i2c_map_dt_bitrate(config->f_bus) returns 2 which is the I2C_SPEED_FAST constant
My understanding of the zephyr os mappings are:
I2C_SPEED_STANDARD = 100kHz
I2C_SPEED_FAST = 400kHz
Further, I understand 400kHz is the max for the hifive1_revb. (SiFive please correct if I’m mistaken).
When I capture the SCL (at the default of FAST) I observe ~100kHz.
I have not yet root caused the issue (hoping to get some guidance here), but I have experimented with
i2c_sifive_configure, in particular the line:
from: prescale = (config->f_sys / (i2c_speed * 5U)) - 1;
to: prescale = (config->f_sys / (i2c_speed * 17U)) - 1;
I verified with the oscilloscope that the clock is ~400kHz with the change.