Skip to main content
Visitor II
March 15, 2021
Question

HAL_I2C_MemTxCpltCallback is not executed(STM32Cube_FW_F4_V1.26.0)

  • March 15, 2021
  • 2 replies
  • 2432 views

"HAL_I2C_MemTxCpltCallback" is not executed when using 'HAL_I2C_Mem_Read_DMA' in STM32F407VE MCU of STM32Cube_FW_F4_V1.26.0 while is executed normally in the old version STM32Cube_FW_F4_V1.25.0. It seems that it runs "I2C_MemoryTransmit_TXE_BTF" onces and never goes to "HAL_I2C_MemTxCpltCallback".

Meanwhile, 'HAL_I2C_MemRxCpltCallback' is called normally in STM32Cube_FW_F4_V1.26.0.

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    March 16, 2021

    Hello @HLuo.1​ and welcome to the STM32 Community :)

    Thanks for pointing out this issue.

    I am checking it internally and I will come back to you with update.

    Imen

    Technical Moderator
    March 16, 2021

    Hi @HLuo.1​,

    I don't see the issue you described when I check the difference between the STM32CubeF4 packages V1.26.0 and V1.25.0.

    Maybe you have an issue when using the BTF() APIs compared to the old releases.

    I suggest, as a first step, to run the I2C example available in STM32CubeF4 MCU package and compare your own project/code and configuration to identify what is going wrong: \STM32Cube_FW_F4_V1.26.0\Projects\STM32F4-Discovery\Examples\I2C

    Please keep me updated on your update.

    Imen

    HLuo.1Author
    Visitor II
    March 18, 2021

    I finally found that it is the problem fo the slave device MPU6050, which responses no acknowledge to the master for the DEVICE_RESET instruction though STM32Cube_FW_F4V 1.25.0 works fine.

    http://luohanjie.com/2021-03-18/stm32-hal-i2c-memtxcpltcallback-problem.html

    Technical Moderator
    March 18, 2021

    Thank you @HLuo.1​ for posting your findings of this issue.

    After an internal check to see the impact between the two versions of STM32CubeF4 v1.25.0 and v1.26.0:

    There is no issue reproduced when running the test on a STM32F407-DISCO board with an external EEPROM @100Khz on I2C1/PB6/PB7 connection, and no strange behavior detected by the tests using the two MCU packages.

    The "HAL_I2C_MemTxCpltCallback" callback is well executed from "I2C_MemoryTransmit_TXE_BTF" when HAL_I2C_EV_IRQHANDLER is called.

    Can you please help us to reproduce the behavior you encountered, by giving us more details such as:

    • which speed is used?
    • share a schematic of the HW implementation ?

    Imen