AnsweredAssumed Answered

I2C DMA issues with latest HAL

Question asked by teal.andy on Dec 15, 2016
Latest reply on Dec 15, 2016 by teal.andy

I'm trying to get I2C to work in DMA mode from STM32Cube_FW_F7_V1.5.1

 

My first error was that the I2C handle remains busy after the first DMA transfer is complete.

I've looked at the procedure  I2C_DMAMasterTransmitCplt in stm32f7xx_hal_i2c.c which gets called by DMA1_Stream0_IRQHandler()

It appears as though this code is vastly changed from v1.3.0 HAL and I can't immediately see how the DMA complete handler will reset the I2CHandle.State to be HAL_I2C_STATE_READY

 

As a test I've also tried Transmitting 4000 bytes through the I2C with:

HAL_I2C_Master_Transmit_DMA(&I2C1Handle, I2C_ADDRESS, OutBuf, 4000);

I've found that the DMA1_Stream0_IRQHandler() is called after 255 bytes are transmitted

I then call HAL_DMA_IRQHandler(I2C1Handle.hdmatx);

From then on, the I2C remains busy but no further bytes are transmitted.

 

Am I missing some more code within the DMA1_Stream0_IRQHandler procedure ?

A working example of I2C DMA tx and rx using the latest HAL would be great

 

Regards

Outcomes