AnsweredAssumed Answered

I2C wrong slave address with STM32F429

Question asked by lecordier.guy.001 on Feb 9, 2018
Latest reply on Feb 10, 2018 by john doe

STM32F4xx HAL drivers V1.7.3 / 22-December-2017

I get some data by HAL_I2C_Master_Receive_DMA() and HAL_I2C_Mem_Read_DMA()

I found that a wrong Slave address could be sent when using the HAL_I2C_Mem_Read_DMA() due to the I2C interruption enabled.

In HAL_I2C_Master_Receive_DMA(), the address is sent by the EV interruption (HAL_I2C_EV_IRQHandler()).

In HAL_I2C_Mem_Read_DMA(), the address should be sent sequentially after the START flag but as the I2C interruptions are enabled, the address is sent by the EV interruption after START is generated (I2C_RequestMemoryWrite()) so a wrong address is sent.

So HAL_I2C_Master_Receive_DMA() and HAL_I2C_Mem_Read_DMA() should be called with the I2C interruptions disabled.

To have a correct behavior I disable the I2C interruptions in the CpltCallback().

 

Regards

Outcomes