I2C DMA not triggering callback function
- 5 replies
- 5137 views
Hi,
Could you please suggest a direction with my problem?
I try to read and write data to a sensor via i2c with DMA1 in an STM32 Nucleo F401 board where a FreeRTOS is running.
I can read the sensorata with polling methode, and next to the I2C an UART is running with the DMA2 correctly. I have checked and the MX_DMA_Init is running before the MX_I2C1_Init.
When I try to write to the sensor as a master with DMA(HAL_I2C_Master_Transmit_DMA) with the "i2c1 event interrupt" and "i2c1 error interrupt" disabled in the FreeRTOS the parattet tasks are just running fine just the callback HAL_I2C_MasterTxCpltCallback is not triggered.
And when i am enabling the" i2c1 event interrupt" and "i2c1 error interrupt" from the CubeMX two parallel task in the Free rtos are running at once and then no more parallel schedulling is happening and the HAL_I2C_EV_IRQHandler function is called periodically and leaving the function in the last else branch where the /* Do nothing */ is commented.
Could you please suggest what could i try to use the i2c with DMA?
Thank you,


