cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Cube v1.9.0 I2C Memory Interrupt Functions

bobdeschambault9
Associate II
Posted on December 11, 2015 at 22:46

Hi,

I am working with the I2C HAL code (v1.9.0) and I am playing around with the HAL_I2C_Master_Transmit_IT(), HAL_I2C_MasterTxCpltCallback, HAL_I2C_Master_Receive_IT(), HAL_I2C_MasterRxCpltCallback, HAL_I2C_Mem_Write_IT(), HAL_I2C_MemTxCpltCallback, etc ...

When I use the Master versions of the calls I see the callback functions get triggered, but I don't see the callbacks being triggered when I try to use the Memory versions of the calls.  

Would anyone have an idea of what I might have missed in the memory versions of the function calls?  Why does the Master version work, and not the memory version.  I think I am using the right callback functions for master and for memory.

Thanks in advance for your help.

Bob

#i2c #hal
1 REPLY 1
vasanthakumar
Associate
Posted on February 09, 2016 at 05:27

Hi,

    I too saw the same thing, not in CubeF4, but in CubeL0 v1.4.0. During a

HAL_I2C_Mem_Write_IT() call, I2C_MemTxCpltCallback() never gets executed after the completion of the transfer, instead  HAL_I2C_MasterTxCpltCallback() is the one called on both during I2C_Master calls or I2C_Mem calls. The mistake, i found, lies is in I2C_MasterTransmit_ISR() and I2C_MasterReceive_ISR() functions in the supplied stm32l0xx_hal_i2c.c file. This won't cause much problem in the behaviour of the project, but it deviates from the documentation. Hope it gets corrected in the future versions.