STM32 HAL_I2C_MemTxCpltCallback

Recently, I updated the STM32Cube_FW_F4 library of my drone project from V1.25.0 to V1.26.0, which solved some I2C's problems. However, the MPU-6050 initialization program failed since the library was updated. I found that the HAL_I2C_MemTxCpltCallback was not triggered after executing the DEVICE_RESET instruction of PWR_MGMT_1 using HAL_I2C_Mem_Read_DMA:

mpu6050
1
2
uint8_t i2c_data = 0x80;
HAL_I2C_Mem_Read_DMA(&hi2c1, 0xD0, 0x6B, &data, 1);

A HAL_I2C_ERROR_AT error will be raised and the oscilloscope shows that the there is no acknowledge from the MPU-6050:

IMG_0122_smal

HAL_I2C_MemTxCpltCallback runs normally when the instruction is changed to others like wake up the sensor:

1
2
uint8_t i2c_data = 0x00;
HAL_I2C_Mem_Read_DMA(&hi2c1, 0xD0, 0x6B, &data, 1);

It seems that it is the problem of MPU6050 though the STM32Cube_FW_F4V 1.25.0 never happened. It is a considerable problem when you using the new version of STM32Cube_FW_F4V.