Skip to main content
Lecordier.Guy
Associate III
February 9, 2018
Question

I2C wrong slave address with STM32F429

  • February 9, 2018
  • 1 reply
  • 674 views
Posted on February 09, 2018 at 14:52

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

    This topic has been closed for replies.

    1 reply

    john doe
    Senior III
    February 10, 2018
    Posted on February 10, 2018 at 04:27

    is this why i have to push the reset button twice on my f446 nucleo to kickstart the i2c?  i've tried several other 'fixes' but none work. same code, same slaves work fine on f7 and L4. got example code?