2018-02-09 05:52 AM
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
2018-02-09 07:27 PM
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?