I2C in Interrupt Mode stays in HAL_I2C_STATE_BUSY_TX even if the data is correct transmitted
Hi all,
I do have a problem with the Interrupt Mode of the I2C interface. I started with the example provided by STM (I2C_TwoBoards_ComIT). I do not use two boards but one board as slave and the master is an FTDI FT4222. So sending from the FT4222 to the Nucleo Slave board does work and I print out the received string via UART. I even can send in a loop and everything is fine.
But transmission is not working. I do the following:
// Nucleo Board (Slave) tries to send
i2cStatus = HAL_I2C_Slave_Transmit_IT(I2cHandle, (uint8_t*)aTxBuffer, sizeof(aTxBuffer));
if(i2cStatus != HAL_OK) {
// Transfer error in transmission process
Error_Handler();
}
while (HAL_I2C_GetState(I2cHandle) != HAL_I2C_STATE_READY) {
}
uartStatus = HAL_UART_Transmit(UartHandle, "Transmit ready ...\n", 12, 0xFF);So first it all looks good, the FT4222 starts the read from the slave and even gets the correct string (atxBuffer). But then the state always stays on HAL_I2C_STATE_BUSY_TX and does not return to HAL_I2C_STATE_READY.
I do not know why because all bytes are received by the FT4222.
I hope someone can help!
Kind regards
Sebastian