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
:
1 | uint8_t i2c_data = 0x80; |
A HAL_I2C_ERROR_AT
error will be raised and the
oscilloscope shows that the there is no acknowledge from the
MPU-6050:
HAL_I2C_MemTxCpltCallback
runs normally when the
instruction is changed to others like wake up the sensor:
1 | uint8_t i2c_data = 0x00; |
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.