Hi everyone,
I am currently working on a motor control project using the i.MX RT1186.
In my application, I use the eFlexPWM to trigger ADC conversions. I want to use the eDMA to continuously transfer these ADC conversion results into a ring buffer in the memory.
My goal is to make the eDMA run endlessly: once the buffer is full, the eDMA pointer should automatically wrap around to the beginning of the buffer and continue overwriting the oldest data, completely without any CPU intervention.
Could anyone please advise on the standard way to configure the eDMA to achieve this continuous circular behavior on the RT1186?
Are there any specific SDK examples or fsl_edma API configurations you could recommend for this use case?
Any code snippets or guidance would be greatly appreciated.
Thank you!
Dear @guogai ,
Thank you for your question.
Currently, there is no official example combining ADC with eDMA available for the i.MX RT1180 series in the MCUXpresso SDK.
However, you may find the following resources helpful:
Based on your use case, I have the following suggestions:
Use ADC continuous/circular sampling functionality (recommended)
The ADC itself supports continuous conversion, and the result FIFO can store up to 16 samples. You can periodically read the FIFO and perform filtering in software.
This approach is relatively simple and easier to implement.
Implement DMA circular behavior manually (advanced option)
If you would like to achieve behavior similar to STM32 “DMA circular mode,” you will need to configure the registers manually based on the reference manual.