Skip to main content
Visitor II
December 13, 2023
Question

STM32G0: I2C Passthrough Implementation between i2c1 and i2c2

  • December 13, 2023
  • 2 replies
  • 1308 views

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

    This topic has been closed for replies.

    2 replies

    Graduate II
    December 13, 2023

    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.

    Super User
    December 13, 2023

    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.