HAL_I2C_SlaveTxCpltCallback() is called despite not all bytes are sent?
Hi,
I´m using an stm32f401 and observing suspicious behaviour on the I2C slave.
My issue is that I get transmit completed callback after master has read 1 byte, but I have called HAL_I2C_Slave_Seq_Transmit_IT to send 2 bytes.
I´m trying to send 2 bytes by calling:
HAL_I2C_Slave_Seq_Transmit_IT(&i2cHandle, data, 2, I2C_FIRST_FRAME);Then I receive
HAL_I2C_SlaveTxCpltCallback(&i2cHandle);Just after the host(I2C master) has read 1 byte.
I have checked that I2C_SlaveTransmit_TXE is called as 2 times for unknown reason.
I´m using raspberrypi as the I2C master and can reproduce the issue by calling (in the terminal)
i2ctransfer -y 1 r1@0xAddrIf I instead call the slave transmit api with data size as 3 bytes:
HAL_I2C_Slave_Seq_Transmit_IT(&i2cHandle, data, 3, I2C_FIRST_FRAME);I will receive the callback after 2 bytes are read by the host.
Is this a known issue, or expected behaviour?
