NOTE: formatting of the text above is incorrect, check the original doc to not get confused with the numbers.21.4.7 Timeout Control
The I2C master controller has three types of timeout control, namely timeout control for SCL_FSM, for
SCL_MAIN_FSM, and for the SCL line. The first two are always enabled, while enabling the third is
configurable.
When SCL_FSM remains unchanged for more than 2I2C_SCL_ST_TO_I2C clock cycles, an I2C_SCL_ST_TO_INT
interrupt is triggered, and then SCL_FSM goes to idle state. The value of I2C_SCL_ST_TO_I2C should be less
than or equal to 22, which means SCL_FSM could remain unchanged for 222 I2C_SCLK clock cycles at most
before the interrupt is generated.
When SCL_MAIN_FSM remains unchanged for more than 2I2C_SCL_MAIN_ST_TO_I2C clock cycles, an
I2C_SCL_MAIN_ST_TO_INT interrupt is triggered, and then SCL_MAIN_FSM goes to idle state. The value of
I2C_SCL_MAIN_ST_TO_I2C should be less than or equal to 22, which means SCL_MAIN_FSM could remain
unchanged for 222 I2C_SCLK clock cycles at most before the interrupt is generated.
Timeout control for SCL is enabled by setting I2C_TIME_OUT_EN. When the level of SCL remains unchanged for
more than I2C_TIME_OUT_VALUE clock cycles, an I2C_TIME_OUT_INT interrupt is triggered, and then the I2C
bus goes to idle state.
I tried to set the values for I2C_SCL_MAIN_ST_TO_I2C and I2C_SCL_ST_TO_I2C to the maximum of 22 and did not get any improvement, except that the timeout might come later.
I also changed the timeout value to the maximum of 0x1F via i2c_set_timeout() and finally disabled the timeout at all. It is enabled by default in i2c_ll.h line #166 in my version of the IDE.
Both did not solve the problem, it just changed the timing of the event.
No ideas at the moment, except to step through the code to understand why smaller I2C payload work and larger not.