cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0: I2C Passthrough Implementation between i2c1 and i2c2

smoha.2
Associate II

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

2 REPLIES 2

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III

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.