I2C in STM32F103 longer data
You are trying to write to an input data register. That makes not sense and the chip may consider this as invalid write operation. Try writing to the registers that have defined write operations.