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