2023-12-13 08:15 AM
Hello,
I need to implement an i2c passthrough between i2c ports i2c1 and i2c2 on my stm32g031k8 board. This MCU is connected to another CPU board using i2c2 port. Also, the i2c1 is connected to a temperature sensor, RTC, and EEPROM. After power UP, until the CPU is ready, the MCU is master on this bus and can read the EEPROM/RTC/Temp sensor, once CPU power is ready, the CPU is master, MCU becomes slave. The CPU can communicate with these sensors using passthrough over i2c1.Do you have any example code I can refer for this?
thanks
2023-12-13 08:19 AM
I suspect you'd need to play man-in-the-middle to avoid contention. ie you'll have to respond as if you were the temp sensor.
2023-12-13 08:57 AM
Can you develop a custom protocol between your STM32 and the other CPU? Else you have to respond to several I2C addresses (as a slave) to the other CPU's access to several I2C devices.