Question
use both I2C Master DMA and UART DMA at once
Hi all,
I am trying to use I2C DMA as Master and UART DMA
My code is
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim){
if (c == 1) {
HAL_UART_Transmit_DMA(&huart2, (uint8_t *)b, 8);
} else {
/* I2C Transmit code */
}
c = 1 - c;
}and which I tried are (instead of /* I2C Transmit code */) :
// 1. polling, it worked
HAL_I2C_Master_Transmit(~~, 50);
HAL_I2C_Master_Receive(~~, 50);
// 2. DMA, not worked
HAL_I2C_Master_Transmit_DMA(~~);
HAL_I2C_Master_Receive_DMA(~~);
// 3. Mem read dma, not worked
HAL_I2C_Mem_Read_DMA(~~);
// 4. Seq DMA, not worked
HAL_I2C_Master_Seq_Transmit_DMA(~~, I2C_FIRST_FRAME);
HAL_I2C_Master_Seq_Receive_DMA(~~, I2C_LAST_FRAME);I have no Idea whats wrong and how to solve it
thanks