2015-12-11 01:46 PM
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 #hal2016-02-08 08:27 PM
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.