I am using STM32C031C6 for I2C verification.
I tried to communicate 2050 bytes of data using the HAL driver.
However, it did not receive the correct data.
To be precise, the data at 512,1024,1344,1346,1538,18561 and 1858 bytes were different.
The settings are as follows.
hi2c1.Instance = I2C1;
hi2c1.Init.Timing = 0x0090194B;
hi2c1.Init.OwnAddress1 = 0x10;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c1.Init.OwnAddress2 = 0;
hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
Executed with the following description.
"HAL_I2C_Master_Receive(&hi2c1, dev_addr, i2c_read, 2050, 1000);"
Please let me know how I can receive 2050 bytes of data correctly.
Solved! Go to Solution.