I want to set up the ADC working with DMA through tresos.
Questions:
Hello @alexeiguriev ,
Please check whether you have configured the DMA source and DMA Transfer completion User notification callback as follow:
- DMA source: ADC0_COCO, DMA Transfer completion User notification: Adc_Adc12bsarv2_DmaTransferComplete0
and/or:
- DMA source: ADC1_COCO, DMA Transfer completion User notification: Adc_Adc12bsarv2_DmaTransferComplete1
Regards,
Nam
Hello @namnguyenviet,
Can you please answer the question about configuration without "DMA transfer complete" interruption?
Hello @alexeiguriev ,
If you choose the method for AdcHWUnit as ADC_DMA, but without "DMA transfer complete" interruption, then you are not able to convert the ADC group in continuous mode, as the notification for group conversion completed, or even a group with a single channel can't be completed, as the SW will change the status of ADC group conversion in "DMA transfer complete" callback function.
I'm glad to hear that you can temporarily fix the issue, as your way to clear the DMA-> INT flag. However, I don't think this is a bug from MCAL driver, cause the INT clear flag is already done in MCL in Mcl_DmaProcessInterrupt() via this call: DMA_CLEAR_INT_REQ().
Please share me the ADC and MCL configurations, also how you called the ADC conversion sequence i in your application. We will see whether something was setting up incorrectly.
Regards,
Nam
Hello @namnguyenviet ,
The configuration is done like this.
I found the solution, inside Adc_Adc12bsarv2_DmaTransferComplete0, Has to be reset DMA->INT flags. And then works. I think this is a bug.