Not able to read data from STM32G031 Mcu I2C slave
I have configured my stm32g031 mcu as an i2c slave. My PC terminal is my master device and is connected to mcu via FTDI cable. When I do a i2c write, I can see mcu receives the data. But when I do an i2c read, I can see it reads 255 on my pc terminal.
When I debug my code, I can see the control coming to ,
uint8_t id = 0xA0;
HAL_I2C_Slave_Seq_Transmit_IT(&hi2c1, &id, 1, I2C_LAST_FRAME);But the mcu does not sends data out.
Below is the python code I use to communicate with MCU,
# Instantiate an I2C controller
i2c = I2cController()
# Configure the first interface (IF/1) of the FTDI device as an I2C master
i2c.configure('ftdi://ftdi:2232h/1')
# Get a port to an I2C slave device
slave = i2c.get_port(0x30)
#Write data
slave.write(b'\xAA')
#Read data
slave.read(1)Any suggestions what could be wrong here?