AnsweredAssumed Answered

STM32F4 HAL_I2C_Master_Receive_DMA sends extra bytes at the end

Question asked by Fahrni.Christoph on Mar 8, 2017
Latest reply on Oct 18, 2017 by Alexandre T

I am working with the STM32F427 and HAL V1.6.0 and use the function HAL_I2C_Master_Receive_DMA.

Sometimes (~20 times a day) I have troubles because after the callback HAL_I2C_MasterRxCpltCallback another byte is transferred then I2C_FLAG_RXNE is ist. At the next call of HAL_I2C_Master_Receive_DMA I receive wrong data because DR was not empty before.

The wrong transmission with the value 0xFF is shown in the Attachement.


I was happy to read the Release Notes for STM32F4xx HAL Drivers V1.7.0 because this problem seemed to be solved:

  • HAL V1.7.0 notes: Update HAL_I2C_Master_Transmit() and HAL_I2C_Slave_Transmit() to avoid sending extra bytes at the end of the transmit processes


Unfortunately I have the same issue also with V1.7.0 (The Attachement I made was taken with V1.7).


I would be happy to have a solution for the all DMA-functions if the are affected. I use

  • HAL_I2C_Master_Transmit_DMA
  • HAL_I2C_Master_Receive_DMA
  • HAL_I2C_Mem_Write_DMA
  • HAL_I2C_Mem_Read_DMA


Best Regards,

  Christoph Fahrni