2024-04-16 02:42 PM
I am having issues with BDMA on consecutive transfers, the DMA handle is always in the busy state on the second call.
I call this from my application and first transfer works as expected, goes into ISR
HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,
uint16_t MemAddSize, uint8_t *pData, uint16_t Size)
This call returns error on second transfer because hi2c->hdmatx->State is
dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)pData, (uint32_t)&hi2c->Instance->TXDR,
hi2c->XferSize);
I call HAL_I2C_Mem_Write_DMA on every transfer and wait for the previous transfer to finish before calling again but still remains busy. Wondering if this is incorrect implementation.
Thanks