I am looking at using ADC_ETC and DMA together on iMXRT1062. I see the SDK sample project (adc_etc_edma) which does transfer the ADC results using DMA successfully.
But, I also see that there is a call to EDMA_StartTransfer(&edmaHandle) after the EDMA callback sets a flag. According to the i.MX RT1060 Reference Manual Rev. 2 (page 3375), this should not be necessary, as the ADC_ETC completion should trigger a new DMA transfer directly. The ADC_ETC trigger chain is being triggered by the PIT, so this should allow the ADC_ETC->DMA transfer to run completely through DMA repeatedly.
I tried removing the StartTransfer call from the example, but the ADC_ETC does not seem to trigger a new DMA transfer. Is there some other setting that is required for the ADC_ETC to initiate a new DMA transfer?
thanks
Hi @jackking ,
Thanks for your patience.
I got the answer from the SDK expert in charge of the ADC module:
TCD0_CSR[DREQ] is set to 1 in the EDMA driver. The request is disabled after each major loop ends, so it needs to be re-enabled.
Wish it helps you.
If you still have question about it, please kindly let me know.
BR
MayLiu
Hi @jackking ,
Thank you so much for your interest in our products and for using our community.
I checked the i.MX RT1060 Reference Manual Rev. 3 page3451, it seems different from the version 2.
https://www.nxp.com/webapp/Download?colCode=IMXRT1060RM
I can not see all your code in the post. But I think you can check that whether the register DMA_CTRL[TIRGa_ENABLE]set to 1 when complete the the last trigger in chain in your project.
Wish it helps you.
If you still have question about it, please kindly let me know.
BR
MayLiu
I think you are looking at an old SDK version…
This version of the SDK does have an example for adc_etc_edma. The sample does enable DMA triggering for the ADC_ETC, using ADC_ETC_EnableDMA()
Hi @jackking ,
Thanks for your updated information.
Yes, I can import adc_etc_edma demo after update my SDK version 24.12.00.
Regarding your issue, I have consulted SDK expert in charge of the ADC module, he will explain that, Please keep patience.
Best Regards
MayLiu
And the Reference Manual entry which suggests this should not be necessary:
This is the line in the SDK example I am referring to: