Using STM32H743 I2C, with CR2 RELOAD and NBYTES=0 gives TC interrupt instead of TCR.
I have to port an existing I2C API to the STM32H743 using the LL drivers. One of the functions must perform the START, issue the address of the slave, then return control. Then another function will send the data.
The fact is that when I initialize the transmission with the slave, I don't yet know the number of bytes to transmit. So the question concerns the transmission of 0 data after the address of the slave.
I use the following code:
// Set CR2 register
LL_I2C_HandleTransfer (pI2c,
slaveAddress,
LL_I2C_ADDRSLAVE_7BIT,
0, // NBYTES
LL_I2C_MODE_RELOAD,
LL_I2C_GENERATE_START_WRITE) ;Using LL_I2C_MODE_RELOAD I expect a TCR interrupt. But I get a TC interrupt, which prevents me from transmitting data.
Is this normal?
Is there a way to get a TCR interrupt under these conditions?
Then I tried to set NBYTES to 1, but it seems that it is not possible to change it later to the real count of data (in the first TXIS interrupt).
Best regards.
