cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 HAL_I2C_Master_Receive_DMA sends extra bytes at the end

Chr. Fahrni
Associate II
Posted on March 08, 2017 at 15:45

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

#hal-v1.7.0 #hal_i2c_master_receive_dma #extra-bytes #i2c #stm32f4
1 REPLY 1
Alexandre T
Associate II
Posted on October 18, 2017 at 18:33

Can you share your code ?